コード例 #1
0
 @Test
 public void executeShouldReturnStatusViewIfAlreadyDone() throws Exception {
   IImporterManager mockImporterManager = createMockImporterManager(false, true);
   ImportConfirmAction action = new ImportConfirmAction();
   action.setImporterManager(mockImporterManager);
   Assert.assertEquals(ImportConfirmAction.STATUS, action.execute());
 }
コード例 #2
0
 @Test
 public void executeShouldReturnSuccessViewIfNotAlreadyDone() throws Exception {
   IImporterManager mockImporterManager = createMockImporterManager(false, false);
   ImportConfirmAction action = new ImportConfirmAction();
   action.setImporterManager(mockImporterManager);
   assertEquals(ImportConfirmAction.SUCCESS, action.execute());
 }
コード例 #3
0
 @Test
 public void executeShouldReturnStatusViewIfInProgress() throws Exception {
   IImporterManager mockImporterManager = createMockImporterManager(true, false);
   ImportConfirmAction action = new ImportConfirmAction();
   action.setImporterManager(mockImporterManager);
   assertEquals(ImportConfirmAction.STATUS, action.execute());
 }
コード例 #4
0
 @Test
 public void executeShouldReturnErrorViewIfIsALreadyDoneThrows() throws Exception {
   String ErrorMessage = "MyMessageToCheck";
   IImporterManager mockImporterManager =
       createImporterManagerThatThrowsWhenIsAlreadyDoneIsCalled(ErrorMessage);
   ImportConfirmAction action = new ImportConfirmAction();
   action.setImporterManager(mockImporterManager);
   assertEquals(ImportConfirmAction.ERROR, action.execute());
   assertEquals("incorect eror message ", ErrorMessage, action.getErrorMessage());
 }