use of io.atlasmap.json.v2.JsonFields in project atlasmap by atlasmap.
the class JsonFieldReaderTest method testRangeOutValue.
private void testRangeOutValue(String fileName, String fieldPath, FieldType fieldType, String errorMessage, String errorValue) throws Exception {
String filePath = "src" + File.separator + "test" + File.separator + "resources" + File.separator + "jsonFields" + File.separator + fileName;
String document = new String(Files.readAllBytes(Paths.get(filePath)));
reader.setDocument(document);
JsonField field = AtlasJsonModelFactory.createJsonField();
field.setPath(fieldPath);
field.setFieldType(fieldType);
AtlasInternalSession session = read(field);
assertEquals(null, field.getValue());
assertEquals(1, session.getAudits().getAudit().size());
assertEquals(errorMessage, session.getAudits().getAudit().get(0).getMessage());
assertEquals(errorValue, session.getAudits().getAudit().get(0).getValue());
assertEquals(AuditStatus.ERROR, session.getAudits().getAudit().get(0).getStatus());
}
Aggregations