|
1 | 1 | package org.openpodcastapi.opa.subscriptions; |
2 | 2 |
|
3 | | -import com.fasterxml.jackson.databind.ObjectMapper; |
4 | 3 | import jakarta.persistence.EntityNotFoundException; |
5 | 4 | import lombok.NonNull; |
6 | 5 | import org.junit.jupiter.api.BeforeEach; |
|
24 | 23 | import org.springframework.test.context.ActiveProfiles; |
25 | 24 | import org.springframework.test.context.bean.override.mockito.MockitoBean; |
26 | 25 | import org.springframework.test.web.servlet.MockMvc; |
| 26 | +import tools.jackson.databind.json.JsonMapper; |
27 | 27 |
|
28 | 28 | import java.time.Instant; |
29 | 29 | import java.util.List; |
@@ -53,7 +53,7 @@ class SubscriptionEntityRestControllerTest { |
53 | 53 | private MockMvc mockMvc; |
54 | 54 |
|
55 | 55 | @Autowired |
56 | | - private ObjectMapper objectMapper; |
| 56 | + private JsonMapper jsonMapper; |
57 | 57 |
|
58 | 58 | @Autowired |
59 | 59 | private TokenService tokenService; |
@@ -247,7 +247,7 @@ void createUserSubscriptions_shouldReturnMixedResponse() throws Exception { |
247 | 247 | mockMvc.perform(post("/api/v1/subscriptions") |
248 | 248 | .header("Authorization", "Bearer " + accessToken) |
249 | 249 | .contentType(MediaType.APPLICATION_JSON) |
250 | | - .content(objectMapper.writeValueAsString(List.of(dto1, dto2)))) |
| 250 | + .content(jsonMapper.writeValueAsString(List.of(dto1, dto2)))) |
251 | 251 | .andExpect(status().isMultiStatus()) |
252 | 252 | .andDo(document("subscriptions-bulk-create-mixed", |
253 | 253 | preprocessRequest(prettyPrint()), |
@@ -293,7 +293,7 @@ void createUserSubscription_shouldReturnSuccess() throws Exception { |
293 | 293 | mockMvc.perform(post("/api/v1/subscriptions") |
294 | 294 | .header("Authorization", "Bearer " + accessToken) |
295 | 295 | .contentType(MediaType.APPLICATION_JSON) |
296 | | - .content(objectMapper.writeValueAsString(List.of(dto)))) |
| 296 | + .content(jsonMapper.writeValueAsString(List.of(dto)))) |
297 | 297 | .andExpect(status().is2xxSuccessful()) |
298 | 298 | .andDo(document("subscriptions-bulk-create-success", |
299 | 299 | preprocessRequest(prettyPrint()), |
@@ -333,7 +333,7 @@ void createUserSubscription_shouldReturnFailure() throws Exception { |
333 | 333 | mockMvc.perform(post("/api/v1/subscriptions") |
334 | 334 | .header("Authorization", "Bearer " + accessToken) |
335 | 335 | .contentType(MediaType.APPLICATION_JSON) |
336 | | - .content(objectMapper.writeValueAsString(List.of(dto)))) |
| 336 | + .content(jsonMapper.writeValueAsString(List.of(dto)))) |
337 | 337 | .andExpect(status().isBadRequest()) |
338 | 338 | .andDo(document("subscriptions-bulk-create-failure", |
339 | 339 | preprocessRequest(prettyPrint()), |
|
0 commit comments