Search in sources :

Example 1 with ValidationWhiteLists

use of com.b2international.snowowl.core.validation.whitelist.ValidationWhiteLists in project snow-owl by b2ihealthcare.

the class ValidationWhiteListApiTest method filterByRuleId.

@Test
public void filterByRuleId() throws Exception {
    createWhiteLists("3", COMPONENT_ID);
    createWhiteLists("4", COMPONENT_ID);
    final ValidationWhiteLists whiteLists = ValidationRequests.whiteList().prepareSearch().filterByRuleId("3").buildAsync().getRequest().execute(context);
    assertThat(whiteLists).hasSize(1);
    assertThat(whiteLists.first().get().getRuleId()).isEqualTo("3");
}
Also used : ValidationWhiteLists(com.b2international.snowowl.core.validation.whitelist.ValidationWhiteLists) Test(org.junit.Test)

Example 2 with ValidationWhiteLists

use of com.b2international.snowowl.core.validation.whitelist.ValidationWhiteLists in project snow-owl by b2ihealthcare.

the class ValidationWhiteListApiTest method deleteWhiteList.

@Test
public void deleteWhiteList() throws Exception {
    final String whiteList1 = createWhiteLists("1", COMPONENT_ID);
    final String whiteList2 = createWhiteLists("2", COMPONENT_ID);
    ValidationRequests.whiteList().prepareDelete(whiteList2).buildAsync().getRequest().execute(context);
    final ValidationWhiteLists WhiteLists = getWhiteLists();
    assertThat(WhiteLists.stream().map(ValidationWhiteList::getId).collect(Collectors.toList())).doesNotContain(whiteList2);
    assertThat(WhiteLists.getItems().size()).isEqualTo(1);
}
Also used : ValidationWhiteLists(com.b2international.snowowl.core.validation.whitelist.ValidationWhiteLists) Test(org.junit.Test)

Example 3 with ValidationWhiteLists

use of com.b2international.snowowl.core.validation.whitelist.ValidationWhiteLists in project snow-owl by b2ihealthcare.

the class ValidationWhiteListApiTest method getAllValidationWhiteLists.

@Test
public void getAllValidationWhiteLists() throws Exception {
    final ValidationWhiteLists validationWhiteLists = getWhiteLists();
    assertThat(validationWhiteLists).isEmpty();
}
Also used : ValidationWhiteLists(com.b2international.snowowl.core.validation.whitelist.ValidationWhiteLists) Test(org.junit.Test)

Example 4 with ValidationWhiteLists

use of com.b2international.snowowl.core.validation.whitelist.ValidationWhiteLists 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());
}
Also used : ValidationWhiteLists(com.b2international.snowowl.core.validation.whitelist.ValidationWhiteLists) ComponentIdentifier(com.b2international.snowowl.core.ComponentIdentifier) Test(org.junit.Test)

Aggregations

ValidationWhiteLists (com.b2international.snowowl.core.validation.whitelist.ValidationWhiteLists)4 Test (org.junit.Test)4 ComponentIdentifier (com.b2international.snowowl.core.ComponentIdentifier)1