use of com.b2international.snowowl.snomed.cis.domain.SctId in project snow-owl by b2ihealthcare.
the class SnomedConceptApiTest method createConceptWithReservedId.
@Test
public void createConceptWithReservedId() {
ISnomedIdentifierService identifierService = ApplicationContext.getServiceForClass(ISnomedIdentifierService.class);
String conceptId = Iterables.getOnlyElement(identifierService.reserve(null, ComponentCategory.CONCEPT, 1));
String createConceptId = createConcept(branchPath, createConceptRequestBody(Concepts.ROOT_CONCEPT).with("id", conceptId));
assertEquals(conceptId, createConceptId);
SctId conceptSctId = SnomedRequests.identifiers().prepareGet().setComponentId(conceptId).buildAsync().execute(getBus()).getSync(1, TimeUnit.MINUTES).first().get();
assertEquals(IdentifierStatus.ASSIGNED.getSerializedName(), conceptSctId.getStatus());
}
use of com.b2international.snowowl.snomed.cis.domain.SctId in project snow-owl by b2ihealthcare.
the class SnomedConcreteValueApiTest method createConcreteValueWithReservedId.
@Test
public void createConcreteValueWithReservedId() {
ISnomedIdentifierService identifierService = getServiceForClass(ISnomedIdentifierService.class);
String relationshipId = Iterables.getOnlyElement(identifierService.reserve(null, ComponentCategory.RELATIONSHIP, 1));
Json requestBody = createConcreteValueRequestBody(Concepts.ROOT_CONCEPT, Concepts.PART_OF, new RelationshipValue("string value")).with("id", relationshipId).with("commitComment", "Created new concrete value with reserved identifier");
createComponent(branchPath, SnomedComponentType.RELATIONSHIP, requestBody).statusCode(201).header("Location", endsWith("/" + relationshipId));
SctId concreteValueSctId = SnomedRequests.identifiers().prepareGet().setComponentId(relationshipId).buildAsync().execute(getBus()).getSync().first().get();
assertEquals(IdentifierStatus.ASSIGNED.getSerializedName(), concreteValueSctId.getStatus());
}
Aggregations