use of org.drools.workbench.screens.scenariosimulation.model.DMNMetadata in project drools-wb by kiegroup.
the class DMNTypeServiceImplTest method getDMNMetadata.
@Test
public void getDMNMetadata() {
DMNMetadata dmnMetadata = dmnTypeServiceImpl.getDMNMetadata(mock(Path.class), "");
assertEquals(NAMESPACE, dmnMetadata.getDmnNamespace());
assertEquals(MODEL_NAME, dmnMetadata.getDmnName());
}
use of org.drools.workbench.screens.scenariosimulation.model.DMNMetadata in project drools-wb by kiegroup.
the class ScenarioSimulationEditorBusinessCentralWrapperTest method getDMNMetadata.
@Test
public void getDMNMetadata() {
ArgumentCaptor<ErrorCallback> errorCallbackArgumentCaptor = ArgumentCaptor.forClass(ErrorCallback.class);
String dmnPath = "src/test.dmn";
String dmnName = "DMN-NAME";
String dmnNameSpace = "DMN-namespace";
modelLocal.getSettings().setDmnFilePath(dmnPath);
when(dmnTypeServiceMock.getDMNMetadata(eq(pathMock), eq(dmnPath))).thenReturn(new DMNMetadata(dmnName, dmnNameSpace));
scenarioSimulationEditorBusinessClientWrapper.getDMNMetadata();
verify(dmnTypeServiceCaller, times(1)).call(isA(RemoteCallback.class), errorCallbackArgumentCaptor.capture());
verify(dmnTypeServiceMock, times(1)).getDMNMetadata(eq(pathMock), eq(dmnPath));
verify(scenarioSimulationEditorPresenterMock, times(1)).reloadSettingsDock();
assertEquals(dmnName, modelLocal.getSettings().getDmnName());
assertEquals(dmnNameSpace, modelLocal.getSettings().getDmnNamespace());
errorCallbackArgumentCaptor.getValue().error("ERROR", new Throwable());
verify(scenarioSimulationEditorPresenterMock, times(1)).sendNotification(eq("ERROR"), eq(NotificationEvent.NotificationType.ERROR));
}
Aggregations