1

我正在尝试使用MockServerQuarkus 测试 API 客户端。这是我的测试代码:

//@QuarkusTest
@ExtendWith(QuarkusTestExtension::class, MockServerExtension::class)
class APIClientTest(private val mockServerClient: MockServerClient) {
    @Test
    fun testClient() {
        assert(mockServerClient.hasStarted())
    }
}

运行它会产生以下错误:

Discovered multiple competing ParameterResolvers for parameter [org.mockserver.client.MockServerClient mockServerClient] in constructor [public com.example.APIClientTest(org.mockserver.client.MockServerClient)]: io.quarkus.test.junit.QuarkusTestExtension@5bff6eec, org.mockserver.junit.jupiter.MockServerExtension@a2f7328

如何将 MockServer 与 Quarkus 结合使用?

4

0 回答 0