Refactor unit test cases to use JSON comparison (part 2)#436
Merged
timkimadobe merged 30 commits intoadobe:devfrom Jan 8, 2024
Merged
Refactor unit test cases to use JSON comparison (part 2)#436timkimadobe merged 30 commits intoadobe:devfrom
timkimadobe merged 30 commits intoadobe:devfrom
Conversation
…dsNetworkRequest_returnsTrue
testProcessHit_experienceEvent_withDatastreamOverrideSet_sendsNetworkRequest_returnsTrue change intent:
1. Refactor existing mock network service method usage to AEPTestUtils MockNetworkService, which explicitly requires URL
a. Has the downstream effect of more strictly validating the request
2. Take advantage of new functionality in mockNetworkService.assertAllNetworkRequestExpectations to validate both:
a. Expected events
b. No unexpected events (toggleable)
3. Remove mock response from test case setup since it is the same as the mock response set in helper assertProcessHit
…urnsTrue Remove mock response from test case setup since it is the same as the mock response set in helper assertProcessHit
To take advantage of new functionality in mockNetworkService.assertAllNetworkRequestExpectations to validate:
a. Expected events
b. No unexpected events (toggleable)
c. No requests sent out (no expectations + no unexpected events allowed)
Move encoder to top level of class for reuse
This was referenced Dec 15, 2023
kevinlind
approved these changes
Jan 6, 2024
Contributor
kevinlind
left a comment
There was a problem hiding this comment.
Looks good, though you'll need to fix the build failures before merging.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## dev #436 +/- ##
=======================================
Coverage 96.47% 96.47%
=======================================
Files 27 27
Lines 1730 1730
=======================================
Hits 1669 1669
Misses 61 61 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This is the second part in a multi-part series of PRs that will refactor existing Edge extension unit and functional tests to use the JSON comparison tool from
AEPTestUtilsSee part 1: #434 (Please merge part 1 first, as this branch incorporates its changes.)
Description
This PR refactors the rest of the Edge extension unit tests to use the test helper utilities from
AEPTestUtilsQuestions for reviewers
In
RequestBuilderTests.swifttestGetPayloadWithExperienceEvents_withEventXdm_verifyEventId_verifyTimestampand
testGetPayloadWithExperienceEvents_withQuery_responseContainsQueryRelated Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: