use of org.ihtsdo.drools.unittest.domain.RelationshipImpl in project snomed-drools by IHTSDO.
the class RuleExecutorTest method testExecuteNullRelationshipId.
@Test(expected = BadRequestRuleExecutorException.class)
public void testExecuteNullRelationshipId() throws Exception {
final Concept concept = new ConceptImpl("1").addDescription(new DescriptionImpl("2", "a ")).addRelationship(new RelationshipImpl("r1", "3")).addRelationship(new RelationshipImpl(null, "4"));
ruleExecutor.execute(RULE_SET_NAMES, Collections.singleton(concept), conceptService, descriptionService, relationshipService, true, false);
}
use of org.ihtsdo.drools.unittest.domain.RelationshipImpl in project snomed-drools by IHTSDO.
the class RuleExecutorTest method testExecuteNullConceptId.
@Test(expected = BadRequestRuleExecutorException.class)
public void testExecuteNullConceptId() throws Exception {
final Concept concept = new ConceptImpl(null).addDescription(new DescriptionImpl("2", "a ")).addRelationship(new RelationshipImpl("r1", "3")).addRelationship(new RelationshipImpl("r2", "4"));
ruleExecutor.execute(RULE_SET_NAMES, Collections.singleton(concept), conceptService, descriptionService, relationshipService, true, false);
}
use of org.ihtsdo.drools.unittest.domain.RelationshipImpl in project snomed-drools by IHTSDO.
the class RuleExecutorTest method testExecuteNullDescriptionId.
@Test(expected = BadRequestRuleExecutorException.class)
public void testExecuteNullDescriptionId() throws Exception {
final Concept concept = new ConceptImpl("1").addDescription(new DescriptionImpl(null, "a ")).addRelationship(new RelationshipImpl("r1", "3")).addRelationship(new RelationshipImpl("r2", "4"));
ruleExecutor.execute(RULE_SET_NAMES, Collections.singleton(concept), conceptService, descriptionService, relationshipService, true, false);
}
use of org.ihtsdo.drools.unittest.domain.RelationshipImpl in project snomed-drools by IHTSDO.
the class RuleExecutorTest method testExecute.
@Test
public void testExecute() {
final Concept concept = new ConceptImpl("1").addDescription(new DescriptionImpl("2", "a ")).addRelationship(new RelationshipImpl("r1", "3")).addRelationship(new RelationshipImpl("r2", "4"));
final List<InvalidContent> invalidContent = ruleExecutor.execute(RULE_SET_NAMES, Collections.singleton(concept), conceptService, descriptionService, relationshipService, true, false);
Assert.assertEquals(1, invalidContent.size());
final InvalidContent invalidContent1 = invalidContent.get(0);
Assert.assertEquals(concept.getId(), invalidContent1.getConceptId());
Assert.assertEquals("Term should not contain double spaces.", invalidContent1.getMessage());
Assert.assertEquals("2", invalidContent1.getComponentId());
}
use of org.ihtsdo.drools.unittest.domain.RelationshipImpl in project snomed-drools by IHTSDO.
the class RuleExecutorTest method testExecuteOnlyUnpublishedContent.
@Test
public void testExecuteOnlyUnpublishedContent() throws Exception {
final Concept concept = new ConceptImpl("1").addDescription(new DescriptionImpl("2", "a ").published()).addRelationship(new RelationshipImpl("r1", "3")).addRelationship(new RelationshipImpl("r2", "4"));
final List<InvalidContent> invalidContent = ruleExecutor.execute(RULE_SET_NAMES, Collections.singleton(concept), conceptService, descriptionService, relationshipService, false, false);
Assert.assertEquals(0, invalidContent.size());
}
Aggregations