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

Method create

mock/src/test/java/feign/mock/RequestKeyTest.java:53–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51 }
52
53 @SuppressWarnings("deprecation")
54 @Test
55 void create() throws Exception {
56 Map<String, Collection<String>> map = new HashMap<>();
57 map.put("my-header", Arrays.asList("val"));
58 Request request =
59 Request.create(
60 Request.HttpMethod.GET,
61 "a",
62 map,
63 "content".getBytes(StandardCharsets.UTF_8),
64 StandardCharsets.UTF_16);
65 requestKey = RequestKey.create(request);
66
67 assertThat(requestKey.getMethod()).isEqualTo(HttpMethod.GET);
68 assertThat(requestKey.getUrl()).isEqualTo("a");
69 assertThat(requestKey.getHeaders().size()).isEqualTo(1);
70 assertThat(requestKey.getHeaders().fetch("my-header")).isEqualTo(Arrays.asList("val"));
71 assertThat(requestKey.getCharset()).isEqualTo(StandardCharsets.UTF_16);
72 assertThat(requestKey.getBody()).isEqualTo("content".getBytes(StandardCharsets.UTF_8));
73 }
74
75 @Test
76 void checkHashes() {

Callers

nothing calls this directly

Calls 12

createMethod · 0.95
createMethod · 0.95
getMethodMethod · 0.80
getUrlMethod · 0.80
putMethod · 0.65
fetchMethod · 0.65
asListMethod · 0.45
assertThatMethod · 0.45
sizeMethod · 0.45
getHeadersMethod · 0.45
getCharsetMethod · 0.45
getBodyMethod · 0.45

Tested by

no test coverage detected