Skip to content

WithParam not working. #1164

Closed
Closed
@hmiguel

Description

@hmiguel

Hello,

I'm trying to do a mock with 'WithParam', but seems like it's not working.

using WireMock.Matchers;
using WireMock.Server;

var client = new HttpClient();
var server = WireMockServer.Start();

server.Given(
    WireMock.RequestBuilders.Request.Create()
    .WithPath("/test")
        .UsingGet()
        .WithParam("filters", new ExactMatcher("a:b,c:d"))
    )
    .RespondWith(
        WireMock.ResponseBuilders.Response.Create()
           .WithHeader("Content-Type", "application/json")
           .WithStatusCode(200)
           .WithDelay(TimeSpan.FromMilliseconds(50))
    );

var response = await client.GetAsync($"http://localhost:{server.Port}/test?filters=a:b,c:d");

Console.WriteLine("Response: " + response.StatusCode);

Result

Mock not found.

Expected Result

Mock found.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions