### Question:
NewWorkspaceProjectWizard extends AbstractWizard implements WorkspaceProjectWizard { @Override public void complete() { onComplete(DeploymentMode.VALIDATED); } NewWorkspaceProjectWizard(); @Inject  NewWorkspaceProjectWizard(final Caller<WorkspaceProjectService> projectService,
                                     final PlaceManager placeManager,
                                     final Event<NotificationEvent> notificationEvent,
                                     final POMWizardPage pomWizardPage,
                                     final BusyIndicatorView busyIndicatorView,
                                     final ConflictingRepositoriesPopup conflictingRepositoriesPopup,
                                     final WorkspaceProjectContext context,
                                     final KiePOMDefaultOptions pomDefaultOptions); @PostConstruct void setupPages(); @Override String getTitle(); @Override List<WizardPage> getPages(); @Override Widget getPageWidget(int pageNumber); @Override int getPreferredHeight(); @Override int getPreferredWidth(); @Override void isComplete(final Callback<Boolean> callback); @Override void initialise(); @Override void initialise(final POM pom); @Override void complete(); @Override void close(); @Override void start(); @Override void start(final Callback<WorkspaceProject> callback,
                      final boolean openEditor);  }### Answer:
@Test public void testCompleteNonClashingGAV() throws Exception { final Path repositoryRoot = mock(Path.class); final POM pom = mock(POM.class); when(moduleContext.getActiveOrganizationalUnit()).thenReturn(Optional.of(mock(OrganizationalUnit.class))); when(moduleContext.getActiveRepositoryRoot()).thenReturn(Optional.of(repositoryRoot)); when(pomWizardPage.getPom()).thenReturn(pom); wizard.complete(); verify(projectService, times(1)).newProject(any(OrganizationalUnit.class), eq(pom), eq(DeploymentMode.VALIDATED)); verify(busyIndicatorView, times(1)).showBusyIndicator(any(String.class)); verify(busyIndicatorView, times(1)).hideBusyIndicator(); }
@Test @SuppressWarnings("unchecked") public void testCompleteClashingGAV() throws Exception { final Path repositoryRoot = mock(Path.class); final POM pom = mock(POM.class); final GAV gav = mock(GAV.class); when(projectService.newProject(any(OrganizationalUnit.class), eq(pom), eq(DeploymentMode.VALIDATED))).thenThrow(GAVAlreadyExistsException.class); when(moduleContext.getActiveOrganizationalUnit()).thenReturn(Optional.of(mock(OrganizationalUnit.class))); when(moduleContext.getActiveRepositoryRoot()).thenReturn(Optional.of(repositoryRoot)); when(pomWizardPage.getPom()).thenReturn(pom); when(pom.getGav()).thenReturn(gav); final ArgumentCaptor<Command> commandArgumentCaptor = ArgumentCaptor.forClass(Command.class); wizard.complete(); verify(projectService, timeout(1)).newProject(any(OrganizationalUnit.class), eq(pom), eq(DeploymentMode.VALIDATED)); verify(busyIndicatorView, times(1)).showBusyIndicator(any(String.class)); verify(busyIndicatorView, times(1)).hideBusyIndicator(); verify(conflictingRepositoriesPopup, times(1)).setContent(eq(gav), any(Set.class), commandArgumentCaptor.capture()); verify(conflictingRepositoriesPopup, times(1)).show(); assertNotNull(commandArgumentCaptor.getValue()); commandArgumentCaptor.getValue().execute(); verify(conflictingRepositoriesPopup, times(1)).hide(); verify(projectService, times(1)).newProject(any(OrganizationalUnit.class), eq(pom), eq(DeploymentMode.FORCED)); verify(busyIndicatorView, times(2)).showBusyIndicator(any(String.class)); verify(busyIndicatorView, times(2)).hideBusyIndicator(); }