APISonar


io.bootique.config.jackson.MultiFormatJsonNodeParser.ParserType.JSON

> io > bootique > config > jackson > MultiFormatJsonNodeParser > ParserType > JSON
io APIs bootique APIs config APIs jackson APIs MultiFormatJsonNodeParser APIs ParserType APIs JSON APIs

Example 1
public void testParser_MissingYaml() {
		Map<ParserType, Function<InputStream, Optional<JsonNode>>> parsers = createParsersMap(ParserType.JSON);
		new MultiFormatJsonNodeParser(parsers, mock(BootLogger.class)).parser(ParserType.YAML);
	}
Example 2
public void testParserTypeFromExtension() throws MalformedURLException {

		MultiFormatJsonNodeParser parser = new MultiFormatJsonNodeParser(Collections.emptyMap(),
				mock(BootLogger.class));

		assertEquals(ParserType.YAML, parser.parserTypeFromExtension(new URL("http://example.org/test.yml")));
		assertEquals(ParserType.YAML, parser.parserTypeFromExtension(new URL("http://example.org/test.yaml")));
		assertEquals(ParserType.JSON, parser.parserTypeFromExtension(new URL("http://example.org/test.json")));
	}