@BeforeTest private void initializeMocks() { parentProcessor = mock(CommandProcessor.class); when(parentProcessor.doCommand(eq(VALID_COMMAND), Matchers.<String[]>any())).thenReturn(null); when(parentProcessor.doCommand(eq(EXCEPTION_THROWING_COMMAND), Matchers.<String[]>any())) .thenThrow(new RuntimeException()); exceptionThrowingScreenshotter = new ExceptionThrowingScreenshotter(); processor = new ScreenshotHttpCommandProcessor(parentProcessor, exceptionThrowingScreenshotter); }
private String executeCommand(String methodName, final String[] values) { String output = commandProcessor.doCommand(methodName, values); if (output != null && LOG.isDebugEnabled()) { LOG.debug("Command processor returned '" + output + "'"); } return output; }
private String executeCommand(String methodName, final String[] values) { return commandProcessor.doCommand(methodName, values); }
private void waitForPageLoadIfNeeded(ExtendedSeleniumCommand command) { if (command.isAndWaitCommand()) { commandProcessor.doCommand("waitForPageToLoad", new String[] {"" + timeout}); } }