MCPcopy Index your code
hub / github.com/OpenFeign/feign / testClientExecute

Method testClientExecute

core/src/test/java/feign/ClientTest.java:32–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30class ClientTest {
31
32 @Test
33 void testClientExecute() throws IOException {
34 Client client = mock(Client.class);
35 RequestTemplate requestTemplate = mock(RequestTemplate.class);
36 Request request =
37 Request.create(
38 Request.HttpMethod.GET,
39 "http://example.com",
40 Collections.emptyMap(),
41 null,
42 requestTemplate);
43 when(client.execute(ArgumentMatchers.any(Request.class), ArgumentMatchers.any()))
44 .thenReturn(
45 Response.builder()
46 .status(200)
47 .request(request)
48 .body("Hello, World!", Charset.defaultCharset())
49 .build());
50 Response response = client.execute(request, null);
51 String result = Util.toString(response.body().asReader(Charset.defaultCharset()));
52 assertEquals("Hello, World!", result);
53 }
54
55 @Test
56 void testConvertAndSendWithAcceptEncoding() throws IOException {

Callers

nothing calls this directly

Calls 10

createMethod · 0.95
executeMethod · 0.95
builderMethod · 0.95
toStringMethod · 0.95
bodyMethod · 0.95
bodyMethod · 0.65
asReaderMethod · 0.65
buildMethod · 0.45
requestMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected