use of org.drools.workbench.screens.globals.model.GlobalsEditorContent in project drools-wb by kiegroup.
the class GlobalsEditorPresenterTest method loadContent.
@Test
public void loadContent() {
presenter.loadContent();
verify(view, times(1)).showLoading();
verify(globalsEditorService, times(1)).loadContent(any(Path.class));
when(versionRecordManager.getCurrentPath()).thenReturn(mock(ObservablePath.class));
// Emulate the globals being successfully loaded
GlobalsEditorContent globalsEditorContent = mock(GlobalsEditorContent.class);
Overview overview = mock(Overview.class);
when(overview.getMetadata()).thenReturn(mock(Metadata.class));
when(globalsEditorContent.getOverview()).thenReturn(overview);
GlobalsModel globalsModel = mock(GlobalsModel.class);
when(globalsEditorContent.getModel()).thenReturn(globalsModel);
presenter.getModelSuccessCallback().callback(globalsEditorContent);
verify(view, times(1)).setContent(anyListOf(Global.class), anyListOf(String.class), anyBoolean(), anyBoolean());
verify(view, times(1)).hideBusyIndicator();
}
use of org.drools.workbench.screens.globals.model.GlobalsEditorContent in project drools-wb by kiegroup.
the class GlobalsEditorServiceImpl method constructContent.
@Override
protected GlobalsEditorContent constructContent(Path path, Overview overview) {
// De-serialize model
final GlobalsModel model = load(path);
final ModuleDataModelOracle oracle = dataModelService.getModuleDataModel(path);
final String[] fullyQualifiedClassNames = new String[oracle.getModuleModelFields().size()];
oracle.getModuleModelFields().keySet().toArray(fullyQualifiedClassNames);
// Signal opening to interested parties
resourceOpenedEvent.fire(new ResourceOpenedEvent(path, safeSessionInfo));
return new GlobalsEditorContent(model, overview, Arrays.asList(fullyQualifiedClassNames));
}
Aggregations