@Test public void fileNameChangedWhenIncorrectFileForUploadChoosedTest() { String parsedProjectName = ""; String incorrectFileName = "fakepath\\angularjs.txt"; when(view.getFileName()).thenReturn(incorrectFileName); when(view.getProjectName()).thenReturn(parsedProjectName); presenter.fileNameChanged(); verify(view, never()).setProjectName(eq(parsedProjectName)); verify(view, never()).setEnabledImportButton(anyBoolean()); }
@Override public void fileNameChanged() { String projectName = extractProjectName(view.getFileName()); if (!projectName.isEmpty()) { view.setProjectName(projectName); projectNameChanged(); } }
LocalZipImporterPagePresenter implements LocalZipImporterPageView.ActionDelegate { @Override public void fileNameChanged() { String projectName = extractProjectName(view.getFileName()); if (!projectName.isEmpty()) { view.setProjectName(projectName); projectNameChanged(); } } }
LocalZipImporterPagePresenter implements LocalZipImporterPageView.ActionDelegate { @Override public void fileNameChanged() { String projectName = extractProjectName(view.getFileName()); if (!projectName.isEmpty()) { view.setProjectName(projectName); projectNameChanged(); } } @Inject  LocalZipImporterPagePresenter(LocalZipImporterPageView view,
                                         DtoFactory dtoFactory,
                                         CoreLocalizationConstant locale,
                                         @Named("restContext") String restContext,
                                         @Named("workspaceId") String workspaceId,
                                         EventBus eventBus,
                                         VfsServiceClient vfsServiceClient,
                                         ProjectServiceClient projectServiceClient,
                                         DialogFactory dialogFactory,
                                         ImportProjectNotificationSubscriber importProjectNotificationSubscriber); }
LocalZipImporterPagePresenter implements LocalZipImporterPageView.ActionDelegate { @Override public void fileNameChanged() { String projectName = extractProjectName(view.getFileName()); if (!projectName.isEmpty()) { view.setProjectName(projectName); projectNameChanged(); } } @Inject  LocalZipImporterPagePresenter(LocalZipImporterPageView view,
                                         DtoFactory dtoFactory,
                                         CoreLocalizationConstant locale,
                                         @Named("restContext") String restContext,
                                         @Named("workspaceId") String workspaceId,
                                         EventBus eventBus,
                                         VfsServiceClient vfsServiceClient,
                                         ProjectServiceClient projectServiceClient,
                                         DialogFactory dialogFactory,
                                         ImportProjectNotificationSubscriber importProjectNotificationSubscriber); void show(); @Override void projectNameChanged(); @Override void fileNameChanged(); @Override void onSubmitComplete(String result); @Override void onCancelClicked(); @Override void onImportClicked(); }
LocalZipImporterPagePresenter implements LocalZipImporterPageView.ActionDelegate { @Override public void fileNameChanged() { String projectName = extractProjectName(view.getFileName()); if (!projectName.isEmpty()) { view.setProjectName(projectName); projectNameChanged(); } } @Inject  LocalZipImporterPagePresenter(LocalZipImporterPageView view,
                                         DtoFactory dtoFactory,
                                         CoreLocalizationConstant locale,
                                         @Named("restContext") String restContext,
                                         @Named("workspaceId") String workspaceId,
                                         EventBus eventBus,
                                         VfsServiceClient vfsServiceClient,
                                         ProjectServiceClient projectServiceClient,
                                         DialogFactory dialogFactory,
                                         ImportProjectNotificationSubscriber importProjectNotificationSubscriber); void show(); @Override void projectNameChanged(); @Override void fileNameChanged(); @Override void onSubmitComplete(String result); @Override void onCancelClicked(); @Override void onImportClicked();  }