@Test public void testLoginError() throws ControlPointApiException, IOException { final String resJson = "{" + "\"error\": \"Invalid Grant\"," + "\"error_description\":\"Wrong credentials\"}"; Mockito.when(defaultHttpClient.execute(Mockito.any())) .thenReturn(buildResponse(401, "OK", resJson)) .thenReturn(buildStandardResponse()); AssertExt.assertThrows( ControlPointApiException.class, () -> { defaultCPClient.get("status", Collections.singletonList( new BasicNameValuePair("format", "standard") ), TestResponse.class); }); getRequests(1); }
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
    );  }