fixing(gradle)
This commit is contained in:
@@ -1,21 +1,28 @@
|
||||
package at.mocode.temp.pingservice
|
||||
|
||||
import io.mockk.mockk
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
|
||||
import org.springframework.boot.test.mock.mockito.MockBean
|
||||
import org.springframework.boot.test.context.TestConfiguration
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Import
|
||||
import org.springframework.test.web.servlet.MockMvc
|
||||
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get
|
||||
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.*
|
||||
|
||||
@WebMvcTest(PingController::class)
|
||||
@Import(PingControllerTest.TestConfig::class)
|
||||
class PingControllerTest {
|
||||
|
||||
@Autowired
|
||||
private lateinit var mockMvc: MockMvc
|
||||
|
||||
@MockBean
|
||||
private lateinit var pingServiceCircuitBreaker: PingServiceCircuitBreaker
|
||||
@TestConfiguration
|
||||
class TestConfig {
|
||||
@Bean
|
||||
fun pingServiceCircuitBreaker(): PingServiceCircuitBreaker = mockk()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `ping endpoint should return pong status`() {
|
||||
|
||||
Reference in New Issue
Block a user