Releases: appercept/Delphi-WebMocks
Releases · appercept/Delphi-WebMocks
3.2.1
What's Changed
- fix: Allow duplicate query parameter matching by @rhatherall in #55
- fix: Allow setting Content-Length by header by @rhatherall in #57
- fix: Allow multiple assertions by @rhatherall in #59
- fix: Restore History interface by @rhatherall in #60
Full Changelog: 3.2.0...3.2.1
3.2.0
What's Changed
- Add support for asserting HEAD requests by @rhatherall in #48
- Fix exception matching query params with no value by @rhatherall in #50
- Add support for matching content by XML values by @rhatherall in #51
- Add support for matching JSON content by RegEx by @rhatherall in #52
Full Changelog: 3.1.0...3.2.0
3.1.0
Implemented enhancements:
- Add support for matching requests by query params #46 (rhatherall)
3.0.1
3.0.0
New Features
- Assertion matching by URL query parameters #41
WebMock.Assert
.Get('/resource`)
.WithQueryParam('ParamName', 'Value')
.WasRequested;
- Request content matching by Form-Data #20
HTTP requests can be matched by form-data as submitted with content-type of application/x-www-form-urlencoded. Multiple matching field values can be combined. For example:
WebMock.StubRequest('*', '*')
.WithFormData('AField', 'A value.')
.WithFormData('AOtherField', 'Another value.');
To simply match the presence of a field, a wildcard * can be passed for the value.
- Request matching by JSON values
HTTP requests can be matched by JSON data as submitted with content-type of application/json using WithJSON. Multiple matching field values can be combined. For example:
WebMock.StubRequest('*', '*')
.WithJSON('ABoolean', True)
.WithJSON('AFloat', 0.123)
.WithJSON('AInteger', 1)
.WithJSON('AString', 'value');
The first argument can be a path. For example, in the following JSON, the path objects[0].key would match value 1.
{
"objects": [
{ "key": "value 1" },
{ "key": "value 2" }
]
}
Assertions can also be made with JSON values:
WebMock.Assert
.Patch('/resource`)
.WithJSON('key', 'value')
.WasRequested;
Fixed Bugs
2.0.0
New Features
- Dynamic response stubs #40
WebMock.StubRequest('*', '*')
.ToRespondWith(
procedure (const ARequest: IWebMockHTTPRequest;
const AResponse: IWebMockResponseBuilder)
begin
AReponse
.WithStatus(202)
.WithHeader('header-1', 'a-value')
.WithBody('Some content...');
end
);
Fixed Bugs
- Unsupported Authorisation Scheme error when setting
Authorization
header. #35 - Repeated calls to stubs with content causes exception. #33
Cleanup
1.3.0
1.2.2
1.2.1
First release with Delphinus support.