Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the way configuration was being bound, to make it work for complex objects. #471

Merged
merged 2 commits into from
Oct 6, 2023

Conversation

Robbware
Copy link
Contributor

@Robbware Robbware commented Oct 6, 2023

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the COMET-WEB code style guidelines
  • I have provided test coverage for my change (where applicable)

Description

Essentially, doing a .GetSection() doesn't retrieve the whole object - for that we have to use .Bind() (which I tried at first, but ran into issues while doing unit tests).
For the unit tests to work, a IConfiguration container had to be built, because there's no way to mock the .Bind() method to make it work for tests (it's a static method).

…ex object. Update the tests so they use an actual IConfiguration because we're not able to Mock .Bind().
@Robbware Robbware added the bug a bug that prevents the application to funcation as it should label Oct 6, 2023
@Robbware Robbware self-assigned this Oct 6, 2023
@sonarcloud
Copy link

sonarcloud bot commented Oct 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.20.1) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@Robbware Robbware merged commit 23164d8 into development Oct 6, 2023
7 checks passed
@Robbware Robbware deleted the Fix/configurationservice-not-binding-settings branch October 6, 2023 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug a bug that prevents the application to funcation as it should
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants