-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consumer Api: Add get Tags endpoint (#917)
* feat: Add Tags Module * feat: Add Module class, configuration and Tag Provider service * feat: Add Tags Module to Consumer Api * feat: Add Tags controller and basic GET /Tags endpoint * chore: Make Tag title optional * chore: Add custom Json converter for the List Tags response to prevent camel case * feat: Add bruno file for GET /Tags endpoint * refactor: Rewrite ListTagsResponse Writer to reflect current specification * refactor: Add validators for options * refactor: Rewrite response to match current specification * feat: Add Tags module and GET /Tags endpoint to the Consumer Api Sdk * feat: Add integration test for the GET /Tags endpoint * chore: Add test attribute data * chore: Typo * chore: Add Tag infos to other appsettings.override files * chore: Move Tags projects into correct folder * chore: Minor fixes, typos and formatting * chore: Let Tags controller authorize the clients, but allow anonymous access for the GET /Tags endpoint * refactor: Move TagInfo into Domain project, use ITagsRepository instead of TagProvider * refactor: Remove custom json serializer * feat: Use custom validation for tags * refactor: Implement current structure in appsettings json files * feat: Add validation for language codes * chore: Add custom json converter again to prevent camel case conversion * refactor: use PascalCaseDictionaryConverter --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Timo Notheisen <[email protected]>
- Loading branch information
1 parent
2676c01
commit fa74950
Showing
31 changed files
with
795 additions
and
0 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
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
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
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
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
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
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,11 @@ | ||
meta { | ||
name: /Tags | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
get { | ||
url: {{baseUrl}}/Tags | ||
body: none | ||
auth: none | ||
} |
10 changes: 10 additions & 0 deletions
10
Applications/ConsumerApi/test/ConsumerApi.Tests.Integration/Features/Tags/GET.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,10 @@ | ||
@Integration | ||
Feature: GET /Tags | ||
|
||
User requests available Tags | ||
|
||
Scenario: Requesting the available Tags | ||
When A GET request to the /Tags endpoint gets sent | ||
Then the response status code is 200 (OK) | ||
And the response supports the English language | ||
And the response attributes contain tags |
43 changes: 43 additions & 0 deletions
43
...ons/ConsumerApi/test/ConsumerApi.Tests.Integration/StepDefinitions/TagsStepDefinitions.cs
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,43 @@ | ||
using Backbone.BuildingBlocks.SDK.Endpoints.Common.Types; | ||
using Backbone.ConsumerApi.Sdk.Endpoints.Tags.Types.Responses; | ||
using Backbone.ConsumerApi.Tests.Integration.Contexts; | ||
using Backbone.ConsumerApi.Tests.Integration.Helpers; | ||
|
||
namespace Backbone.ConsumerApi.Tests.Integration.StepDefinitions; | ||
|
||
[Binding] | ||
public class TagsStepDefinitions | ||
{ | ||
private readonly ResponseContext _responseContext; | ||
private readonly ClientPool _clientPool; | ||
|
||
private ApiResponse<ListTagsResponse>? _listTagsResponse; | ||
|
||
public TagsStepDefinitions(ResponseContext responseContext, ClientPool clientPool) | ||
{ | ||
_responseContext = responseContext; | ||
_clientPool = clientPool; | ||
} | ||
|
||
[When("A GET request to the /Tags endpoint gets sent")] | ||
public async Task WhenAGETRequestToTheTagsEndpointGetsSent() | ||
{ | ||
var client = _clientPool.Anonymous; | ||
_responseContext.WhenResponse = _listTagsResponse = await client.Tags.ListTags(); | ||
} | ||
|
||
[Then("the response supports the English language")] | ||
public void AndTheResponseSupportsTheEnglishLanguage() | ||
{ | ||
_listTagsResponse!.Result!.SupportedLanguages.Should().Contain("en"); | ||
} | ||
|
||
[Then("the response attributes contain tags")] | ||
public void AndTheResponseAttributesContainTags() | ||
{ | ||
foreach (var attr in _listTagsResponse!.Result!.TagsForAttributeValueTypes.Values) | ||
{ | ||
attr.Should().NotBeEmpty(); | ||
} | ||
} | ||
} |
Oops, something went wrong.