@Test public void testgetJSONFromURL() { PowerMock.mockStatic(NetworkUtils.class); try { final URL url = PowerMock.createMock(URL.class); NetworkUtils.getDataFromURL(url, null, ImageIngester.DEFAULT_CONNECT_TIMEOUT); PowerMock.expectLastCall().andReturn(ROOT_JSON.getBytes()); replayAll(); final ObjectMapper mapper = new ObjectMapper(); final JsonNode json = mapper.readTree(ROOT_JSON); final JsonNode result = JSONParser.getJSONFromURL(url, ImageIngester.DEFAULT_CONNECT_TIMEOUT); assertEquals(json, result); } catch (final IOException e) { fail(); } }
public static JsonNode getJSONFromURL(final URL url, final int connectTimeout) throws IOException { return getJSONFromURL(url, null, connectTimeout); }
JSONParser { public static JsonNode getJSONFromURL(final URL url, final int connectTimeout) throws IOException { return getJSONFromURL(url, null, connectTimeout); } }
JSONParser { public static JsonNode getJSONFromURL(final URL url, final int connectTimeout) throws IOException { return getJSONFromURL(url, null, connectTimeout); } private  JSONParser(); }
JSONParser { public static JsonNode getJSONFromURL(final URL url, final int connectTimeout) throws IOException { return getJSONFromURL(url, null, connectTimeout); } private  JSONParser(); static JsonNode getJSONFromURL(final URL url, final int connectTimeout); static JsonNode getJSONFromURL(final URL url, final String expectedETag, final int connectTimeout); }
JSONParser { public static JsonNode getJSONFromURL(final URL url, final int connectTimeout) throws IOException { return getJSONFromURL(url, null, connectTimeout); } private  JSONParser(); static JsonNode getJSONFromURL(final URL url, final int connectTimeout); static JsonNode getJSONFromURL(final URL url, final String expectedETag, final int connectTimeout); static final ObjectMapper MAPPER; }