Alex Ku3menk0
11/28/2019, 11:45 AMNo qualifying bean of type 'kotlin.coroutines.CoroutineContext' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
My controller looks like:
@Controller
class MobileController {
@PostMapping("/register")
suspend fun register() {
...
}
}
and my test:
@WebFluxTest(MobileController::class)
internal class MobileControllerTest {
@Autowired
lateinit var client: WebTestClient
@Test
fun handleRegister() = kotlinx.coroutines.runBlocking {
<http://client.post|client.post>()
.uri("/register")
.exchange()
.expectStatus().isOk
}
}
Does anyone know how to fix it?
Thanks in advance 🙂Gary
11/29/2019, 12:15 AM