use of com.b2international.snowowl.core.ComponentIdentifier in project snow-owl by b2ihealthcare.
the class ValidationWhiteListApiTest method filterByComponentIdentifier.
@Test
public void filterByComponentIdentifier() throws Exception {
final ComponentIdentifier componentIdentifier = ComponentIdentifier.of("concept", "12345678");
createWhiteLists("5", COMPONENT_ID);
createWhiteLists("6", componentIdentifier);
final ValidationWhiteLists whiteLists = ValidationRequests.whiteList().prepareSearch().filterByComponentIdentifier(componentIdentifier.getComponentId()).filterByComponentType(componentIdentifier.getComponentType()).buildAsync().getRequest().execute(context);
assertThat(whiteLists).hasSize(1);
assertThat(whiteLists.first().get().getComponentIdentifier().getComponentId()).isEqualTo(componentIdentifier.getComponentId());
}
use of com.b2international.snowowl.core.ComponentIdentifier in project snow-owl by b2ihealthcare.
the class SnomedCompareRestRequestTest method testCompareWithDeletedComponents.
@Test
public void testCompareWithDeletedComponents() throws Exception {
final String newConceptId = createNewConcept(parentBranch);
final String parentBranchPath = parentBranch.toString();
final String childBranchPath = createBranch(parentBranchPath, "SNOMEDCT-DELETED");
final Set<ComponentIdentifier> newIds = prepareNewChanges(newConceptId, parentBranch);
final ComponentIdentifier concept = newIds.stream().filter(ci -> ci.getComponentType() == SnomedConcept.TYPE).findFirst().get();
SnomedRequests.prepareDeleteConcept(concept.getComponentId()).build(childBranchPath, RestExtensions.USER, "Delete concept on child branch").execute(bus).getSync();
final BranchCompareResult compareResult = getCompareResult(parentBranchPath, childBranchPath);
// compare task branch and its parent
assertThat(compareResult.getNewComponents()).isEmpty();
assertThat(compareResult.getChangedComponents()).isEmpty();
assertThat(compareResult.getDeletedComponents()).containsAll(newIds);
}
use of com.b2international.snowowl.core.ComponentIdentifier in project snow-owl by b2ihealthcare.
the class SnomedCompareRestRequestTest method testCompareWithChangedNewComponents.
@Test
public void testCompareWithChangedNewComponents() throws IOException {
final String newConceptId = createNewConcept(branchPath);
final BranchCompareResult compareResult = getCompareResult(parentBranch.getPath(), branchPath.getPath());
final Set<ComponentIdentifier> newIds = prepareNewChanges(newConceptId, branchPath);
assertThat(compareResult.getNewComponents()).containsAll(newIds);
assertThat(compareResult.getChangedComponents()).doesNotContainAnyElementsOf(newIds);
assertThat(compareResult.getDeletedComponents()).isEmpty();
}
Aggregations