@Test(expected = IllegalArgumentException.class) public void invalidLogicalType() throws Exception { Schema schema = SchemaBuilder.builder().stringType(); schema.addProp(LogicalType.LOGICAL_TYPE_PROP, "date"); underTest.onVisit(schema, breadcrumb); }
@Override public void onVisit(Schema schema, Collection<String> breadcrumb) { try { LogicalTypes.fromSchema(schema); } catch (Exception e) { String path = breadcrumb.stream().collect(joining("/", "/", "")); throw new IllegalArgumentException("Invalid logical type declared at " + path, e); } }
LogicalTypeValidatingVisitor implements Visitor<Void> { @Override public void onVisit(Schema schema, Collection<String> breadcrumb) { try { LogicalTypes.fromSchema(schema); } catch (Exception e) { String path = breadcrumb.stream().collect(joining("/", "/", "")); throw new IllegalArgumentException("Invalid logical type declared at " + path, e); } } }
LogicalTypeValidatingVisitor implements Visitor<Void> { @Override public void onVisit(Schema schema, Collection<String> breadcrumb) { try { LogicalTypes.fromSchema(schema); } catch (Exception e) { String path = breadcrumb.stream().collect(joining("/", "/", "")); throw new IllegalArgumentException("Invalid logical type declared at " + path, e); } }  }
LogicalTypeValidatingVisitor implements Visitor<Void> { @Override public void onVisit(Schema schema, Collection<String> breadcrumb) { try { LogicalTypes.fromSchema(schema); } catch (Exception e) { String path = breadcrumb.stream().collect(joining("/", "/", "")); throw new IllegalArgumentException("Invalid logical type declared at " + path, e); } }  @Override void onVisit(Schema schema, Collection<String> breadcrumb); @Override void onVisit(Field field, Collection<String> breadcrumb); @Override Void getResult(); }
LogicalTypeValidatingVisitor implements Visitor<Void> { @Override public void onVisit(Schema schema, Collection<String> breadcrumb) { try { LogicalTypes.fromSchema(schema); } catch (Exception e) { String path = breadcrumb.stream().collect(joining("/", "/", "")); throw new IllegalArgumentException("Invalid logical type declared at " + path, e); } }  @Override void onVisit(Schema schema, Collection<String> breadcrumb); @Override void onVisit(Field field, Collection<String> breadcrumb); @Override Void getResult();  }