add example static .json

This commit is contained in:
Stef Heyenrath
2020-10-05 14:29:21 +00:00
parent 0964eb2c2d
commit b303f7cf89
3 changed files with 81 additions and 3 deletions

View File

@@ -80,6 +80,9 @@
<None Update="__admin\mappings\00000002-ee28-4f29-ae63-1ac9b0802d87.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="__admin\mappings\351f0240-bba0-4bcb-93c6-1feba0fe8799.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="__admin\mappings\array.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>

View File

@@ -48,8 +48,8 @@ namespace WireMock.Net.Tests
string folder = Path.Combine(GetCurrentFolder(), "__admin", "mappings");
server.ReadStaticMappings(folder);
Check.That(server.Mappings).HasSize(5);
Check.That(server.MappingModels).HasSize(5);
Check.That(server.Mappings).HasSize(6);
Check.That(server.MappingModels).HasSize(6);
// Act
server.ResetMappings();
@@ -218,7 +218,7 @@ namespace WireMock.Net.Tests
server.ReadStaticMappings(folder);
var mappings = server.Mappings.ToArray();
Check.That(mappings).HasSize(5);
Check.That(mappings).HasSize(6);
}
[Fact]

View File

@@ -0,0 +1,75 @@
{
"Guid": "351f0240-bba0-4bcb-93c6-1feba0fe8799",
"Title": "Playground",
"Request": {
"Path": {
"Matchers": [
{
"Name": "WildcardMatcher",
"Pattern": "/playground",
"IgnoreCase": false
}
]
},
"Methods": [
"POST"
],
"Headers": [
{
"Name": "Content-Type",
"Matchers": [
{
"Name": "WildcardMatcher",
"Pattern": "application/json; charset=utf-8",
"IgnoreCase": true
}
]
},
{
"Name": "Accept",
"Matchers": [
{
"Name": "WildcardMatcher",
"Pattern": "application/json",
"IgnoreCase": true
}
]
},
{
"Name": "Authorization",
"Matchers": [
{
"Name": "WildcardMatcher",
"Pattern": "Bearer 4d911614-fa48-484f-b8e6-98674fd73964",
"IgnoreCase": true
}
]
},
{
"Name": "Content-Length",
"Matchers": [
{
"Name": "WildcardMatcher",
"Pattern": "*",
"IgnoreCase": true
}
]
}
],
"Body": {
"Matcher": {
"Name": "JsonMatcher",
"Pattern": {},
"IgnoreCase": false
}
}
},
"Response": {
"StatusCode": 201,
"BodyAsJson": {},
"Headers": {
"Content-Type": "application/json",
"Connection": "keep-alive"
}
}
}