adobe / aepsdk-edge-ios

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

Network request helper parity #414

Closed timkimadobe closed 1 year ago

timkimadobe commented 1 year ago

Description

This PR refactors the NetworkRequestHelper's networkResponses data struct to use a 1:many relationship between network requests and responses. This is to support more complex use cases that would rely on multiple requests to the same endpoint.

Before After
[TestableNetworkRequest: HttpConnection] [TestableNetworkRequest: [HttpConnection]]

Also adds a new method in the NetworkRequestHelper: removeAllResponses(for networkRequest: NetworkRequest) Which allows the MockNetworkRequest to maintain the 1:1 network request to response behavior via its own methods to set mock network responses.

Question for reviewers

  1. Please let me know if, for the new method removeAllResponses(for:):
    1. Method/parameter name makes sense
    2. Method is required to maintain MockNetworkService's API contract to set 1:1 network request to mock response

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

Checklist:

codecov[bot] commented 1 year ago

Codecov Report

Merging #414 (bb6eb1d) into dev (2053d90) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##              dev     #414   +/-   ##
=======================================
  Coverage   96.77%   96.77%           
=======================================
  Files          27       27           
  Lines        1671     1671           
=======================================
  Hits         1617     1617           
  Misses         54       54