use of com.b2international.snowowl.core.validation.issue.ValidationIssues in project snow-owl by b2ihealthcare.
the class SnomedValidationIssueDetailTest method filterByModuleId.
@Test
public void filterByModuleId() {
final Map<String, Object> details = ImmutableMap.of(SnomedIssueDetailFilterFields.COMPONENT_MODULE_ID, "1010101010101010");
final ValidationIssue issueWithDetails = createIssue("1122334455", details);
final ValidationIssue issueWithoutDetails = createIssue("5544332211", Collections.emptyMap());
save(issueWithDetails);
save(issueWithoutDetails);
ValidationIssues issues = ValidationRequests.issues().prepareSearch().all().filterByDetails(details).buildAsync().getRequest().execute(context);
assertComponents(issues, issueWithDetails.getAffectedComponent());
}
use of com.b2international.snowowl.core.validation.issue.ValidationIssues in project snow-owl by b2ihealthcare.
the class SnomedValidationIssueDetailTest method filterByModuleIds.
@Test
public void filterByModuleIds() {
final Map<String, Object> details = ImmutableMap.of(SnomedIssueDetailFilterFields.COMPONENT_MODULE_ID, newArrayList("1111"));
final Map<String, Object> details2 = ImmutableMap.of(SnomedIssueDetailFilterFields.COMPONENT_MODULE_ID, "2222");
final ValidationIssue issueWithModuleId = createIssue("111111111", details);
final ValidationIssue issueWithModuleId2 = createIssue("222222222", details2);
final ValidationIssue issueWithoutModuleId = createIssue("333333333", Collections.emptyMap());
save(issueWithModuleId);
save(issueWithModuleId2);
save(issueWithoutModuleId);
final Map<String, Object> detailsToSearch = ImmutableMap.of(SnomedIssueDetailFilterFields.COMPONENT_MODULE_ID, newArrayList("1111", "2222"));
ValidationIssues issues = ValidationRequests.issues().prepareSearch().all().filterByDetails(detailsToSearch).buildAsync().getRequest().execute(context);
assertComponents(issues, issueWithModuleId.getAffectedComponent(), issueWithModuleId2.getAffectedComponent());
}
use of com.b2international.snowowl.core.validation.issue.ValidationIssues in project snow-owl by b2ihealthcare.
the class SnomedValidationIssueDetailTest method filterByAffectedComponentStatus.
@Test
public void filterByAffectedComponentStatus() {
final Map<String, Object> details = ImmutableMap.of(SnomedIssueDetailFilterFields.COMPONENT_STATUS, true);
final Map<String, Object> details2 = ImmutableMap.of(SnomedIssueDetailFilterFields.COMPONENT_STATUS, false);
final ValidationIssue issueWithActiveComponent = createIssue("444444444", details);
final ValidationIssue issueWithInactiveComponent = createIssue("555555555", details2);
save(issueWithActiveComponent);
save(issueWithInactiveComponent);
ValidationIssues issues = ValidationRequests.issues().prepareSearch().all().filterByDetails(details).buildAsync().getRequest().execute(context);
assertComponents(issues, issueWithActiveComponent.getAffectedComponent());
}
use of com.b2international.snowowl.core.validation.issue.ValidationIssues in project snow-owl by b2ihealthcare.
the class SnomedValidationIssueDetailTest method conceptAttributeChange.
@Test
public void conceptAttributeChange() throws Exception {
final String conceptId = RandomSnomedIdentiferGenerator.generateConceptId();
indexRevision(MAIN, concept(conceptId).effectiveTime(EffectiveTimes.UNSET_EFFECTIVE_TIME).build());
createSnomedQueryRule(ImmutableMap.<String, Object>builder().put("componentType", "concept").put("ecl", conceptId).build());
final ValidationIssues firstValidation = validate();
indexRevision(MAIN, concept(conceptId).effectiveTime(Long.MAX_VALUE).build());
ValidationIssues afterConceptEffectiveTimeChangeValidation = validate();
assertThat(firstValidation).hasSize(1);
assertThat(firstValidation.first().get().getDetails().get(SnomedDocument.Fields.EFFECTIVE_TIME)).isEqualTo(EffectiveTimes.UNSET_EFFECTIVE_TIME);
assertThat(afterConceptEffectiveTimeChangeValidation).hasSize(1);
assertThat(afterConceptEffectiveTimeChangeValidation.first().get().getDetails().get(SnomedDocument.Fields.EFFECTIVE_TIME)).isEqualTo(Long.MAX_VALUE);
}
Aggregations