adobe / aepsdk-edge-ios

Adobe Experience Platform Edge Network mobile extension in Swift
Apache License 2.0
13 stars 24 forks source link

Refactor functional tests to use JSON comparison (part 1) #437

Closed timkimadobe closed 8 months ago

timkimadobe commented 9 months ago

Description

This PR updates the first portion of Edge functional tests to use the JSON comparison system. Broadly, it replaces dictionary flattening with JSON comparison. Specific changes:

  1. If flattened dictionary count was applied, then strict collection count checks are applied throughout the JSON validation when using the extensible comparison methods assertExactMatch/assertTypeMatch - that is, the refactor should preserve the same level of strictness for the payload being tested
  2. Everywhere FileManager.default.clearCache() is used, FileManager.default.removeAdobeCacheDirectory() was also added (given Core's new persistence handling)

Questions for reviewers

testSendEvent_receivesResponseEventHandle_sendsResponseEvent_pairedWithTheRequestEventId

  1. Can let requestId = resultNetworkRequests[0].url.queryParam("requestId") ever be nil? Should that be strictly validated? Currently the refactor sets the fallback value to "'

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

Checklist:

codecov[bot] commented 9 months ago

Codecov Report

Merging #437 (6fe2426) into dev (6a3563a) will not change coverage. The diff coverage is n/a.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #437 +/- ## ======================================= Coverage 96.47% 96.47% ======================================= Files 27 27 Lines 1730 1730 ======================================= Hits 1669 1669 Misses 61 61 ```