@Test public void getContentEmptyResponse() throws IOException { doReturn(createReader("")).when(request).bufferedReader(); List<PageContent> content = service.getContent("id"); assertNotNull(content); assertTrue(content.isEmpty()); }
public List<PageContent> getContent(String gaugeId) throws IOException { try { HttpRequest request = execute(HttpRequest.get(URL_GAUGES + gaugeId + "/content")); ContentWrapper response = fromJson(request, ContentWrapper.class); if (response != null && response.content != null) return response.content; return Collections.emptyList(); } catch (HttpRequestException e) { throw e.getCause(); } }
GaugesService { public List<PageContent> getContent(String gaugeId) throws IOException { try { HttpRequest request = execute(HttpRequest.get(URL_GAUGES + gaugeId + "/content")); ContentWrapper response = fromJson(request, ContentWrapper.class); if (response != null && response.content != null) return response.content; return Collections.emptyList(); } catch (HttpRequestException e) { throw e.getCause(); } } }
GaugesService { public List<PageContent> getContent(String gaugeId) throws IOException { try { HttpRequest request = execute(HttpRequest.get(URL_GAUGES + gaugeId + "/content")); ContentWrapper response = fromJson(request, ContentWrapper.class); if (response != null && response.content != null) return response.content; return Collections.emptyList(); } catch (HttpRequestException e) { throw e.getCause(); } } GaugesService(final String username, final String password);  GaugesService(final String apiKey); }
GaugesService { public List<PageContent> getContent(String gaugeId) throws IOException { try { HttpRequest request = execute(HttpRequest.get(URL_GAUGES + gaugeId + "/content")); ContentWrapper response = fromJson(request, ContentWrapper.class); if (response != null && response.content != null) return response.content; return Collections.emptyList(); } catch (HttpRequestException e) { throw e.getCause(); } } GaugesService(final String username, final String password);  GaugesService(final String apiKey); List<Gauge> getGauges(); List<PageContent> getContent(String gaugeId); List<Referrer> getReferrers(String gaugeId); Client createClient(String description); Client getClient(String description); Gauge getGauge(String gaugeId); String getPusherAuth(final String socketId, final String channelName); }
GaugesService { public List<PageContent> getContent(String gaugeId) throws IOException { try { HttpRequest request = execute(HttpRequest.get(URL_GAUGES + gaugeId + "/content")); ContentWrapper response = fromJson(request, ContentWrapper.class); if (response != null && response.content != null) return response.content; return Collections.emptyList(); } catch (HttpRequestException e) { throw e.getCause(); } } GaugesService(final String username, final String password);  GaugesService(final String apiKey); List<Gauge> getGauges(); List<PageContent> getContent(String gaugeId); List<Referrer> getReferrers(String gaugeId); Client createClient(String description); Client getClient(String description); Gauge getGauge(String gaugeId); String getPusherAuth(final String socketId, final String channelName); static final Gson GSON; }