chore(backend): replace @Configuration with @TestConfiguration in test classes
- Adjusted annotations in `PingControllerIntegrationTest` and `PingControllerTest` to improve test context setup.
This commit is contained in:
+2
-2
@@ -12,8 +12,8 @@ import org.junit.jupiter.api.Test
|
|||||||
import org.springframework.beans.factory.annotation.Autowired
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
import org.springframework.beans.factory.annotation.Qualifier
|
import org.springframework.beans.factory.annotation.Qualifier
|
||||||
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
|
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
|
||||||
|
import org.springframework.boot.test.context.TestConfiguration
|
||||||
import org.springframework.context.annotation.Bean
|
import org.springframework.context.annotation.Bean
|
||||||
import org.springframework.context.annotation.Configuration
|
|
||||||
import org.springframework.context.annotation.Import
|
import org.springframework.context.annotation.Import
|
||||||
import org.springframework.context.annotation.Primary
|
import org.springframework.context.annotation.Primary
|
||||||
import org.springframework.test.context.ActiveProfiles
|
import org.springframework.test.context.ActiveProfiles
|
||||||
@@ -42,7 +42,7 @@ class PingControllerIntegrationTest {
|
|||||||
@Qualifier("pingUseCaseIntegrationMock")
|
@Qualifier("pingUseCaseIntegrationMock")
|
||||||
private lateinit var pingUseCase: PingUseCase
|
private lateinit var pingUseCase: PingUseCase
|
||||||
|
|
||||||
@Configuration
|
@TestConfiguration
|
||||||
class PingControllerIntegrationTestConfig {
|
class PingControllerIntegrationTestConfig {
|
||||||
@Bean("pingUseCaseIntegrationMock")
|
@Bean("pingUseCaseIntegrationMock")
|
||||||
@Primary
|
@Primary
|
||||||
|
|||||||
+2
-2
@@ -16,8 +16,8 @@ import org.springframework.beans.factory.annotation.Autowired
|
|||||||
import org.springframework.beans.factory.annotation.Qualifier
|
import org.springframework.beans.factory.annotation.Qualifier
|
||||||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
|
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
|
||||||
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
|
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
|
||||||
|
import org.springframework.boot.test.context.TestConfiguration
|
||||||
import org.springframework.context.annotation.Bean
|
import org.springframework.context.annotation.Bean
|
||||||
import org.springframework.context.annotation.Configuration
|
|
||||||
import org.springframework.context.annotation.Import
|
import org.springframework.context.annotation.Import
|
||||||
import org.springframework.context.annotation.Primary
|
import org.springframework.context.annotation.Primary
|
||||||
import org.springframework.test.context.ActiveProfiles
|
import org.springframework.test.context.ActiveProfiles
|
||||||
@@ -54,7 +54,7 @@ class PingControllerTest {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private lateinit var objectMapper: ObjectMapper
|
private lateinit var objectMapper: ObjectMapper
|
||||||
|
|
||||||
@Configuration
|
@TestConfiguration
|
||||||
class PingControllerTestConfig {
|
class PingControllerTestConfig {
|
||||||
@Bean("pingUseCaseMock")
|
@Bean("pingUseCaseMock")
|
||||||
@Primary
|
@Primary
|
||||||
|
|||||||
Reference in New Issue
Block a user