public ClientRequestConfigurer accept(final MediaType mediaType) { clientRequest.accept(mediaType); return this; }
public ClientRequestConfigurer accept(final MediaType mediaType) { clientRequest.accept(mediaType); return this; }
public ClientResponse<String> delete(String url, MediaType mediaType) throws Exception { ClientRequest request = new ClientRequest(url); request.accept(mediaType); ClientResponse response = request.delete(); return response; }
public ClientResponse<String> get(String url, MediaType mediaType) throws Exception { ClientRequest request = new ClientRequest(url); request.accept(mediaType); ClientResponse<String> response = request.get(String.class); return response; }
private OpenIdConnectDiscoveryResponse _exec2() { clientRequest.accept(MEDIA_TYPE); clientRequest.setHttpMethod(getHttpMethod());
clientRequest.accept(mediaType); clientRequest.setHttpMethod(getHttpMethod());
clientRequest.header("Authorization", "Basic " + encodedCredentials); clientRequest.accept(mediaType); clientRequest.setHttpMethod(getHttpMethod());
clientRequest.accept(mediaTypes); clientRequest.setHttpMethod(getHttpMethod());
@Ignore("TODO") @Test public void follow_get() throws Exception { final LinkRepresentation link = jsonRepresentation.getLink("aLink"); final String href = link.getHref(); // when context.checking(new Expectations() { { one(mockExecutor).createRequest(with(any(UriBuilderImpl.class))); will(returnValue(mockClientRequest)); one(mockExecutor).execute(mockClientRequest); will(returnValue(mockClientResponse)); one(mockClientRequest).accept(MediaType.APPLICATION_JSON_TYPE); atLeast(1).of(mockClientRequest).setHttpMethod("GET"); allowing(mockClientRequest).getHttpMethod(); will(returnValue("GET")); one(mockClientRequest).execute(); will(returnValue(mockClientResponse)); one(mockClientResponse).setReturnType(String.class); allowing(mockClientResponse); final MultiValueMap result = new MultiValueMap(); result.put("Content-Type", "application/json"); allowing(mockClientResponse).getMetadata(); will(returnValue(result)); } }); final RestfulResponse<JsonRepresentation> response = client.follow(link); // then }