Implement "/__admin/requests"

This commit is contained in:
Stef Heyenrath
2017-01-26 12:00:30 +01:00
parent 1bf543a91e
commit a334974bef
30 changed files with 319 additions and 104 deletions

View File

@@ -1,4 +1,4 @@
namespace WireMock.Admin
namespace WireMock.Admin.Mappings
{
/// <summary>
/// Body Model

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace WireMock.Admin
namespace WireMock.Admin.Mappings
{
/// <summary>
/// Cookie Model

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace WireMock.Admin
namespace WireMock.Admin.Mappings
{
/// <summary>
/// Header Model

View File

@@ -1,6 +1,6 @@
using System;
namespace WireMock.Admin
namespace WireMock.Admin.Mappings
{
/// <summary>
/// MappingModel

View File

@@ -1,4 +1,4 @@
namespace WireMock.Admin
namespace WireMock.Admin.Mappings
{
/// <summary>
/// MatcherModel

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace WireMock.Admin
namespace WireMock.Admin.Mappings
{
/// <summary>
/// Param Model

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace WireMock.Admin
namespace WireMock.Admin.Mappings
{
/// <summary>
/// RequestModel
@@ -16,9 +16,9 @@ namespace WireMock.Admin
public UrlModel Url { get; set; }
/// <summary>
/// The verbs
/// The methods
/// </summary>
public string[] Verbs { get; set; }
public string[] Methods { get; set; }
/// <summary>
/// Gets or sets the Headers.

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace WireMock.Admin
namespace WireMock.Admin.Mappings
{
/// <summary>
/// ResponseModel

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace WireMock.Admin
namespace WireMock.Admin.Mappings
{
/// <summary>
/// UrlModel

View File

@@ -0,0 +1,24 @@
namespace WireMock.Admin.Requests
{
/// <summary>
/// Request Log Model
/// </summary>
public class LogEntryModel
{
/// <summary>
/// Gets or sets the request.
/// </summary>
/// <value>
/// The request.
/// </value>
public LogRequestModel Request { get; set; }
/// <summary>
/// Gets or sets the response.
/// </summary>
/// <value>
/// The response.
/// </value>
public LogResponseModel Response { get; set; }
}
}

View File

@@ -0,0 +1,104 @@
using System;
using System.Collections.Generic;
using WireMock.Util;
namespace WireMock.Admin.Requests
{
/// <summary>
/// RequestMessage Model
/// </summary>
public class LogRequestModel
{
/// <summary>
/// Gets or sets the unique identifier.
/// </summary>
/// <value>
/// The unique identifier.
/// </value>
public Guid Guid { get; set; }
/// <summary>
/// Gets the DateTime.
/// </summary>
public DateTime DateTime { get; set; }
/// <summary>
/// Gets or sets the URL.
/// </summary>
/// <value>
/// The URL.
/// </value>
public string Url { get; set; }
/// <summary>
/// Gets or sets the absolete URL.
/// </summary>
/// <value>
/// The absolete URL.
/// </value>
public string AbsoleteUrl { get; set; }
/// <summary>
/// Gets the query.
/// </summary>
public IDictionary<string, WireMockList<string>> Query { get; set; }
/// <summary>
/// Gets or sets the method.
/// </summary>
/// <value>
/// The method.
/// </value>
public string Method { get; set; }
/// <summary>
/// Gets or sets the Headers.
/// </summary>
/// <value>
/// The Headers.
/// </value>
public IDictionary<string, string> Headers { get; set; }
/// <summary>
/// Gets or sets the Cookies.
/// </summary>
/// <value>
/// The Cookies.
/// </value>
public IDictionary<string, string> Cookies { get; set; }
/// <summary>
/// Gets or sets the body.
/// </summary>
/// <value>
/// The body.
/// </value>
public string Body { get; set; }
/*
"id" : "45760a03-eebb-4387-ad0d-bb89b5d3d662",
"request" : {
"url" : "/received-request/9",
"absoluteUrl" : "http://localhost:56715/received-request/9",
"method" : "GET",
"clientIp" : "127.0.0.1",
"headers" : {
"Connection" : "keep-alive",
"Host" : "localhost:56715",
"User-Agent" : "Apache-HttpClient/4.5.1 (Java/1.7.0_51)"
},
"cookies" : { },
"browserProxyRequest" : false,
"loggedDate" : 1471442494809,
"bodyAsBase64" : "",
"body" : "",
"loggedDateString" : "2016-08-17T14:01:34Z"
},
"responseDefinition" : {
"status" : 404,
"transformers" : [ ],
"fromConfiguredStub" : false,
"transformerParameters" : { }
}*/
}
}

View File

@@ -0,0 +1,30 @@
using System.Collections.Generic;
namespace WireMock.Admin.Requests
{
/// <summary>
/// Response MessageModel
/// </summary>
public class LogResponseModel
{
/// <summary>
/// Gets or sets the status code.
/// </summary>
public int StatusCode { get; set; } = 200;
/// <summary>
/// Gets the headers.
/// </summary>
public IDictionary<string, string> Headers { get; set; }
/// <summary>
/// Gets or sets the body.
/// </summary>
public string Body { get; set; }
/// <summary>
/// Gets or sets the original body.
/// </summary>
public string BodyOriginal { get; set; }
}
}