The current DSL for one of the WireMock operations:
@WiremockDsl
fun mockGet(
url: String,
statusCode: Int,
responseBody: Option<Any> = None,
metadata: Map<String, Any> = mapOf()
): WireMockSystem {
val mockRequest = get(urlEqualTo(url))
mockRequest.withMetadata(metadata)
val mockResponse = configureBody(statusCode, responseBody)
val stub = wireMock.stubFor(mockRequest.willReturn(mockResponse).withId(UUID.randomUUID()))
stubLog.put(stub.id, stub)
return this
}
The behavior of urlEqualTo(url) is explicitly defined by Stove, but there might be cases where users might want to relax the equality here. So, this can be provided from outside, as function parameter. Although, this might lead users to carefully design their endpoints and tests since relaxed mocks can be shared with other tests, and it can introduce flaky test results.
The current DSL for one of the WireMock operations:
The behavior of
urlEqualTo(url)
is explicitly defined by Stove, but there might be cases where users might want to relax the equality here. So, this can be provided from outside, as function parameter. Although, this might lead users to carefully design their endpoints and tests since relaxed mocks can be shared with other tests, and it can introduce flaky test results.Suggestion: