UrlExecutionProcessorStrategy extends ProcessorStrategy { void save() throws ValidatorException, StorageException { LOGGER.debug("Persisting suite {}", getObjectToRun()); try { Suite oldSuite = suiteDataService.getSuite(new SimpleDBKey(objectToRunWrapper.getRealSuite()), objectToRunWrapper.getCorrelationId()); suiteDataService.replaceSuite(oldSuite, objectToRunWrapper.getRealSuite()); } catch (StorageException e) { e.printStackTrace(); } messagesSender.sendMessage( new FinishedSuiteProcessingMessage(FinishedSuiteProcessingMessage.Status.OK, objectToRunWrapper.getCorrelationId())); } UrlExecutionProcessorStrategy();   }
@Test public void save_checkIfMethodCallsCorrectFunctions() throws StorageException, ValidatorException, JMSException { urlExecutionProcessorStrategy.init(); urlExecutionProcessorStrategy.save(); verify(suiteDataService, times(1)).getSuite(any(DBKey.class), any(String.class)); verify(suiteDataService, times(1)).replaceSuite(any(Suite.class), any(Suite.class)); }