GroupEditorScreen { @OnClose public void onClose() { groupEditorWorkflow.clear(); groupCreationWorkflow.clear(); this.groupName = null; }  @PostConstruct void init(); @OnStartup void onStartup(final PlaceRequest placeRequest); @OnOpen void onOpen(); @OnMayClose boolean onMayClose(); @OnClose void onClose(); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView IsWidget getWidget(); @WorkbenchContextId String getMyContextRef(); static final String SCREEN_ID; static final String GROUP_NAME; static final String ADD_GROUP; }
@Test public void testOnClose() { tested.groupName = "group1"; tested.onClose(); assertNull(tested.groupName); verify(groupEditorWorkflow, times(1)).clear(); verify(groupCreationWorkflow, times(1)).clear(); }