ProjectProblemDialogPresenter implements ProjectProblemDialogView.ActionDelegate { @Override public void onEnterClicked() { view.hide(); callback.onConfigure(getSourceEstimation()); } @Inject  ProjectProblemDialogPresenter(final @NotNull ProjectProblemDialogView view,
                                         final ProjectTypeRegistry projectTypeRegistry,
                                         final CoreLocalizationConstant localizedConstant); void showDialog(@Nullable List<SourceEstimation> sourceEstimationList, @NotNull ProjectProblemDialogCallback callback); @Override void onOpenAsIs(); @Override void onOpenAs(); @Override void onConfigure(); @Override void onEnterClicked(); @Override void onSelectedTypeChanged(String projectType);  }
@Test public void onEnterClickedTest() throws Exception { List<SourceEstimation> list = new ArrayList<>(1); SourceEstimation mavenSourceEstimation = mock(SourceEstimation.class); list.add(mavenSourceEstimation); when(mavenSourceEstimation.getType()).thenReturn(MAVEN_PROJECT_TYPE); when(mavenSourceEstimation.isPrimaryable()).thenReturn(true); when(projectTypeRegistry.getProjectType(MAVEN_PROJECT_TYPE)).thenReturn(mock(ProjectTypeDefinition.class)); presenter.showDialog(list, callback); presenter.onConfigure(); verify(view).hide(); verify(callback).onConfigure(eq(mavenSourceEstimation)); }