mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-13 13:53:34 +01:00
WithProxy(...) does not save the mappings to file #317
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @martinkra on GitHub (Dec 5, 2020).
Originally assigned to: @StefH on GitHub.
I've created a console app that runs the server trying to record/capture mappings:
The server works fine, e.g. when accessing localhost:1234/test1 I get the data from https://github.com/test1. The problem is that I am unable to find the way to get the recorded mapping... No files are created. What am I missing?
@StefH commented on GitHub (Dec 5, 2020):
Files are created in the folder
{framework}/__admin/mappings.This folder is located in the same place where the binaries are located:

@martinkra commented on GitHub (Dec 5, 2020):
In my case the folder is netcoreapp3.1/__admin mappings are not created.

I've tried with .Net Core 2.1, didn't help.

@StefH commented on GitHub (Dec 5, 2020):
Hello @martinkra, now I see that you are defining proxy settings in two places.
Try like this example: https://github.com/WireMock-Net/WireMock.Net/blob/master/examples/WireMock.Net.Console.Proxy.NETCoreApp2/Program.cs
@martinkra commented on GitHub (Dec 5, 2020):
Your hint 'defining proxy settings in two places' helped, example too, thank you.
I figured that the problem was with defining proxy settings for a specific request. Recording settings seem to work only when configured during server start and should not be touched later. The code that works:
API makes appear that it is possible to configure recording for a specific request but that does not work:
@StefH commented on GitHub (Dec 6, 2020):
@martinkra I see you point. I'll check if I can change the code to save the mapping in all scenarios.
@StefH commented on GitHub (Dec 6, 2020):
https://github.com/WireMock-Net/WireMock.Net/pull/550
@martinkra commented on GitHub (Dec 7, 2020):
I couldn't find 1.3.8-ci-14324 on MyGet/stefh...
[cid:9ce639bc-24ce-4f15-8bd7-00b973d03bc4]
From: Stef Heyenrath notifications@github.com
Sent: Sunday, December 6, 2020 12:13 PM
To: WireMock-Net/WireMock.Net WireMock.Net@noreply.github.com
Cc: martinkra martinkra@gmail.com; Mention mention@noreply.github.com
Subject: Re: [WireMock-Net/WireMock.Net] How to setup proxy and recording properly (#549)
Can you try NuGet version 1.3.8-ci-14324 from MyGet?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/WireMock-Net/WireMock.Net/issues/549#issuecomment-739494206, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABKCZXC42A6CHL67JXUECYDSTNYNRANCNFSM4UORQK5A.
@StefH commented on GitHub (Dec 7, 2020):
@martinkra
Sorry, the version you need is
1.3.8-ci-14327@martinkra commented on GitHub (Dec 7, 2020):
No such version on nuget.org, MyGet feed https://www.myget.org/F/stefh does no longer work for me.
@StefH commented on GitHub (Dec 7, 2020):
Feed should be:
https://www.myget.org/F/wiremock-net/api/v3/index.json
See also
https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions
@martinkra commented on GitHub (Dec 7, 2020):
I've found the feed and the version. In build 1.3.8-ci-14327 recording settings on request level do not break the recording:
However, it is still a bit confusing that one could configure request level recording whithout setting up global recording, it would not work in that scenario.
@StefH commented on GitHub (Dec 7, 2020):
My intention was to fix the code so that your last code example would work fine. If this code example does not work correctly, I need to check the code again.
@martinkra commented on GitHub (Dec 7, 2020):
Code where recording is set twice works in 1.3.8-ci-14327, that did not work before so the original issue is fixed.
Code where recording is not set during server start and is set on request level (second snippet in my previous comment) does not work. I can manage without that feature but thought it is worth noting that it appears as an inconsistency or a bug.
@StefH commented on GitHub (Dec 7, 2020):
New (
1.3.8-ci-14337) on MyGetI think this is the full solution.
@martinkra commented on GitHub (Dec 7, 2020):
I agree that the proposed is the full solution. However, 1.3.8-ci-14337 does not work as described. The following code does not record mappings:
@StefH commented on GitHub (Dec 7, 2020):
@martinkra Thank you for your testing.
I hope this version
1.3.8-ci-14339works as defined.@martinkra commented on GitHub (Dec 7, 2020):
@StefH Thank you for your help and fixes.
Version 1.3.8-ci-14339 works as defined.
@StefH commented on GitHub (Dec 8, 2020):
New official version will be released today.