mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-23 08:48:28 +02:00
example: oauth2 & /helloworld
This commit is contained in:
@@ -36,6 +36,12 @@ namespace WireMock.Net.ConsoleApplication
|
|||||||
.WithHeader("Content-Type", "application/json")
|
.WithHeader("Content-Type", "application/json")
|
||||||
.WithBodyAsJson(new { access_token = "AT", refresh_token = "RT" }));
|
.WithBodyAsJson(new { access_token = "AT", refresh_token = "RT" }));
|
||||||
|
|
||||||
|
server
|
||||||
|
.Given(Request.Create().WithPath("/helloworld").UsingGet().WithHeader("Authorization", new RegexMatcher("^(?i)Bearer AT$")))
|
||||||
|
.RespondWith(Response.Create()
|
||||||
|
.WithStatusCode(200)
|
||||||
|
.WithBody("hi"));
|
||||||
|
|
||||||
server
|
server
|
||||||
.Given(Request.Create().WithPath(p => p.Contains("x")).UsingGet())
|
.Given(Request.Create().WithPath(p => p.Contains("x")).UsingGet())
|
||||||
.AtPriority(4)
|
.AtPriority(4)
|
||||||
|
|||||||
Reference in New Issue
Block a user