https://linen.dev logo
#help
Title
# help
u

Utku K

03/26/2024, 2:39 PM
Hi, I am mocking an endpoint and I have to add header matching to request. but that header has an integer value. withHeader takes StringValuePattern as value. how can i do that ? language: kotlin
Copy code
patch(urlEqualTo("/endpoint"))
                .withHeader(EXECUTOR_USER, equalTo("123")) // it should be 123
                .willReturn(
                    aResponse()
                        .withStatus(statusCode)
                        .withBody(mockResponse)
                )
        )
t

Tom

03/26/2024, 2:49 PM
You’re doing it the right way. Headers aren’t typed in HTTP, so they’re effectively all strings.
2 Views