GaugesService { public List<Gauge> getGauges() throws IOException { try { HttpRequest request = execute(HttpRequest.get(URL_EMBEDDED)); GaugesWrapper response = fromJson(request, GaugesWrapper.class); if (response != null && response.gauges != null) return response.gauges; 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; }
@Test public void getGaugesEmptyResponse() throws IOException { doReturn(createReader("")).when(request).bufferedReader(); List<Gauge> gauges = service.getGauges(); assertNotNull(gauges); assertTrue(gauges.isEmpty()); }