use of org.kie.workbench.common.screens.datamodeller.client.context.DataModelerWorkbenchFocusEvent in project kie-wb-common by kiegroup.
the class DataModellerDocksHandlerTest method testSetDataModelerFocusEvent.
protected void testSetDataModelerFocusEvent(final boolean withPlanner, final boolean setFocus) {
when(authorizationManager.authorize(anyString(), any())).thenReturn(withPlanner);
DataModelerWorkbenchFocusEvent event = new DataModelerWorkbenchFocusEvent();
if (!setFocus) {
event = event.lostFocus();
}
handler.onDataModelerWorkbenchFocusEvent(event);
int maxDox = MIN_DOCKS;
if (withPlanner) {
maxDox++;
}
assertEquals(maxDox, handler.provideDocks(AUTHORING_PERSPECTIVE).size());
assertTrue(handler.shouldRefreshDocks());
assertEquals(!setFocus, handler.shouldDisableDocks());
verify(command).execute();
}
Aggregations