|
1 | 1 | package com.dpconde.sofiatracker.presentation.controllers |
2 | 2 |
|
3 | 3 | import com.fasterxml.jackson.databind.ObjectMapper |
4 | | -import com.dpconde.sofiatracker.TestConfiguration |
5 | 4 | import com.dpconde.sofiatracker.presentation.dto.CreateEventRequestDto |
6 | 5 | import com.dpconde.sofiatracker.presentation.dto.UpdateEventRequestDto |
7 | 6 | import org.junit.jupiter.api.Test |
8 | 7 | import org.springframework.beans.factory.annotation.Autowired |
9 | | -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureWebMvc |
10 | 8 | import org.springframework.boot.test.context.SpringBootTest |
11 | | -import org.springframework.context.annotation.Import |
12 | 9 | import org.springframework.http.MediaType |
13 | | -import org.springframework.test.context.ActiveProfiles |
14 | 10 | import org.springframework.test.web.servlet.MockMvc |
| 11 | +import org.springframework.test.web.servlet.setup.MockMvcBuilders |
| 12 | +import org.springframework.web.context.WebApplicationContext |
| 13 | +import org.junit.jupiter.api.BeforeEach |
| 14 | +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc |
| 15 | +import org.springframework.test.context.ActiveProfiles |
15 | 16 | import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.* |
16 | 17 | import org.springframework.test.web.servlet.result.MockMvcResultMatchers.* |
17 | 18 | import org.springframework.transaction.annotation.Transactional |
18 | 19 |
|
19 | | -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) |
20 | | -@AutoConfigureWebMvc |
| 20 | +@SpringBootTest |
21 | 21 | @ActiveProfiles("test") |
| 22 | +@AutoConfigureMockMvc |
22 | 23 | @Transactional |
23 | | -@Import(TestConfiguration::class) |
24 | 24 | class EventControllerIntegrationTest { |
25 | 25 |
|
26 | 26 | @Autowired |
27 | | - private lateinit var mockMvc: MockMvc |
| 27 | + private lateinit var objectMapper: ObjectMapper |
28 | 28 |
|
29 | 29 | @Autowired |
30 | | - private lateinit var objectMapper: ObjectMapper |
| 30 | + private lateinit var mockMvc: MockMvc |
31 | 31 |
|
32 | 32 | @Test |
33 | 33 | fun `should create and retrieve EAT event`() { |
|
0 commit comments