@Override public void onStartup(final PlaceRequest place) { super.onStartup( place ); realPresenter.onStartup( place ); }
@Test public void testOnStartupNoRepositoryNoProject() throws Exception { when(workbenchContext.getActiveOrganizationalUnit()).thenReturn(organizationalUnit); final PlaceRequest placeRequest = mock(PlaceRequest.class); presenter.onStartup(placeRequest); verify(view, times(1)).setModulesViewVisible(eq(false)); verify(view, times(1)).clearDataView(); verify(modulesView, times(1)).enableActions(eq(true)); }
@Test public void testOnStartupWithRepositoryNoProject() throws Exception { when(workbenchContext.getActiveOrganizationalUnit()).thenReturn(organizationalUnit); when(workbenchContext.getActiveRepository()).thenReturn(repository); final PlaceRequest placeRequest = mock(PlaceRequest.class); presenter.onStartup(placeRequest); verify(view, times(1)).setModulesViewVisible(eq(false)); verify(view, times(1)).clearDataView(); verify(modulesView, times(1)).enableActions(eq(true)); }
@Test public void testOnStartupWithRepositoryWithProjectNoModel() throws Exception { when(workbenchContext.getActiveOrganizationalUnit()).thenReturn(organizationalUnit); when(workbenchContext.getActiveRepository()).thenReturn(repository); when(workbenchContext.getActiveProject()).thenReturn(project); final RepositoryStructureModel model = null; when(repositoryStructureService.load(eq(repository), anyString())).thenReturn(model); final PlaceRequest placeRequest = mock(PlaceRequest.class); presenter.onStartup(placeRequest); verify(view, times(1)).setModulesViewVisible(eq(false)); verify(view, times(1)).clearDataView(); verify(modulesView, times(1)).enableActions(eq(true)); verify(view, times(1)).showBusyIndicator(Constants.INSTANCE.Loading()); verify(view, times(1)).hideBusyIndicator(); }
presenter.onStartup(placeRequest);
@Test public void testOnInitRepositoryStructureNonClashingGAV() { when(workbenchContext.getActiveOrganizationalUnit()).thenReturn(organizationalUnit); when(workbenchContext.getActiveRepository()).thenReturn(repository); when(workbenchContext.getActiveProject()).thenReturn(project); final RepositoryStructureModel model = new RepositoryStructureModel(); final POM pom = new POM(new GAV("groupId", "artifactId", "version")); model.setManaged(true); model.setPOM(pom); when(repositoryStructureService.load(eq(repository), anyString())).thenReturn(model); final PlaceRequest placeRequest = mock(PlaceRequest.class); presenter.onStartup(placeRequest); presenter.onInitRepositoryStructure(); verify(view, times(2)).showBusyIndicator(eq(Constants.INSTANCE.Loading())); verify(view, times(1)).showBusyIndicator(eq(Constants.INSTANCE.CreatingRepositoryStructure())); verify(view, times(3)).hideBusyIndicator(); }
presenter.onStartup(placeRequest);
presenter.onStartup(placeRequest);
presenter.onStartup(placeRequest);
presenter.onStartup(placeRequest);
presenter.onStartup(placeRequest);