Skip to content

getEnabledFeature, Activate, getVariation and track Null check fixes #180

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

Merged
merged 2 commits into from
Apr 24, 2018

Conversation

mnoman09
Copy link
Contributor

  • Added test Case of Non null user id in get enabled Feature

  • Added Null check of experiment in user activate

  • added null check in user id and in event key of track

  • Added null check on Experiment key of getVariation and added its unitTest

* removed Nonnull from getEnabledFeature UserID and added check in ValidateUserID of non null user ID

* Added test Case of Non null user id in get enabled Feature

* Added Null check of experiment in user activate

* added null check in user id and in event key of track

* Added null check on Experiment key of getVariation and added its unitTest
@coveralls
Copy link

coveralls commented Apr 19, 2018

Pull Request Test Coverage Report for Build 511

  • 19 of 19 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.09%) to 88.871%

Totals Coverage Status
Change from base Build 508: 0.09%
Covered Lines: 2180
Relevant Lines: 2453

💛 - Coveralls

Copy link
Contributor

@thomaszurkan-optimizely thomaszurkan-optimizely left a comment

Choose a reason for hiding this comment

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

Can we remove that throws?

@@ -584,7 +604,7 @@ else if (userId == null) {
* @return List of the feature keys that are enabled for the user if the userId is empty it will
* return Empty List.
*/
public List<String> getEnabledFeatures(@Nonnull String userId,@Nonnull Map<String, String> attributes) {
public List<String> getEnabledFeatures(@Nonnull String userId, @Nonnull Map<String, String> attributes) throws IllegalArgumentException {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this should have a throws. Any of the methods could throw an illegal argument exception because of the non null annotations.

@thomaszurkan-optimizely thomaszurkan-optimizely merged commit 4abffbb into master Apr 24, 2018
@mikeproeng37 mikeproeng37 deleted the noman/ImplementedNullHandler branch January 15, 2019 22:29
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.

3 participants