use of com.b2international.snowowl.core.request.io.ImportResponse in project snow-owl by b2ihealthcare.
the class SnomedImportRowValidatorTest method importRelationshipWithSameSourceDestination.
@Test
public void importRelationshipWithSameSourceDestination() throws FileNotFoundException {
final String archiveFilePath = "SnomedCT_Release_INT_20150202_new_relationship_with_same_source_destination.zip";
final ImportResponse response = importArchive(archiveFilePath, Rf2ReleaseType.DELTA);
final Collection<String> issues = getDefectMessages(response);
final String issue = Iterables.getOnlyElement(issues);
assertThat(issues).hasSize(1);
assertThat(issue).containsSequence(Rf2ValidationDefects.RELATIONSHIP_SOURCE_DESTINATION_EQUALS.getLabel());
assertFalse(response.isSuccess());
}
use of com.b2international.snowowl.core.request.io.ImportResponse in project snow-owl by b2ihealthcare.
the class SnomedImportRowValidatorTest method importAssociationRefSetMemberWithInvalidTargetComponent.
@Test
public void importAssociationRefSetMemberWithInvalidTargetComponent() throws FileNotFoundException {
final String archiveFilePath = "SnomedCT_RF2Release_INT_20180223_association_member_with_invalid_target_component.zip";
final ImportResponse response = importArchive(archiveFilePath, Rf2ReleaseType.DELTA);
final Collection<String> issues = getDefectMessages(response);
final String issue = Iterables.getOnlyElement(issues);
assertThat(issues).hasSize(1);
assertThat(issue).containsSequence(Rf2ValidationDefects.INVALID_ID.getLabel());
assertFalse(response.isSuccess());
}
use of com.b2international.snowowl.core.request.io.ImportResponse in project snow-owl by b2ihealthcare.
the class SnomedRf2ImportRestService method toRf2ImportConfiguration.
private SnomedRf2ImportConfiguration toRf2ImportConfiguration(RemoteJobEntry job) {
ApiError error = null;
ImportResponse response = null;
ObjectMapper mapper = ApplicationContext.getServiceForClass(ObjectMapper.class);
if (RemoteJobState.FAILED == job.getState()) {
error = job.getResultAs(mapper, ApiError.class);
} else if (job.isSuccessful()) {
response = job.getResultAs(mapper, ImportResponse.class);
}
return new SnomedRf2ImportConfiguration(IDs.sha1(job.getId()), job.getState(), error, response);
}
use of com.b2international.snowowl.core.request.io.ImportResponse in project snow-owl by b2ihealthcare.
the class SnomedImportRowValidatorTest method importDescriptionWithDescriptionAsConceptId.
@Test
public void importDescriptionWithDescriptionAsConceptId() throws FileNotFoundException {
final String archiveFilePath = "SnomedCT_Release_INT_20150201_new_description_with_description_as_concept_id.zip";
final ImportResponse response = importArchive(archiveFilePath, Rf2ReleaseType.DELTA);
final Collection<String> issues = getDefectMessages(response);
assertThat(issues).hasSize(1);
assertEquals(Rf2ValidationDefects.UNEXPECTED_COMPONENT_CATEGORY.getLabel(), Iterables.getOnlyElement(issues));
assertFalse(response.isSuccess());
}
use of com.b2international.snowowl.core.request.io.ImportResponse in project snow-owl by b2ihealthcare.
the class SnomedImportRowValidatorTest method importAttributeValueRefSetMemberWithInvalidValueId.
@Test
public void importAttributeValueRefSetMemberWithInvalidValueId() throws FileNotFoundException {
final String archiveFilePath = "SnomedCT_RF2Release_INT_20180223_attribute_member_with_invalid_valueId.zip";
final ImportResponse response = importArchive(archiveFilePath, Rf2ReleaseType.DELTA);
final Collection<String> issues = getDefectMessages(response);
final String issue = Iterables.getOnlyElement(issues);
assertThat(issues).hasSize(1);
assertThat(issue).containsSequence(Rf2ValidationDefects.INVALID_ID.getLabel());
assertFalse(response.isSuccess());
}
Aggregations