use of org.folio.inventory.support.JsonHelper in project mod-inventory by folio-org.
the class MarcParserTest method validateJsonFieldArrayContainsEmptyJsonObjectItem.
@Test(expected = InvalidMarcJsonException.class)
public void validateJsonFieldArrayContainsEmptyJsonObjectItem() throws IOException, InvalidMarcJsonException {
JsonObject jo = new JsonHelper().getJsonFileAsJsonObject("/marc/empty-jsonobject-field.json");
marcParser.marcJson2FolioJson(jo);
}
use of org.folio.inventory.support.JsonHelper in project mod-inventory by folio-org.
the class MarcParserTest method validateJsonFieldArrayContainsNonJsonObjectItem.
@Test(expected = InvalidMarcJsonException.class)
public void validateJsonFieldArrayContainsNonJsonObjectItem() throws IOException, InvalidMarcJsonException {
JsonObject jo = new JsonHelper().getJsonFileAsJsonObject("/marc/non-jsonobject-field.json");
marcParser.marcJson2FolioJson(jo);
}
use of org.folio.inventory.support.JsonHelper in project mod-inventory by folio-org.
the class MarcParserTest method validateJsonWithoutFieldsKey.
@Test(expected = InvalidMarcJsonException.class)
public void validateJsonWithoutFieldsKey() throws IOException, InvalidMarcJsonException {
JsonObject jo = new JsonHelper().getJsonFileAsJsonObject("/marc/has-no-fields.json");
marcParser.marcJson2FolioJson(jo);
}
use of org.folio.inventory.support.JsonHelper in project mod-inventory by folio-org.
the class MarcParserTest method validateJsonFieldsKeyContainsNoArray.
@Test(expected = InvalidMarcJsonException.class)
public void validateJsonFieldsKeyContainsNoArray() throws IOException, InvalidMarcJsonException {
JsonObject jo = new JsonHelper().getJsonFileAsJsonObject("/marc/fields-no-array.json");
marcParser.marcJson2FolioJson(jo);
}
use of org.folio.inventory.support.JsonHelper in project mod-inventory by folio-org.
the class MarcParserTest method marcJson2FolioJson.
@Test
public void marcJson2FolioJson() throws IOException, InvalidMarcJsonException {
JsonHelper jh = new JsonHelper();
JsonObject expected = jh.getJsonFileAsJsonObject("/marc/test-output_01a.json");
JsonObject actual = marcParser.marcJson2FolioJson(jh.getJsonFileAsJsonObject("/marc/test-input_01a.json"));
assertEquals(expected.toString(), actual.toString());
marcParser.marcJson2FolioJson(jh.getJsonFileAsJsonObject("/marc/test-entry_01.json"));
marcParser.marcJson2FolioJson(jh.getJsonFileAsJsonObject("/marc/test-entry_02.json"));
marcParser.marcJson2FolioJson(jh.getJsonFileAsJsonObject("/marc/test-entry_03.json"));
marcParser.marcJson2FolioJson(jh.getJsonFileAsJsonObject("/marc/test-entry_04.json"));
marcParser.marcJson2FolioJson(jh.getJsonFileAsJsonObject("/marc/test-entry_05.json"));
marcParser.marcJson2FolioJson(jh.getJsonFileAsJsonObject("/marc/test-entry_06.json"));
}
Aggregations