UserEditorScreen { @OnClose public void onClose() { userEditorWorkflow.clear(); userCreationWorkflow.clear(); this.userId = 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 USER_ID; static final String ADD_USER; }
@Test public void testOnClose() { tested.userId = "user1"; tested.onClose(); assertNull(tested.userId); verify(userEditorWorkflow, times(1)).clear(); verify(userCreationWorkflow, times(1)).clear(); }