InformationParser extends SingleParser<T> { @Override protected void parse(T type) { var information = environment.resolver.any(type, Information.class); check(information, type); parse(information); } InformationParser(Environment<T> environment);   }
@Test void parse_class() { parser.parse(InformationParserTest.class); var mapping = environment.mappings; assertArrayEquals(new String[] {"Pante"}, (String[]) mapping.get("authors")); assertEquals("description", mapping.get("description")); assertEquals("http: assertEquals("prefix", mapping.get("prefix")); }
@Test void parse_information() { parser.parse(InformationParserTest.class.getAnnotation(Information.class)); var mappings = environment.mappings; assertArrayEquals(new String[] {"Pante"}, (String[]) mappings.get("authors")); assertEquals("description", mappings.get("description")); assertEquals("http: assertEquals("prefix", mappings.get("prefix")); }
@Test void parse_information_project() { parser.environment = StubEnvironment.of((new Project("", "", "", List.of("Pante"), "project description", "http: parser.parse(Empty.class.getAnnotation(Information.class)); var mappings = parser.environment.mappings; assertEquals(List.of("Pante"), (List<String>) mappings.get("authors")); assertEquals("project description", mappings.get("description")); assertEquals("http: }
@Test void parse_information_empty() { parser.parse(Empty.class.getAnnotation(Information.class)); verify(environment, times(0)).error(any(), any()); verify(environment, times(0)).warn(any(), any()); assertTrue(environment.mappings.isEmpty()); }