Skip to content

chore: javadoc and tests for api, context#942

Merged
toddbaert merged 2 commits into
mainfrom
chore/more-tests-and-doc
Jun 14, 2024
Merged

chore: javadoc and tests for api, context#942
toddbaert merged 2 commits into
mainfrom
chore/more-tests-and-doc

Conversation

@toddbaert

@toddbaert toddbaert commented May 17, 2024

Copy link
Copy Markdown
Member

This PR contains no functional changes, it:

  • adds specific test for API context
  • cleans up general merging test by using spy
  • adds missing javadocs on API

fixes: #939

⚠️ Please don't merge before #934 so we can avoid some conflicts.

@toddbaert toddbaert requested a review from a team as a code owner May 17, 2024 14:54
@toddbaert toddbaert force-pushed the chore/more-tests-and-doc branch from 3a5bc97 to e43f7c8 Compare May 17, 2024 14:57
@codecov

codecov Bot commented May 17, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.27%. Comparing base (a0b1d25) to head (d406218).

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #942      +/-   ##
============================================
+ Coverage     95.04%   95.27%   +0.22%     
- Complexity      392      393       +1     
============================================
  Files            38       38              
  Lines           888      888              
  Branches         54       54              
============================================
+ Hits            844      846       +2     
+ Misses           24       23       -1     
+ Partials         20       19       -1     
Flag Coverage Δ
unittests 95.27% <ø> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

assertEquals("4", merged.getValue("common5").asString(), "invocation merge is incorrect");
assertEquals("4", merged.getValue("common6").asString(), "invocation merge is incorrect");

c.getBooleanValue("key", false, invocationCtx);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of the specific "getMergedContext" method, I simply used a spy here.

this.flagMetadata = flagMetadata;
}

EvaluationContext getMergedContext() {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is no longer needed, spies work better.

Comment thread src/main/java/dev/openfeature/sdk/OpenFeatureAPI.java
Comment thread src/main/java/dev/openfeature/sdk/OpenFeatureAPI.java

@Kavindu-Dodan Kavindu-Dodan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice set of improvements

Please see this to avoid conflicts in documentation

@toddbaert toddbaert marked this pull request as draft May 17, 2024 15:30
@Kavindu-Dodan Kavindu-Dodan added this to the 1.8.1 milestone May 24, 2024
@Kavindu-Dodan

Copy link
Copy Markdown
Contributor

@toddbaert I think this can be rebased an considered for 1.8.1 release :)

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
@toddbaert toddbaert force-pushed the chore/more-tests-and-doc branch from 716b105 to 638db9c Compare June 14, 2024 14:06
@toddbaert toddbaert marked this pull request as ready for review June 14, 2024 14:06
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@toddbaert toddbaert merged commit 4126b51 into main Jun 14, 2024
@toddbaert toddbaert deleted the chore/more-tests-and-doc branch June 14, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Evaluation Context behavior is suprising

3 participants