Skip to content

Commit 8dc584f

Browse files
dpcondeclaude
andcommitted
Update EventControllerIntegrationTest to remove TestConfiguration dependency
- Remove import and usage of TestConfiguration class - Switch to @AutoConfigureMockMvc for simpler test setup - Clean up unused imports and organize test structure 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5e7d78d commit 8dc584f

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/test/kotlin/com/dpconde/sofiatracker/presentation/controllers/EventControllerIntegrationTest.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
package com.dpconde.sofiatracker.presentation.controllers
22

33
import com.fasterxml.jackson.databind.ObjectMapper
4-
import com.dpconde.sofiatracker.TestConfiguration
54
import com.dpconde.sofiatracker.presentation.dto.CreateEventRequestDto
65
import com.dpconde.sofiatracker.presentation.dto.UpdateEventRequestDto
76
import org.junit.jupiter.api.Test
87
import org.springframework.beans.factory.annotation.Autowired
9-
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureWebMvc
108
import org.springframework.boot.test.context.SpringBootTest
11-
import org.springframework.context.annotation.Import
129
import org.springframework.http.MediaType
13-
import org.springframework.test.context.ActiveProfiles
1410
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
1516
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*
1617
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.*
1718
import org.springframework.transaction.annotation.Transactional
1819

19-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
20-
@AutoConfigureWebMvc
20+
@SpringBootTest
2121
@ActiveProfiles("test")
22+
@AutoConfigureMockMvc
2223
@Transactional
23-
@Import(TestConfiguration::class)
2424
class EventControllerIntegrationTest {
2525

2626
@Autowired
27-
private lateinit var mockMvc: MockMvc
27+
private lateinit var objectMapper: ObjectMapper
2828

2929
@Autowired
30-
private lateinit var objectMapper: ObjectMapper
30+
private lateinit var mockMvc: MockMvc
3131

3232
@Test
3333
fun `should create and retrieve EAT event`() {

0 commit comments

Comments
 (0)