@Override public void callback(final RepositoryStructureModel model) { view.hideBusyIndicator(); setModel(model); } };
@Override public void callback(final Path response) { view.hideBusyIndicator(); loadModel(projectContext.getActiveRepository(), projectContext.getActiveBranch()); } },
@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(); }
times(1)).showBusyIndicator(Constants.INSTANCE.Loading()); verify(view, times(1)).hideBusyIndicator();
@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(); }
times(1)).showBusyIndicator(eq(Constants.INSTANCE.CreatingRepositoryStructure())); verify(view, times(1)).hideBusyIndicator();
times(1)).showBusyIndicator(Constants.INSTANCE.Loading()); verify(view, times(1)).hideBusyIndicator();
times(2)).showBusyIndicator(eq(Constants.INSTANCE.CreatingRepositoryStructure())); verify(view, times(3)).hideBusyIndicator();