bug: Fix admin api client definition returning the wrong types (#65)

* bug: Fix admin api client definition returning the wrong types

- IFluentMockServerAdmin get, find and get all requests should return a log entry model
- Add tests for get and find using the rest ease api client

* Fix Build status and rename tests
This commit is contained in:
Alastair Crabtree
2017-11-19 19:44:05 +00:00
committed by Stef Heyenrath
parent d39e9ef7fa
commit 208303729e
4 changed files with 70 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using WireMock.Admin.Mappings;
using WireMock.Admin.Requests;
using WireMock.Admin.Settings;
using WireMock.Logging;
namespace WireMock.Client
{
@@ -103,7 +104,7 @@ namespace WireMock.Client
/// </summary>
/// <returns>LogRequestModels</returns>
[Get("__admin/requests")]
Task<IList<LogRequestModel>> GetRequestsAsync();
Task<IList<LogEntryModel>> GetRequestsAsync();
/// <summary>
/// Delete all requests.
@@ -123,7 +124,7 @@ namespace WireMock.Client
/// <param name="guid">The Guid</param>
/// <returns>MappingModel</returns>
[Get("__admin/requests/{guid}")]
Task<LogRequestModel> GetRequestAsync([Path] Guid guid);
Task<LogEntryModel> GetRequestAsync([Path] Guid guid);
/// <summary>
/// Delete a request based on the guid
@@ -137,7 +138,7 @@ namespace WireMock.Client
/// </summary>
/// <param name="model">The RequestModel</param>
[Post("__admin/requests/find")]
Task<IList<LogRequestModel>> FindRequestsAsync([Body] RequestModel model);
Task<IList<LogEntryModel>> FindRequestsAsync([Body] RequestModel model);
/// <summary>
/// Get all scenarios

View File

@@ -486,7 +486,7 @@ namespace WireMock.Server
}
}
var result = dict.OrderBy(x => x.Value.AverageTotalScore).Select(x => x.Key);
var result = dict.OrderBy(x => x.Value.AverageTotalScore).Select(x => x.Key).Select(ToLogEntryModel);
return ToJson(result);
}