@Test public void step1ShouldReturnStatusViewIfAlreadyDone() throws Exception { IImporterManager mockImporterManager = createMockImporterManager(false, true); ImportConfirmAction action = new ImportConfirmAction(); action.setImporterManager(mockImporterManager); Assert.assertEquals(ImportConfirmAction.STATUS, action.step1()); }
@Test public void step1ShouldReturnStep1ViewIfNotAlreadyDone() throws Exception { IImporterManager mockImporterManager = createMockImporterManager(false, false); ImportConfirmAction action = new ImportConfirmAction(); action.setImporterManager(mockImporterManager); Assert.assertEquals(ImportConfirmAction.STEP_BASE_VIEW_NAME + 1, action.step1()); Assert.assertEquals(1, action.step_number); }
@Test public void step1ShouldReturnErrorViewIfIsALreadyDoneThrows() throws Exception { String ErrorMessage = "MyMessageToCheck"; IImporterManager mockImporterManager = createImporterManagerThatThrowsWhenIsAlreadyDoneIsCalled(ErrorMessage); ImportConfirmAction action = new ImportConfirmAction(); action.setImporterManager(mockImporterManager); assertEquals(ImportConfirmAction.ERROR, action.step1()); assertEquals("incorect eror message ", ErrorMessage, action.getErrorMessage()); }