@Test public void testConjureUnionTypeDeprecation() { ConjureSourceFile conjure = ConjureParser.parse(new File("src/test/resources/example-deprecation.yml")); UnionTypeDefinition union = conjure.types() .definitions() .objects() .get(TypeName.of("UnionWithDeprecatedTypes")) .visit(new TypeDefinitionVisitor<UnionTypeDefinition>() { @Override public UnionTypeDefinition visit(AliasTypeDefinition _def) { throw new SafeIllegalArgumentException("Expected EnumTypeDefinition"); } @Override public UnionTypeDefinition visit(EnumTypeDefinition _def) { throw new SafeIllegalArgumentException("Expected EnumTypeDefinition"); } @Override public UnionTypeDefinition visit(ObjectTypeDefinition _def) { throw new SafeIllegalArgumentException("Expected EnumTypeDefinition"); } @Override public UnionTypeDefinition visit(UnionTypeDefinition def) { return def; } }); assertThat(union.union().get(FieldName.of("first")).deprecated()).isNotPresent(); assertThat(union.union().get(FieldName.of("second")).deprecated()).hasValue("Use 'first'."); }
public static ConjureSourceFile parse(File file) { RecursiveParser parser = new RecursiveParser(); return parser.parse(file); }
ConjureParser { public static ConjureSourceFile parse(File file) { RecursiveParser parser = new RecursiveParser(); return parser.parse(file); } }
ConjureParser { public static ConjureSourceFile parse(File file) { RecursiveParser parser = new RecursiveParser(); return parser.parse(file); } private  ConjureParser(); }
ConjureParser { public static ConjureSourceFile parse(File file) { RecursiveParser parser = new RecursiveParser(); return parser.parse(file); } private  ConjureParser(); static ConjureSourceFile parse(File file); static AnnotatedConjureSourceFile parseAnnotated(File file); static List<AnnotatedConjureSourceFile> parseAnnotated(Collection<File> files); }
ConjureParser { public static ConjureSourceFile parse(File file) { RecursiveParser parser = new RecursiveParser(); return parser.parse(file); } private  ConjureParser(); static ConjureSourceFile parse(File file); static AnnotatedConjureSourceFile parseAnnotated(File file); static List<AnnotatedConjureSourceFile> parseAnnotated(Collection<File> files);  }