@Test public void testConjureEnumValueDeprecation() { ConjureSourceFile conjure = ConjureParser.parse(new File("src/test/resources/example-deprecation.yml")); EnumTypeDefinition enumType = conjure.types() .definitions() .objects() .get(TypeName.of("EnumWithDeprecatedValues")) .visit(new TypeDefinitionVisitor<EnumTypeDefinition>() { @Override public EnumTypeDefinition visit(AliasTypeDefinition _def) { throw new SafeIllegalArgumentException("Expected EnumTypeDefinition"); } @Override public EnumTypeDefinition visit(EnumTypeDefinition def) { return def; } @Override public EnumTypeDefinition visit(ObjectTypeDefinition _def) { throw new SafeIllegalArgumentException("Expected EnumTypeDefinition"); } @Override public EnumTypeDefinition visit(UnionTypeDefinition _def) { throw new SafeIllegalArgumentException("Expected EnumTypeDefinition"); } }); EnumValueDefinition one = enumType.values().get(0); EnumValueDefinition two = enumType.values().get(1); assertThat(one.value()).isEqualTo("ONE"); assertThat(one.deprecated()).isNotPresent(); assertThat(two.value()).isEqualTo("TWO"); assertThat(two.deprecated()).hasValue("Prefer ONE."); }
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);  }