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

chore: javadoc and tests for api, context #942

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

toddbaert
Copy link
Member

@toddbaert toddbaert commented May 17, 2024

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
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Copy link

codecov bot commented May 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.21%. Comparing base (08567f4) to head (716b105).
Report is 9 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #942      +/-   ##
============================================
+ Coverage     94.98%   95.21%   +0.22%     
- Complexity      383      384       +1     
============================================
  Files            36       36              
  Lines           877      877              
  Branches         53       53              
============================================
+ Hits            833      835       +2     
+ Misses           24       23       -1     
+ Partials         20       19       -1     
Flag Coverage Δ
unittests 95.21% <ø> (+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
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.

@@ -17,18 +15,13 @@ public DoSomethingProvider(ImmutableMetadata flagMetadata) {
this.flagMetadata = flagMetadata;
}

EvaluationContext getMergedContext() {
Copy link
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.

public Metadata getProviderMetadata() {
return getProvider().getMetadata();
}

/**
* Get metadata about a registered provider using the client name.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Get metadata about a registered provider using the client name.
* Get metadata about a registered provider using the client domain.

To match with domain scoping PR - #934 :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Please see client name vs domain usage in other places

Copy link
Member Author

Choose a reason for hiding this comment

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

I wanted to avoid as many clashes with that PR as possible...

But maybe it's better to merge that first.

Copy link
Contributor

@Kavindu-Dodan Kavindu-Dodan left a comment

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

Co-authored-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Copy link

sonarcloud bot commented May 17, 2024

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 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
Contributor

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

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