3

I've developed a project using asp.net core 2.0 + wiremock.net. Currently, I'm able to handle json files under "__admin/mappings" directory only. However, I have several json files and because of that, I'd like to add one more folder under the "mappings" directory, for example "__admin/mappings/{anotherFolder}".

What I have:

 __admin/mappings/first.json
 __admin/mappings/second.json

What I would like to have:

 __admin/mappings/folder_A/first.json
 __admin/mappings/folder_A/second.json
 __admin/mappings/folder_B/first.json
 __admin/mappings/folder_B/second.json

I've tried to add one more folder under the "mappings" folder, but when I tried to reach the json route, I got a message "No matching mapping found". Is there any way to handle json files from different directories?

2 Answers2

4

I had to implement my own FileSystemHandler object and pass it on the FluentMockServerSettings constructor:

var stub = FluentMockServer.Start(
                new FluentMockServerSettings
                {
                    Urls = new[] {"http://+:5001" },
                    StartAdminInterface = true,
                    ReadStaticMappings = true,
                    WatchStaticMappings = true,
                    **FileSystemHandler = new CustomFileSystemFileHandler()**
                }
            );
1

You can use settings now

"WatchStaticMappingsInSubdirectories":  true
user2397863
  • 350
  • 4
  • 4