@Before public void setup() { libraryServiceCaller = new CallerMock<>(libraryService); newProjectScreen.libraryService = libraryServiceCaller; doNothing().when(newProjectScreen).gotoAuthoring(any(KieProject.class)); }
@Test public void loadTest() throws Exception { when(libraryService.getDefaultLibraryInfo()).thenReturn(getDefaultLibraryMock()); newProjectScreen.load(); verify(view).setOUAlias(ouAlias); verify(view, times(2)).addOrganizationUnit(any()); verify(view).setOrganizationUnitSelected(ou2.getIdentifier()); assertEquals(ou2.getIdentifier(), newProjectScreen.selectOu); }
@Test public void projectCreationNotifiesLibraryMonitorTest() { newProjectScreen.getSuccessCallback().callback(null); verify(libraryMonitor).setThereIsAtLeastOneProjectAccessible(true); }