ScreenLayoutDragComponent implements /*PerspectiveEditorCoreComponent*/ LayoutDragComponent,
                                                  HasModalConfiguration { @Override public void removeCurrentWidget(RenderingContext ctx) { DefaultPlaceRequest place = buildPlaceRequest(ctx.getComponent().getProperties()); if (place != null) { placeManager.closePlace(place); } } @Inject  ScreenLayoutDragComponent(PlaceManager placeManager); @PostConstruct void setup(); @Override String getDragComponentTitle(); @Override String getDragComponentIconClass(); @Override IsWidget getPreviewWidget(RenderingContext ctx); @Override void removeCurrentWidget(RenderingContext ctx); @Override IsWidget getShowWidget(RenderingContext ctx); @Override Modal getConfigurationModal(ModalConfigurationContext ctx); void observeEditComponentEventFromPropertyEditor(@Observes PropertyEditorChangeEvent event); void onNewPluginRegistered(@Observes NewPluginRegistered newPluginRegistered); void onPluginUnregistered(@Observes PluginUnregistered pluginUnregistered); static final String PLACE_NAME_PARAMETER; }
@Test public void removeCurrentWidgetTest() { RenderingContext renderingContext = mock(RenderingContext.class); LayoutComponent t = new LayoutComponent(); t.addProperty(ScreenLayoutDragComponent.PLACE_NAME_PARAMETER, "dora"); when(renderingContext.getComponent()).thenReturn(t); screenLayoutDragComponent.removeCurrentWidget(renderingContext); verify(placeManager).closePlace(any(DefaultPlaceRequest.class)); }