|
1 | 1 | package it.aboutbits.springboot.testing.web.request; |
2 | 2 |
|
3 | | -import com.fasterxml.jackson.databind.ObjectMapper; |
4 | 3 | import lombok.NonNull; |
5 | 4 | import lombok.RequiredArgsConstructor; |
6 | 5 | import org.springframework.test.web.servlet.MockMvc; |
7 | 6 | import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder; |
| 7 | +import tools.jackson.databind.json.JsonMapper; |
8 | 8 |
|
9 | 9 | @RequiredArgsConstructor |
10 | 10 | public class HttpTestClient { |
11 | 11 | private final MockMvc mockMvc; |
12 | | - private final ObjectMapper objectMapper; |
| 12 | + private final JsonMapper jsonMapper; |
13 | 13 |
|
14 | 14 | public Request<MockHttpServletRequestBuilder> get(@NonNull String url, Object... pathVariables) { |
15 | | - return new Get(mockMvc, objectMapper, url, pathVariables); |
| 15 | + return new Get(mockMvc, jsonMapper, url, pathVariables); |
16 | 16 | } |
17 | 17 |
|
18 | 18 | public Request<MockHttpServletRequestBuilder> put(@NonNull String url, Object... pathVariables) { |
19 | | - return new Put(mockMvc, objectMapper, url, pathVariables); |
| 19 | + return new Put(mockMvc, jsonMapper, url, pathVariables); |
20 | 20 | } |
21 | 21 |
|
22 | 22 | public MultipartRequest putMultipart(@NonNull String url, Object... pathVariables) { |
23 | | - return new PutMultipart(mockMvc, objectMapper, url, pathVariables); |
| 23 | + return new PutMultipart(mockMvc, jsonMapper, url, pathVariables); |
24 | 24 | } |
25 | 25 |
|
26 | 26 | public Request<MockHttpServletRequestBuilder> post(@NonNull String url, Object... pathVariables) { |
27 | | - return new Post(mockMvc, objectMapper, url, pathVariables); |
| 27 | + return new Post(mockMvc, jsonMapper, url, pathVariables); |
28 | 28 | } |
29 | 29 |
|
30 | 30 | public MultipartRequest postMultipart(@NonNull String url, Object... pathVariables) { |
31 | | - return new PostMultipart(mockMvc, objectMapper, url, pathVariables); |
| 31 | + return new PostMultipart(mockMvc, jsonMapper, url, pathVariables); |
32 | 32 | } |
33 | 33 |
|
34 | 34 | public Request<MockHttpServletRequestBuilder> patch(@NonNull String url, Object... pathVariables) { |
35 | | - return new Patch(mockMvc, objectMapper, url, pathVariables); |
| 35 | + return new Patch(mockMvc, jsonMapper, url, pathVariables); |
36 | 36 | } |
37 | 37 |
|
38 | 38 | public MultipartRequest patchMultipart(@NonNull String url, Object... pathVariables) { |
39 | | - return new PatchMultipart(mockMvc, objectMapper, url, pathVariables); |
| 39 | + return new PatchMultipart(mockMvc, jsonMapper, url, pathVariables); |
40 | 40 | } |
41 | 41 |
|
42 | 42 | public Request<MockHttpServletRequestBuilder> delete(@NonNull String url, Object... pathVariables) { |
43 | | - return new Delete(mockMvc, objectMapper, url, pathVariables); |
| 43 | + return new Delete(mockMvc, jsonMapper, url, pathVariables); |
44 | 44 | } |
45 | 45 | } |
0 commit comments