@Test public void testGet_noCredentials() throws ControlPointApiException, IOException { Mockito.when(defaultHttpClient.execute(Mockito.any())).thenReturn(buildStandardResponse()); final ControlPointServerDetails serverDetails = ControlPointServerDetails.builder() .protocol("http").host("cp-host").port(123).basePath("base/path") .build(); final ControlPointApiClient cpClient = new ControlPointApiClient(defaultHttpClient, serverDetails); cpClient.setClock(clock); final int result = cpClient.get("status", Arrays.asList( new BasicNameValuePair("version", "3"), new BasicNameValuePair("format", "standard") ), Integer.class); final List<HttpUriRequest> requests = getRequests(1); Assert.assertEquals("only request should be GET", "GET", requests.get(0).getMethod()); Assert.assertEquals("should parse result", 456, result); }
public <R> R get( final String path, final List<NameValuePair> queryParams, final Class<R> resultType ) throws ControlPointApiException { return performAuthenticatedRequest(buildGetRequest(path, queryParams), resultType); }
ControlPointApiClient { public <R> R get( final String path, final List<NameValuePair> queryParams, final Class<R> resultType ) throws ControlPointApiException { return performAuthenticatedRequest(buildGetRequest(path, queryParams), resultType); } }
ControlPointApiClient { public <R> R get( final String path, final List<NameValuePair> queryParams, final Class<R> resultType ) throws ControlPointApiException { return performAuthenticatedRequest(buildGetRequest(path, queryParams), resultType); }  }
ControlPointApiClient { public <R> R get( final String path, final List<NameValuePair> queryParams, final Class<R> resultType ) throws ControlPointApiException { return performAuthenticatedRequest(buildGetRequest(path, queryParams), resultType); }  R get(
        final String path,
        final List<NameValuePair> queryParams,
        final Class<R> resultType
    ); R postUrlencoded(
        final String path,
        final List<NameValuePair> queryParams,
        final List<NameValuePair> bodyParams,
        final Class<R> resultType
    ); }
ControlPointApiClient { public <R> R get( final String path, final List<NameValuePair> queryParams, final Class<R> resultType ) throws ControlPointApiException { return performAuthenticatedRequest(buildGetRequest(path, queryParams), resultType); }  R get(
        final String path,
        final List<NameValuePair> queryParams,
        final Class<R> resultType
    ); R postUrlencoded(
        final String path,
        final List<NameValuePair> queryParams,
        final List<NameValuePair> bodyParams,
        final Class<R> resultType
    );  }