Integration test cases#101
Conversation
* Fix deprecated use of * Fix Groovy warnings in build files
* Send 'complete' event after all response handles are recieved when requested * Update event source variable names to match source name 'CONTENT_COMPLETE' * Reword method description for sendCompletionRequested * Add more tests to bump coverage numbers * Add Content Complete event to event-reference documentation * Update event-reference with sendCompletion property and response content definition. * Capitalize 'Defined' in table for completion event description
Bump version to 2.3.0
Add content complete event to toc, update response content description
Merge to Staging for v2.3.0 release
Using 'asNode()' gives warning about implicit null value, however passing 'asNode(null)' fails to build publish step.
Revert 'asNode(null)' to 'asNode()'.
Merge to Staging for 2.3.0 Gradle fix for publish
…be#89) * Set Core dependency to 2.4.0 * Replace hardcoded event source with EventSource.CONTENT_COMPLETE * Fix failing deep copy test after Core changes to ignore invalid objects.
Merge to Staging for 2.4.0 release, updates Core dependency to 2.4.0
Merge to Main for 2.3.0 release
Update integration test setup steps
… testable network request First integration test case
…Expectations call
|
@timkimadobe unit tests are failing at testDeepCopy_whenInvalidMapWithCustomObjects_returnsOnlyValidObjects which was fixed in dev. Can you synchronize the changes from dev into your feature branch? |
|
to your question above, what you currently have for checking content length and bites looks ok to me |
emdobrin
left a comment
There was a problem hiding this comment.
Looks great and thanks for preserving the consistency with the ios suite 💯
| Edge.sendEvent(experienceEvent) {} | ||
|
|
||
| realNetworkService.assertAllNetworkRequestExpectations() | ||
| val matchingResponse = realNetworkService.getResponseFor(interactNetworkRequest) |
There was a problem hiding this comment.
should this be getResponsesFor and return an array with all matches for this url? then we can also assert the number is greater than the expectation. This comment applies for all other tests the get the responses for asserts.
There was a problem hiding this comment.
Yes I think that sounds great! Refactored to make the responses a list, and updated test expectations accordingly
…quest Refactor usages Update documentation
# Conflicts: # code/app/build.gradle # code/edge/build.gradle # code/edge/src/androidTest/java/com/adobe/marketing/mobile/EdgeFunctionalTests.java
Merged |
Codecov Report
@@ Coverage Diff @@
## feature/integration-tests #101 +/- ##
===============================================================
- Coverage 83.63% 83.59% -0.04%
- Complexity 381 385 +4
===============================================================
Files 29 29
Lines 1582 1578 -4
Branches 225 223 -2
===============================================================
- Hits 1323 1319 -4
- Misses 162 165 +3
+ Partials 97 94 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
| responseConnection: HttpConnecting | ||
| ) { | ||
| networkResponses[request] = responseConnection | ||
| if (networkResponses[request] != null) { |
There was a problem hiding this comment.
- nit: equivalent to this API in iOS is recordSentNetworkRequest
- I think all equality checks on network requests in this file will fail without using a custom equality check similar to iOS, or do we already have a custom isEqual in Android?
There was a problem hiding this comment.
I believe this is the same as setResponseFor
This is the one that records the network response for a given request
I've renamed the method on Android to match accordingly!
There is a custom equals implementation already in place for the TestableNetworkRequest class which also provides a hash implementation for dictionaries to use both of these custom implementations to manage keys
I think there could be benefit to bringing this style implementation to iOS, since we can have the benefit of a new TestableNetworkRequest: NetworkRequest without overwriting the default equals and hashable implementation of NetworkRequest, which we tried to avoid by using a custom isCustomEquals method which I think is a bit clumsier
There was a problem hiding this comment.
Yup and in addition iOS would also need to handle a list of responses for a particular request
Description
This PR implements the integration test cases, achieving parity with the iOS integration tests: adobe/aepsdk-edge-ios#346
The environment file ID used is the same as on the iOS side.
Key differences (that should probably be ported to the iOS version):
private fun resetTestExpectations()within the test class to make managing multiple helper resets easierrealNetworkService.assertAllNetworkRequestExpectations()beforegetResponseFor, as the latter method is synchronousNotable changes:
testSendEvent_withInvalidDatastreamID_receivesExpectedErrorconsistently failing because of a race condition between configuration pending shared state and edge sendEvent event processingContent-Lengthheader value intestSendEvent_withInvalidLocationHint_receivesExpectedErrorto double validate that server intent is to send 0 bytes in the response bodyinputStreamis enough?TODO:
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: