JsWorkbenchLazyPerspectiveActivity extends AbstractWorkbenchPerspectiveActivity implements JsWorkbenchLazyPerspective { @Override public void updateRealContent(final JavaScriptObject backedPerspectiveJsObject) { this.loaded = true; backedPerspective = getBackedPerspective(backedPerspectiveJsObject); if (activityManager.isStarted(this)) { getBackedPerspective().onStartup(place); } if (open) { getBackedPerspective().onOpen(); placeManager.goTo(new ForcedPlaceRequest(backedPerspectiveId)); } } JsWorkbenchLazyPerspectiveActivity(final AppFormerComponentsRegistry.Entry registryEntry,
                                              final PlaceManager placeManager,
                                              final ActivityManager activityManager,
                                              final Consumer<String> lazyLoadingParentScript); @Override void updateRealContent(final JavaScriptObject backedPerspectiveJsObject); boolean isPerspectiveTemplated(final JsNativePerspective jsPerspective); @Override PerspectiveActivity get(); @Override void onStartup(final PlaceRequest place); @Override void onOpen(); @Override void onClose(); @Override void onShutdown(); @Override ResourceType getResourceType(); @Override String getIdentifier(); @Override boolean isDefault(); @Override boolean isTransient(); @Override void getMenus(final Consumer<Menus> consumer); @Override ToolBar getToolBar(); @Override PerspectiveDefinition getDefaultPerspectiveLayout();  }
@Test public void updateRealContent() { jsWorkbenchLazyPerspectiveActivity.onStartup(mock(PlaceRequest.class)); jsWorkbenchLazyPerspectiveActivity.onOpen(); final PerspectiveActivity perspectiveActivity = mock(PerspectiveActivity.class); doReturn(perspectiveActivity).when(jsWorkbenchLazyPerspectiveActivity).getBackedPerspective(any()); doReturn(true).when(activityManager).isStarted(any()); jsWorkbenchLazyPerspectiveActivity.updateRealContent(mock(JavaScriptObject.class)); assertEquals(perspectiveActivity, jsWorkbenchLazyPerspectiveActivity.backedPerspective); verify(perspectiveActivity).onStartup(any()); verify(perspectiveActivity).onOpen(); verify(placeManager).goTo((PlaceRequest) any()); }