Search in sources :

Example 1 with RelationshipChangeDocument

use of com.b2international.snowowl.snomed.reasoner.index.RelationshipChangeDocument in project snow-owl by b2ihealthcare.

the class RelationshipChangeSerializationTest method indexNewRelationship.

@Test
public void indexNewRelationship() throws Exception {
    final String classificationId = randomUUID();
    final RelationshipChangeDocument expected = RelationshipChangeDocument.builder().characteristicTypeId(Concepts.INFERRED_RELATIONSHIP).classificationId(classificationId).destinationId("destinationId").group(1).nature(ChangeNature.NEW).relationshipId("12345678901").released(Boolean.FALSE).sourceId("sourceId").typeId("typeId").unionGroup(2).build();
    indexDocument(expected);
    final RelationshipChangeDocument actual = rawIndex().read(r -> r.search(Query.select(RelationshipChangeDocument.class).where(Expressions.matchAll()).build()).first());
    assertDocEquals(expected, actual);
}
Also used : RelationshipChangeDocument(com.b2international.snowowl.snomed.reasoner.index.RelationshipChangeDocument) BaseRevisionIndexTest(com.b2international.index.revision.BaseRevisionIndexTest) Test(org.junit.Test)

Example 2 with RelationshipChangeDocument

use of com.b2international.snowowl.snomed.reasoner.index.RelationshipChangeDocument in project snow-owl by b2ihealthcare.

the class RelationshipChangeSerializationTest method indexUpdatedRelationship.

@Test
public void indexUpdatedRelationship() throws Exception {
    final String classificationId = randomUUID();
    final RelationshipChangeDocument expected = RelationshipChangeDocument.builder().classificationId(classificationId).destinationId("destinationId").group(50).nature(ChangeNature.UPDATED).relationshipId("12345678901").released(Boolean.TRUE).sourceId("sourceId").build();
    indexDocument(expected);
    final RelationshipChangeDocument actual = rawIndex().read(r -> r.search(Query.select(RelationshipChangeDocument.class).where(Expressions.matchAll()).build()).first());
    assertDocEquals(expected, actual);
}
Also used : RelationshipChangeDocument(com.b2international.snowowl.snomed.reasoner.index.RelationshipChangeDocument) BaseRevisionIndexTest(com.b2international.index.revision.BaseRevisionIndexTest) Test(org.junit.Test)

Example 3 with RelationshipChangeDocument

use of com.b2international.snowowl.snomed.reasoner.index.RelationshipChangeDocument in project snow-owl by b2ihealthcare.

the class RelationshipChangeSerializationTest method indexRedundantRelationship.

@Test
public void indexRedundantRelationship() throws Exception {
    final String classificationId = randomUUID();
    final RelationshipChangeDocument expected = RelationshipChangeDocument.builder().classificationId(classificationId).destinationId("destinationId").nature(ChangeNature.REDUNDANT).relationshipId("12345678901").released(Boolean.TRUE).sourceId("sourceId").build();
    indexDocument(expected);
    final RelationshipChangeDocument actual = rawIndex().read(r -> r.search(Query.select(RelationshipChangeDocument.class).where(Expressions.matchAll()).build()).first());
    assertDocEquals(expected, actual);
}
Also used : RelationshipChangeDocument(com.b2international.snowowl.snomed.reasoner.index.RelationshipChangeDocument) BaseRevisionIndexTest(com.b2international.index.revision.BaseRevisionIndexTest) Test(org.junit.Test)

Aggregations

BaseRevisionIndexTest (com.b2international.index.revision.BaseRevisionIndexTest)3 RelationshipChangeDocument (com.b2international.snowowl.snomed.reasoner.index.RelationshipChangeDocument)3 Test (org.junit.Test)3