Mock Runtime.getRuntime ()?
¿Alguien puede hacer alguna sugerencia sobre la mejor manera de usar EasyMock para esperar una llamada aRuntime.getRuntime().exec(xxx)
?
Podría mover la llamada a un método en otra clase que implemente una interfaz, pero preferiría no hacerlo en un mundo ideal.
interface RuntimeWrapper {
ProcessWrapper execute(String command) throws IOException;
}
interface ProcessWrapper {
int waitFor() throws InterruptedException;
}
Me preguntaba si alguien tenía alguna otra sugerencia.