From 5d6040df618b818835e2492269bab78d85c1d8ed Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Wed, 24 May 2017 23:45:36 +0200 Subject: [PATCH] example: oauth2 & /helloworld --- examples/WireMock.Net.ConsoleApplication/MainApp.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/WireMock.Net.ConsoleApplication/MainApp.cs b/examples/WireMock.Net.ConsoleApplication/MainApp.cs index 3595a185..91bfc912 100644 --- a/examples/WireMock.Net.ConsoleApplication/MainApp.cs +++ b/examples/WireMock.Net.ConsoleApplication/MainApp.cs @@ -36,6 +36,12 @@ namespace WireMock.Net.ConsoleApplication .WithHeader("Content-Type", "application/json") .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 .Given(Request.Create().WithPath(p => p.Contains("x")).UsingGet()) .AtPriority(4)