use of org.folio.rest.jaxrs.model.EntityType in project mod-source-record-manager by folio-org.
the class DataImportPayloadContextBuilderImpl method getEntityType.
private EntityType getEntityType(Record marcRecord) {
requireNonNull(marcRecord.getParsedRecord(), "Parsed record is null");
requireNonNull(marcRecord.getParsedRecord().getContent(), "Parsed record content is null");
MarcRecordType type = analyzer.process(new JsonObject(marcRecord.getParsedRecord().getContent().toString()));
EntityType entityType = MARC_TO_ENTITY_TYPE.get(type);
if (entityType == null) {
throw new IllegalStateException("Unsupported Marc record type");
}
return entityType;
}
use of org.folio.rest.jaxrs.model.EntityType in project mod-source-record-manager by folio-org.
the class RecordConversionUtilTest method shouldReturnMarcHolding.
@Test
public void shouldReturnMarcHolding() {
EntityType entityType = RecordConversionUtil.getEntityType(new Record().withRecordType(Record.RecordType.MARC_HOLDING));
assertEquals(EntityType.MARC_HOLDINGS, entityType);
}
use of org.folio.rest.jaxrs.model.EntityType in project mod-source-record-manager by folio-org.
the class RecordConversionUtilTest method shouldReturnEdifactInvoice.
@Test
public void shouldReturnEdifactInvoice() {
EntityType entityType = RecordConversionUtil.getEntityType(new Record().withRecordType(Record.RecordType.EDIFACT));
assertEquals(EntityType.EDIFACT_INVOICE, entityType);
}
use of org.folio.rest.jaxrs.model.EntityType in project mod-source-record-manager by folio-org.
the class RecordConversionUtilTest method shouldReturnMarcAuthority.
@Test
public void shouldReturnMarcAuthority() {
EntityType entityType = RecordConversionUtil.getEntityType(new Record().withRecordType(Record.RecordType.MARC_AUTHORITY));
assertEquals(EntityType.MARC_AUTHORITY, entityType);
}
use of org.folio.rest.jaxrs.model.EntityType in project mod-source-record-manager by folio-org.
the class RecordConversionUtilTest method shouldReturnMarcBib.
@Test
public void shouldReturnMarcBib() {
EntityType entityType = RecordConversionUtil.getEntityType(new Record().withRecordType(Record.RecordType.MARC_BIB));
assertEquals(EntityType.MARC_BIBLIOGRAPHIC, entityType);
}
Aggregations