@Test public void shouldParse_withTypeTextHtml_expectFalse() throws ParseException { JsonSupport jsonTransformer = createJsonParser(); final ImmutableList<String> typeList = ImmutableList.of("test/html"); final boolean should = jsonTransformer.shouldParse("http://url", "<html><body></body></html>", typeList); assertEquals(false, should); }
@Test public void shouldParse_withJSONContentAndUrl_expectTrue() throws ParseException { JsonSupport jsonTransformer = createJsonParser(); final ImmutableList<String> typeList = ImmutableList.of("application/json"); final boolean should = jsonTransformer.shouldParse( "http://url", "{\"id\":\"10154342691895026\",\"name\":\"Magne Nielsen\"}", typeList); assertEquals(true, should); }