@Test public void onUploadClickedShouldBeExecuted() { Selection select = mock(Selection.class); FolderNode item = mock(FolderNode.class); when(selectionAgent.getSelection()).thenReturn(select); when(select.getFirstElement()).thenReturn(item); presenter.onUploadClicked(); verify(view).setLoaderVisibility(eq(true)); verify(view).setEncoding(eq(FormPanel.ENCODING_MULTIPART)); verify(view).setAction((String)anyObject()); verify(view).submit(); }
@Override public void onUploadClicked() { view.setLoaderVisibility(true); view.setEncoding(FormPanel.ENCODING_MULTIPART); view.setAction(restContext + "/project/" + workspaceId + "/upload/zipfolder/" + getParent().getPath()); view.submit(); }
UploadFolderFromZipPresenter implements UploadFolderFromZipView.ActionDelegate { @Override public void onUploadClicked() { view.setLoaderVisibility(true); view.setEncoding(FormPanel.ENCODING_MULTIPART); view.setAction(restContext + "/project/" + workspaceId + "/upload/zipfolder/" + getParent().getPath()); view.submit(); } }
UploadFolderFromZipPresenter implements UploadFolderFromZipView.ActionDelegate { @Override public void onUploadClicked() { view.setLoaderVisibility(true); view.setEncoding(FormPanel.ENCODING_MULTIPART); view.setAction(restContext + "/project/" + workspaceId + "/upload/zipfolder/" + getParent().getPath()); view.submit(); } @Inject  UploadFolderFromZipPresenter(UploadFolderFromZipView view,
                                        @Named("restContext") String restContext,
                                        @Named("workspaceId") String workspaceId,
                                        SelectionAgent selectionAgent,
                                        EditorAgent editorAgent,
                                        EventBus eventBus,
                                        NotificationManager notificationManager); }
UploadFolderFromZipPresenter implements UploadFolderFromZipView.ActionDelegate { @Override public void onUploadClicked() { view.setLoaderVisibility(true); view.setEncoding(FormPanel.ENCODING_MULTIPART); view.setAction(restContext + "/project/" + workspaceId + "/upload/zipfolder/" + getParent().getPath()); view.submit(); } @Inject  UploadFolderFromZipPresenter(UploadFolderFromZipView view,
                                        @Named("restContext") String restContext,
                                        @Named("workspaceId") String workspaceId,
                                        SelectionAgent selectionAgent,
                                        EditorAgent editorAgent,
                                        EventBus eventBus,
                                        NotificationManager notificationManager); void showDialog(); @Override void onCancelClicked(); @Override void onSubmitComplete(String result); @Override void onUploadClicked(); @Override void onFileNameChanged(); }
UploadFolderFromZipPresenter implements UploadFolderFromZipView.ActionDelegate { @Override public void onUploadClicked() { view.setLoaderVisibility(true); view.setEncoding(FormPanel.ENCODING_MULTIPART); view.setAction(restContext + "/project/" + workspaceId + "/upload/zipfolder/" + getParent().getPath()); view.submit(); } @Inject  UploadFolderFromZipPresenter(UploadFolderFromZipView view,
                                        @Named("restContext") String restContext,
                                        @Named("workspaceId") String workspaceId,
                                        SelectionAgent selectionAgent,
                                        EditorAgent editorAgent,
                                        EventBus eventBus,
                                        NotificationManager notificationManager); void showDialog(); @Override void onCancelClicked(); @Override void onSubmitComplete(String result); @Override void onUploadClicked(); @Override void onFileNameChanged();  }