use of io.atlasmap.kafkaconnect.v2.KafkaConnectDocument in project atlasmap by atlasmap.
the class KafkaConnectInspectionServiceTest method testJsonComplex.
@Test
public void testJsonComplex() throws Exception {
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("json-complex.json");
KafkaConnectDocument doc = service.inspectJson(new String(is.readAllBytes()), options);
assertNotNull(doc);
assertEquals("struct", doc.getName());
assertEquals("/", doc.getPath());
assertEquals(FieldType.COMPLEX, doc.getFieldType());
List<Field> fields = doc.getFields().getField();
assertEquals(2, fields.size());
Field field1 = fields.get(0);
assertEquals("field1", field1.getName());
assertEquals("/field1", field1.getPath());
assertEquals(FieldType.BOOLEAN, field1.getFieldType());
Field field2 = fields.get(1);
assertEquals("field2", field2.getName());
assertEquals("/field2", field2.getPath());
assertEquals(FieldType.STRING, field2.getFieldType());
}
use of io.atlasmap.kafkaconnect.v2.KafkaConnectDocument in project atlasmap by atlasmap.
the class KafkaConnectInspectionServiceTest method testJsonPrimitive.
@Test
public void testJsonPrimitive() throws Exception {
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("json-primitive.json");
KafkaConnectDocument doc = service.inspectJson(new String(is.readAllBytes()), options);
assertNotNull(doc);
assertEquals("primitive", doc.getName());
assertEquals("/", doc.getPath());
assertEquals(FieldType.STRING, doc.getFieldType());
}
use of io.atlasmap.kafkaconnect.v2.KafkaConnectDocument in project atlasmap by atlasmap.
the class KafkaConnectInspectionServiceTest method testAvroPrimitive.
@Test
public void testAvroPrimitive() throws Exception {
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("avro-primitive.json");
KafkaConnectDocument doc = service.inspectAvro(new String(is.readAllBytes()), options);
assertNotNull(doc);
assertNull(doc.getName());
assertEquals("/", doc.getPath());
assertEquals(FieldType.STRING, doc.getFieldType());
}
Aggregations