public async Task WithProxyUrl_WhenACallWasMadeWithProxyUrl_Should_BeOK() { _server.ResetMappings(); _server.Given(Request.Create().UsingAnyMethod()) .RespondWith(Response.Create().WithProxy(new ProxyAndRecordSettings { Url = "http://localhost:9999" })); await _httpClient.GetAsync(""); _server.Should() .HaveReceivedACall() .WithProxyUrl($"http://localhost:9999"); }
private async Task ResetMappings() { var response = await _client.PostNothingAsync("/__admin/mappings/reset"); response.EnsureSuccessStatusCode(); _mockServer.ResetMappings(); }
protected BaseTestController(WebApplicationFactory factory) { HttpClient = factory.CreateClient(); var wiereMockConfig = new WireMockServerSettings { Urls = new[] { "http://localhost:9093" }, ReadStaticMappings = true }; httpMockServer = WireMockServer.Start(wiereMockConfig); httpMockServer.ResetMappings(); httpMockServer.ReadStaticMappings("Integration/Mappings/"); }
public async Task CanGetListOfStatusWithMultipleItems() { server.Reset(); var expected = new List <DurableFunctionStatus>() { new DurableFunctionStatus() { Name = "MyDurableOrchestrator", InstanceId = "39432fc3815f4900a0a4357febec5012", RuntimeStatus = "Running" }, new DurableFunctionStatus() { Name = "MyDurableOrchestrator", InstanceId = "93581509a6898c110182fedbeef29616", RuntimeStatus = "Terminated" }, }; server.ResetMappings(); server .Given( Request .Create() .WithPath("/runtime/webhooks/durabletask/instances") .UsingGet() ) .RespondWith( Response .Create() .WithStatusCode(200) .WithBody(@"[ { ""name"": ""MyDurableOrchestrator"", ""instanceId"": ""39432fc3815f4900a0a4357febec5012"", ""runtimeStatus"": ""Running"", ""input"": [], ""customStatus"": null, ""output"": null, ""createdTime"": ""2020-11-04T21:44:45Z"", ""lastUpdatedTime"": ""2020-11-04T21:44:46Z"" }, { ""name"": ""MyDurableOrchestrator"", ""instanceId"": ""93581509a6898c110182fedbeef29616"", ""runtimeStatus"": ""Terminated"", ""input"": [], ""customStatus"": null, ""output"": null, ""createdTime"": ""2020-11-03T21:44:45Z"", ""lastUpdatedTime"": ""2020-11-03T21:44:46Z"" } ]") ); var client = new DurableFunctionClient(server.Ports[0]); var actual = await client.GetAllFunctionStatuses(); actual.Should().BeEquivalentTo(expected); }
public void SetUp() { DocmosisServer = WireMockServer.Start(); DocmosisServer.ResetMappings(); }