-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a better exception message (#51)
* Fixes #50. * Fixed typos and normalized capitalization.
- Loading branch information
Showing
5 changed files
with
493 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
Solutions/Menes.Specs/Features/HttpResultBuilderErrorDetection.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@perScenarioContainer | ||
|
||
Feature: HttpResultBuilderErrorDetection | ||
In order to discover that I've made a mistake | ||
As an OpenApi service developer | ||
I want to be told when my service is not providing an expected response | ||
|
||
Scenario: Operation returns an OpenApiResult with no matching status code | ||
Given I have an OpenApiOperation | ||
And I have an OpenApiResult with a 201 response | ||
When I pass the OpenApiOperation and OpenApiResult to HttpRequestResultBuilder.BuildResult | ||
Then it should throw an OutputBuilderNotFoundException | ||
|
||
Scenario: Operation returns an OpenApiResult with no matching media type | ||
Given I have an OpenApiOperation | ||
And I have an OpenApiResult with a 200 response | ||
When I pass the OpenApiOperation and OpenApiResult to HttpRequestResultBuilder.BuildResult | ||
Then it should throw an OutputBuilderNotFoundException | ||
|
||
Scenario: Operation returns an OpenApiResult with matching media type and status code | ||
Given I have an OpenApiOperation | ||
And I have an OpenApiResult with a 200 response and an "application/hal+json" body | ||
When I pass the OpenApiOperation and OpenApiResult to HttpRequestResultBuilder.BuildResult | ||
Then it should not throw an OutputBuilderNotFoundException | ||
|
||
Scenario: Operation returns an OpenApiResult with a mismatched media type | ||
Given I have an OpenApiOperation | ||
And I have an OpenApiResult with a 200 response and an "application/json" body | ||
When I pass the OpenApiOperation and OpenApiResult to HttpRequestResultBuilder.BuildResult | ||
Then it should throw an OutputBuilderNotFoundException |
Oops, something went wrong.