SubversionProjectImporterPresenter extends AbstractWizardPage<ImportProject> implements SubversionProjectImporterView.ActionDelegate { @Override public void go(AcceptsOneWidget container) { final NewProject project = dataObject.getProject(); view.setProjectName(project.getName()); view.setProjectDescription(project.getDescription()); view.setProjectVisibility(PUBLIC_VISIBILITY.equals(project.getVisibility())); view.setProjectUrl(dataObject.getSource().getProject().getLocation()); container.setWidget(view); view.setUrlTextBoxFocused(); } @Inject  SubversionProjectImporterPresenter(SubversionProjectImporterView view); @Override void go(AcceptsOneWidget container); @Override void onProjectNameChanged(); @Override void onProjectUrlChanged(); @Override void onProjectRelativePathChanged(); @Override void onProjectDescriptionChanged(); @Override void onProjectVisibilityChanged(); @Override void onCredentialsChanged(); static final String PUBLIC_VISIBILITY; static final String PRIVATE_VISIBILITY; }
@Test public void testGo() throws Exception { final String importerDescription = "Some description."; final AcceptsOneWidget container = mock(AcceptsOneWidget.class); final ProjectImporterDescriptor projectImporter = mock(ProjectImporterDescriptor.class); when(projectImporter.getDescription()).thenReturn(importerDescription); presenter.go(container); verify(container).setWidget(eq(view)); verify(view).setProjectName(anyString()); verify(view).setProjectDescription(anyString()); verify(view).setProjectVisibility(anyBoolean()); verify(view).setProjectUrl(anyString()); verify(view).setUrlTextBoxFocused(); }