HtmlEditor extends BaseEditor<String, DefaultMetadata> { @Override protected void save() { final String htmlContent = editor.getContent(); htmlEditorService.call(getSaveSuccessCallback(htmlContent.hashCode())).save(versionRecordManager.getCurrentPath(), htmlContent, null, null); concurrentUpdateSessionInfo = null; } @Inject  HtmlEditor(final HtmlResourceType htmlResourceType,
                      final HtmlEditorPresenter editor,
                      final Caller<HtmlEditorService> htmlEditorService); @PostConstruct void init(); @OnStartup void onStartup(final ObservablePath path,
                          final PlaceRequest place); @Override @WorkbenchPartTitleDecoration IsWidget getTitle(); @Override @WorkbenchPartTitle String getTitleText(); @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); @WorkbenchPartView IsWidget getView();  }
@Test public void testSave() { final ObservablePath path = mock(ObservablePath.class); final RemoteCallback successCallback = mock(RemoteCallback.class); final String content = "content"; doReturn(content).when(presenter).getContent(); doReturn(path).when(versionRecordManagerMock).getCurrentPath(); doReturn(successCallback).when(htmlEditor).getSaveSuccessCallback(anyInt()); htmlEditor.save(); verify(htmlEditorService).save(path, content, null, null); verify(successCallback).callback(any(Path.class)); }