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

functional tests - part 1 #20

Merged
merged 11 commits into from
Feb 3, 2023
Merged

functional tests - part 1 #20

merged 11 commits into from
Feb 3, 2023

Conversation

emdobrin
Copy link
Contributor

@emdobrin emdobrin commented Feb 2, 2023

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@emdobrin emdobrin requested a review from sbenedicadb February 2, 2023 07:50
@codecov
Copy link

codecov bot commented Feb 2, 2023

Codecov Report

Merging #20 (bdab634) into dev-v2.0.0 (8a1888d) will increase coverage by 2.07%.
The diff coverage is 77.78%.

❗ Current head bdab634 differs from pull request most recent head 55b332d. Consider uploading reports for the commit 55b332d to get more accurate results

@@               Coverage Diff                @@
##             dev-v2.0.0      #20      +/-   ##
================================================
+ Coverage         82.43%   84.50%   +2.07%     
- Complexity          135      140       +5     
================================================
  Files                 6        6              
  Lines               592      600       +8     
  Branches             84       89       +5     
================================================
+ Hits                488      507      +19     
+ Misses               77       62      -15     
- Partials             27       31       +4     
Flag Coverage Δ
functional-tests 63.33% <61.11%> (+47.62%) ⬆️
unit-tests 81.67% <61.11%> (+0.92%) ⬆️

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

Impacted Files Coverage Δ
...e/marketing/mobile/audience/AudienceConstants.java 100.00% <ø> (ø)
...e/marketing/mobile/audience/AudienceExtension.java 81.59% <55.56%> (+1.04%) ⬆️
...adobe/marketing/mobile/audience/AudienceState.java 100.00% <100.00%> (ø)
...hone/java/com/adobe/marketing/mobile/Audience.java 65.00% <0.00%> (+13.33%) ⬆️

@emdobrin emdobrin requested a review from addb February 3, 2023 03:34

// preset the config and shared Preferences
//mockUUIDInPersistence();
registerExtensions(config);
Copy link
Contributor

Choose a reason for hiding this comment

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

MobileCore.updateConfiguration(config);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

registerExtensions with config calls updateConfiguration underneath for quick setup

signalRequest
);
assertEquals(2, requests.size());
assertTrue(requests.get(0).getUrl().contains("https://server/event?"));
Copy link
Contributor

Choose a reason for hiding this comment

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

should we verify the second request as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

verified below on requests.get(1)

TestableNetworkRequest signalRequest = new TestableNetworkRequest("https://server/event", HttpMethod.GET);
testableNetworkService.setExpectedNetworkRequest(signalRequest, 2);

config.put("global.privacy", "optunknown");
Copy link
Contributor

Choose a reason for hiding this comment

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

should we use MobileCore.setPrivacyStatus(MobilePrivacyStatus.OPT_UNKNOWN); in place of updateConfig?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

again, this time just overwriting config with privacy unknown and setting the config on registration

@addb
Copy link
Contributor

addb commented Feb 3, 2023

Have left few comments. Otherwise looks good!

Copy link
Contributor

@addb addb left a comment

Choose a reason for hiding this comment

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

Looks good!

@emdobrin emdobrin merged commit 9414157 into adobe:dev-v2.0.0 Feb 3, 2023
@emdobrin emdobrin deleted the tests2 branch February 3, 2023 07:47
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.

2 participants