use of org.kie.kogito.decision.DecisionModelMetadata in project kogito-runtimes by kiegroup.
the class SpringBootModelEventEmitterTest method makeModel.
private DecisionModelResource makeModel() {
final DecisionModelResource model = mock(DecisionModelResource.class);
when(model.getGav()).thenReturn(new KogitoGAV("groupId", "artifactId", "version"));
when(model.getModelName()).thenReturn("name");
when(model.getNamespace()).thenReturn("namespace");
when(model.getModelMetadata()).thenReturn(new DecisionModelMetadata("http://www.omg.org/spec/DMN/20151101/dmn.xsd"));
when(model.get()).thenReturn("model");
return model;
}
use of org.kie.kogito.decision.DecisionModelMetadata in project kogito-runtimes by kiegroup.
the class DecisionModelEventTest method testGetters.
@Test
public void testGetters() {
final KogitoGAV gav = new KogitoGAV("groupID", "artifactId", "version");
final DecisionModelEvent e = new DecisionModelEvent(gav, "name", "namespace", new DecisionModelMetadata("http://www.omg.org/spec/DMN/20151101/dmn.xsd"), "definition");
assertEquals(gav.getGroupId(), e.getGav().getGroupId());
assertEquals(gav.getArtifactId(), e.getGav().getArtifactId());
assertEquals(gav.getVersion(), e.getGav().getVersion());
assertEquals("name", e.getName());
assertEquals("namespace", e.getNamespace());
assertEquals(ModelDomain.DECISION, e.getModelMetadata().getModelDomain());
assertEquals("http://www.omg.org/spec/DMN/20151101/dmn.xsd", e.getModelMetadata().getSpecVersion());
assertEquals("definition", e.getDefinition());
}
use of org.kie.kogito.decision.DecisionModelMetadata in project kogito-runtimes by kiegroup.
the class DecisionModelMetadataTest method testDeserialization.
@Test
public void testDeserialization() throws JsonProcessingException {
String toRead = TracingTestUtils.readResourceAsString("/decisionmodelmetadata.json");
ModelMetadata retrieved = new ObjectMapper().readValue(toRead, ModelMetadata.class);
assertNotNull(retrieved);
assertTrue(retrieved instanceof DecisionModelMetadata);
}
use of org.kie.kogito.decision.DecisionModelMetadata in project kogito-runtimes by kiegroup.
the class DefaultDecisionModelResourceTest method testGetters.
@Test
public void testGetters() {
final DecisionModelResource resource = new DefaultDecisionModelResource(GAV, "namespace", "name", new DecisionModelMetadata("http://www.omg.org/spec/DMN/20151101/dmn.xsd"), new InputStreamReader(new ByteArrayInputStream(CONTENT.getBytes())));
assertEquals(GAV, resource.getGav());
assertEquals("name", resource.getModelName());
assertEquals("namespace", resource.getNamespace());
assertEquals(ModelDomain.DECISION, resource.getModelMetadata().getModelDomain());
assertEquals("http://www.omg.org/spec/DMN/20151101/dmn.xsd", resource.getModelMetadata().getSpecVersion());
}
use of org.kie.kogito.decision.DecisionModelMetadata in project kogito-runtimes by kiegroup.
the class DefaultDecisionModelResourceTest method testLoad.
@Test
public void testLoad() {
final DecisionModelResource resource = new DefaultDecisionModelResource(GAV, "namespace", "name", new DecisionModelMetadata("http://www.omg.org/spec/DMN/20151101/dmn.xsd"), new InputStreamReader(new ByteArrayInputStream(CONTENT.getBytes())));
assertEquals(CONTENT, resource.get().trim());
}
Aggregations