diff --git a/IntegrationTests/README.md b/IntegrationTests/README.md index 5b82ee296..59df768f1 100644 --- a/IntegrationTests/README.md +++ b/IntegrationTests/README.md @@ -10,6 +10,21 @@ Before getting started, install Tuist: brew install tuist ``` +### Environment Variables + +mParticle API credentials are required **only for recording** new API interactions: + +```bash +export MPARTICLE_API_KEY="your-api-key" +export MPARTICLE_API_SECRET="your-api-secret" +``` + +**Recording mode (`run_wiremock_recorder.sh`):** Real API keys are required to record actual API responses from mParticle servers. + +**Verification mode (`run_clean_integration_tests.sh`):** API keys are **optional**. If not set, the tests will automatically use fake keys (`us1-00000000000000000000000000000000`) that match the WireMock URL patterns. This allows running integration tests without exposing real credentials. + +**Note:** Fake keys must match the pattern `us1-[a-f0-9]+` to work with WireMock mappings. + Then generate the Xcode project: ```bash diff --git a/IntegrationTests/Sources/main.swift b/IntegrationTests/Sources/main.swift index 6bcd52432..61db0e9af 100644 --- a/IntegrationTests/Sources/main.swift +++ b/IntegrationTests/Sources/main.swift @@ -7,7 +7,7 @@ class EventUploadWaiter: NSObject, MPListenerProtocol { var mparticle = MParticle.sharedInstance() @discardableResult - func wait(timeout: Int = 10) -> Bool { + func wait(timeout: Int = 5) -> Bool { mparticle.upload() let semaphore = DispatchSemaphore(value: 0) uploadCompletedSemaphore = semaphore @@ -39,7 +39,7 @@ func testSimpleEvent(mparticle: MParticle, uploadWaiter: EventUploadWaiter) { } // Test 2: Log Event with Custom Attributes and Custom Flags -// Based on ViewController.m logEvent method (lines 131-147) +// Based on ViewController.m logEvent method func testEventWithCustomAttributesAndFlags(mparticle: MParticle, uploadWaiter: EventUploadWaiter) { let event = MPEvent(name: "Event Name", type: .transaction) @@ -69,14 +69,14 @@ func testEventWithCustomAttributesAndFlags(mparticle: MParticle, uploadWaiter: E } // Test 3: Log Screen -// Based on ViewController.m logScreen method (lines 149-151) +// Based on ViewController.m logScreen method func testLogScreen(mparticle: MParticle, uploadWaiter: EventUploadWaiter) { mparticle.logScreen("Home Screen", eventInfo: nil) uploadWaiter.wait() } // Test 4: Log Commerce Event with Product and Transaction -// Based on ViewController.m logCommerceEvent method (lines 153-180) +// Based on ViewController.m logCommerceEvent method func testCommerceEvent(mparticle: MParticle, uploadWaiter: EventUploadWaiter) { let product = MPProduct( name: "Awesome Book", @@ -112,7 +112,7 @@ func testCommerceEvent(mparticle: MParticle, uploadWaiter: EventUploadWaiter) { } // Test 5: Rokt Select Overlay Placement -// Based on ViewController.m selectOverlayPlacement method (lines 182-192) +// Based on ViewController.m selectOverlayPlacement method // Tests Rokt SDK integration through mParticle for selecting placements with custom attributes func testRoktSelectPlacement(mparticle: MParticle, uploadWaiter: EventUploadWaiter) { let roktAttributes: [String: String] = [ @@ -128,9 +128,311 @@ func testRoktSelectPlacement(mparticle: MParticle, uploadWaiter: EventUploadWait uploadWaiter.wait() } +// Test 6: Get User Audiences +// Based on ViewController.m getAudience method +// Tests retrieving audience memberships for the current user via Identity API +func testGetUserAudiences(mparticle: MParticle) { + let semaphore = DispatchSemaphore(value: 0) + + // Get audiences for current user + if let currentUser = mparticle.identity.currentUser { + currentUser.getAudiencesWithCompletionHandler { audiences, error in + if let error = error { + print("Failed to retrieve Audience: \(error)") + } else { + print("Successfully retrieved Audience for user: \(currentUser.userId) with audiences: \(audiences)") + } + semaphore.signal() + } + } else { + print("No current user available") + semaphore.signal() + } + + // Wait for async completion (timeout 10 seconds) + let timeout = DispatchTime.now() + .seconds(10) + let result = semaphore.wait(timeout: timeout) + + if result == .timedOut { + print("Warning: getAudiencesWithCompletionHandler timed out") + } +} + +// Test 7: Log Timed Event +// Based on ViewController.m logTimedEvent method +// Tests logging timed events - begins a timed event, waits a fixed duration, then ends it +func testLogTimedEvent(mparticle: MParticle, uploadWaiter: EventUploadWaiter) { + // Begin a timed event + let eventName = "Timed Event" + let timedEvent = MPEvent(name: eventName, type: .transaction) + + if let event = timedEvent { + mparticle.beginTimedEvent(event) + + // Use fixed delay instead of random (required for deterministic testing) + // Original code uses arc4random_uniform(4000.0) / 1000.0 + 1.0 which is 1-5 seconds + // We use fixed 2 seconds for consistent test behavior + sleep(2) + + // Retrieve the timed event by name and end it + if let retrievedTimedEvent = mparticle.event(withName: eventName) { + mparticle.endTimedEvent(retrievedTimedEvent) + } + } + + uploadWaiter.wait() +} + +// Test 8: Log Error +// Based on ViewController.m logError method +// Tests logging errors with custom event info dictionary +func testLogError(mparticle: MParticle, uploadWaiter: EventUploadWaiter) { + // Log an error with event info - exactly as in ViewController.m + let eventInfo = ["cause": "slippery floor"] + mparticle.logError("Oops", eventInfo: eventInfo) + + uploadWaiter.wait() +} + +// Test 9: Log Exception +// Based on ViewController.m logException method +// Tests logging NSException with topmost context information +func testLogException(mparticle: MParticle, uploadWaiter: EventUploadWaiter) { + // Create an NSException similar to the one caught in ViewController.m + // The original code tries to invoke a non-existing method which throws NSException + let exception = NSException( + name: NSExceptionName(rawValue: "NSInvalidArgumentException"), + reason: "-[ViewController someMethodThatDoesNotExist]: unrecognized selector sent to instance", + userInfo: nil + ) + + // Log the exception - mParticle SDK will capture exception details + // Note: topmostContext parameter is not available in Swift API, + // so we use the simpler logException method + mparticle.logException(exception) + + uploadWaiter.wait() +} + +// Test 10: Set User Attributes +// Based on ViewController.m setUserAttribute method +// Tests setting predefined and custom user attributes on the current user +func testSetUserAttributes(mparticle: MParticle, uploadWaiter: EventUploadWaiter) { + guard let currentUser = mparticle.identity.currentUser else { + print("No current user available") + return + } + + // Set 'Age' as a user attribute using predefined mParticle constant + // Using static value instead of random for deterministic testing + let age = "45" // Original: 21 + arc4random_uniform(80) + currentUser.setUserAttribute(mParticleUserAttributeAge, value: age) + + // Set 'Gender' as a user attribute using predefined mParticle constant + // Using static value instead of random for deterministic testing + let gender = "m" // Original: arc4random_uniform(2) ? "m" : "f" + currentUser.setUserAttribute(mParticleUserAttributeGender, value: gender) + + // Set a numeric user attribute using a custom key + currentUser.setUserAttribute("Achieved Level", value: 4) + + uploadWaiter.wait() +} + +// Test 11: Increment User Attribute +// Based on ViewController.m incrementUserAttribute method +// Tests incrementing a numeric user attribute by a specified value +func testIncrementUserAttribute(mparticle: MParticle, uploadWaiter: EventUploadWaiter) { + guard let currentUser = mparticle.identity.currentUser else { + print("No current user available") + return + } + + // First, set an initial value for the attribute to ensure it exists + // Using static value 10 for deterministic testing + currentUser.setUserAttribute("Achieved Level", value: 10) + + // Wait for the initial set to be uploaded + uploadWaiter.wait() + + // Now increment the attribute by 1 - exactly as in ViewController.m + currentUser.incrementUserAttribute("Achieved Level", byValue: NSNumber(value: 1)) + + // Wait for the increment to be uploaded + uploadWaiter.wait() +} + +// Test 12: Set Session Attribute +// Based on ViewController.m setSessionAttribute method +// Tests setting a session attribute - session attributes are sent when session ends +func testSetSessionAttribute(mparticle: MParticle, uploadWaiter: EventUploadWaiter) { + // Set a session attribute - this will be included in the session end message + mparticle.setSessionAttribute("Station", value: "Classic Rock") + + // End the session to trigger sending the session attribute + // Session attributes are sent in the session end message (dt: "se") + mparticle.endSession() + + uploadWaiter.wait() +} + +// Test 13: Increment Session Attribute +// Based on ViewController.m incrementSessionAttribute method (lines 348-351) +// Tests incrementing a numeric session attribute - session attributes are sent when session ends +func testIncrementSessionAttribute(mparticle: MParticle, uploadWaiter: EventUploadWaiter) { + // Start a new session since the previous test ended the session + mparticle.beginSession() + + // Allow time for session to be created + sleep(1) + + // First set an initial numeric value for the session attribute + mparticle.setSessionAttribute("Song Count", value: 5) + + // Increment the session attribute by 1 - exactly as in ViewController.m + mparticle.incrementSessionAttribute("Song Count", byValue: 1) + + // End the session to trigger sending the session attribute + // Session attributes are sent in the session end message (dt: "se") + mparticle.endSession() + + uploadWaiter.wait() +} + +// Test 14: Toggle CCPA Consent +// Based on ViewController.m toggleCCPAConsent method (lines 357-386) +// Tests setting CCPA consent state on the current user and verifying it's transmitted +func testToggleCCPAConsent(mparticle: MParticle, uploadWaiter: EventUploadWaiter) { + guard let currentUser = mparticle.identity.currentUser else { + print("No current user available") + return + } + + // Use static timestamp for deterministic testing + let staticTimestamp = Date(timeIntervalSince1970: 1700000000) // Fixed timestamp: 2023-11-14 22:13:20 UTC + + // Create CCPA consent with consented = YES + let ccpaConsent = MPCCPAConsent() + ccpaConsent.consented = true + ccpaConsent.document = "ccpa_consent_agreement_v3" + ccpaConsent.timestamp = staticTimestamp + ccpaConsent.location = "17 Cherry Tree Lane" + ccpaConsent.hardwareId = "IDFA:a5d934n0-232f-4afc-2e9a-3832d95zc702" + + // Create new consent state and set CCPA consent + let newConsentState = MPConsentState() + newConsentState.setCCPA(ccpaConsent) + + // Preserve existing GDPR consent state if any + if let existingGDPR = currentUser.consentState()?.gdprConsentState() { + newConsentState.setGDPR(existingGDPR) + } + + // Set consent state on current user + currentUser.setConsentState(newConsentState) + + // Log an event to trigger upload that includes the CCPA consent state + // The consent state is included in the request body ("con" field) with event uploads + mparticle.logEvent("CCPA Consent Updated", eventType: .other, eventInfo: ["consent_status": "opted_in"]) + + uploadWaiter.wait() +} + +// Test 15: Toggle GDPR Consent +// Based on ViewController.m toggleGDPRConsent method (lines 388-416) +// Tests setting GDPR consent state on the current user and verifying it's transmitted +func testToggleGDPRConsent(mparticle: MParticle, uploadWaiter: EventUploadWaiter) { + guard let currentUser = mparticle.identity.currentUser else { + print("No current user available") + return + } + + // Use static timestamp for deterministic testing + let staticTimestamp = Date(timeIntervalSince1970: 1700000000) // Fixed timestamp: 2023-11-14 22:13:20 UTC + + // Create GDPR consent with consented = YES (testing the "else" branch from ViewController.m) + let gdprConsent = MPGDPRConsent() + gdprConsent.consented = true + gdprConsent.document = "location_collection_agreement_v4" + gdprConsent.timestamp = staticTimestamp + gdprConsent.location = "17 Cherry Tree Lane" + gdprConsent.hardwareId = "IDFA:a5d934n0-232f-4afc-2e9a-3832d95zc702" + + // Create new consent state and add GDPR consent with purpose + let newConsentState = MPConsentState() + newConsentState.addGDPRConsentState(gdprConsent, purpose: "My GDPR Purpose") + + // Preserve existing CCPA consent state if any + if let existingCCPA = currentUser.consentState()?.ccpaConsentState() { + newConsentState.setCCPA(existingCCPA) + } + + // Set consent state on current user + currentUser.setConsentState(newConsentState) + + // Log an event to trigger upload that includes the GDPR consent state + // The consent state is included in the request body ("con" field) with event uploads + mparticle.logEvent("GDPR Consent Updated", eventType: .other, eventInfo: ["consent_status": "opted_in"]) + + uploadWaiter.wait() +} + +// Test 16: Log IDFA (iOS Advertiser ID) +// Based on ViewController.m logIDFA method (lines 418-429) +// Tests modifying user identity to add/update the iOS Advertiser ID via Identity API +func testLogIDFA(mparticle: MParticle, uploadWaiter: EventUploadWaiter) { + // Get current user from identity API + guard let currentUser = mparticle.identity.currentUser else { + print("No current user available") + return + } + + // Create identity request with current user + let identityRequest = MPIdentityApiRequest(user: currentUser) + + // Use static IDFA for deterministic testing + // Format: UUID-style string typical for iOS Advertiser IDs + let staticIDFA = "A5D934N0-232F-4AFC-2E9A-3832D95ZC702" + + // Set the iOS Advertiser ID identity + identityRequest.setIdentity(staticIDFA, identityType: MPIdentity.iosAdvertiserId) + + // Modify the user identity + mparticle.identity.modify(identityRequest) { _, _ in } + + uploadWaiter.wait() +} + +// Test 17: Set ATT Status (App Tracking Transparency) +// Based on ViewController.m requestIDFA method (lines 431-476) +// Tests setting the ATT authorization status which is sent with device info on uploads +func testSetATTStatus(mparticle: MParticle, uploadWaiter: EventUploadWaiter) { + // Use static timestamp in milliseconds for deterministic testing + let staticTimestampMillis = NSNumber(value: 1700000000000) // Fixed timestamp: 2023-11-14 22:13:20 UTC in milliseconds + + // Set ATT status to Authorized (simulating user granting tracking permission) + // This corresponds to the ATTrackingManagerAuthorizationStatusAuthorized case in ViewController.m + mparticle.setATTStatus(MPATTAuthorizationStatus.authorized, withATTStatusTimestampMillis: staticTimestampMillis) + + // Log an event to trigger upload that includes the ATT status in device info + // ATT status is sent in the "att" field within device_info ("di") section + mparticle.logEvent("ATT Status Updated", eventType: .other, eventInfo: ["att_status": "authorized"]) + + uploadWaiter.wait() +} + +// Read API key and secret from environment variables, or use fake keys for verification mode +// Fake keys must match the pattern us1-[a-f0-9]+ to work with WireMock mappings +let apiKey = ProcessInfo.processInfo.environment["MPARTICLE_API_KEY"] ?? "us1-00000000000000000000000000000000" +let apiSecret = ProcessInfo.processInfo.environment["MPARTICLE_API_SECRET"] ?? "fake-secret-for-integration-tests" + +if ProcessInfo.processInfo.environment["MPARTICLE_API_KEY"] == nil { + print("⚠️ MPARTICLE_API_KEY not set, using fake key for verification mode") +} + var options = MParticleOptions( - key: "", - secret: "" + key: apiKey, + secret: apiSecret ) var identityRequest = MPIdentityApiRequest.withEmptyUser() @@ -167,4 +469,16 @@ testSimpleEvent(mparticle: mparticle, uploadWaiter: uploadWaiter) testEventWithCustomAttributesAndFlags(mparticle: mparticle, uploadWaiter: uploadWaiter) testLogScreen(mparticle: mparticle, uploadWaiter: uploadWaiter) testCommerceEvent(mparticle: mparticle, uploadWaiter: uploadWaiter) -testRoktSelectPlacement(mparticle: mparticle, uploadWaiter: uploadWaiter) \ No newline at end of file +testRoktSelectPlacement(mparticle: mparticle, uploadWaiter: uploadWaiter) +testGetUserAudiences(mparticle: mparticle) +testLogTimedEvent(mparticle: mparticle, uploadWaiter: uploadWaiter) +testLogError(mparticle: mparticle, uploadWaiter: uploadWaiter) +testLogException(mparticle: mparticle, uploadWaiter: uploadWaiter) +testSetUserAttributes(mparticle: mparticle, uploadWaiter: uploadWaiter) +testIncrementUserAttribute(mparticle: mparticle, uploadWaiter: uploadWaiter) +testSetSessionAttribute(mparticle: mparticle, uploadWaiter: uploadWaiter) +testIncrementSessionAttribute(mparticle: mparticle, uploadWaiter: uploadWaiter) +testToggleCCPAConsent(mparticle: mparticle, uploadWaiter: uploadWaiter) +testToggleGDPRConsent(mparticle: mparticle, uploadWaiter: uploadWaiter) +testLogIDFA(mparticle: mparticle, uploadWaiter: uploadWaiter) +testSetATTStatus(mparticle: mparticle, uploadWaiter: uploadWaiter) \ No newline at end of file diff --git a/IntegrationTests/common.sh b/IntegrationTests/common.sh index 685ade8d2..faf10be8c 100755 --- a/IntegrationTests/common.sh +++ b/IntegrationTests/common.sh @@ -158,6 +158,18 @@ install_application() { launch_application() { echo "▶️ Launching application..." + + # Launch with environment variables using SIMCTL_CHILD_ prefix + # If not set, the app will use fake keys for verification mode + local launch_cmd="xcrun simctl launch \"$DEVICE_ID\" \"$BUNDLE_ID\"" + + if [ -n "$MPARTICLE_API_KEY" ]; then + export SIMCTL_CHILD_MPARTICLE_API_KEY="$MPARTICLE_API_KEY" + fi + if [ -n "$MPARTICLE_API_SECRET" ]; then + export SIMCTL_CHILD_MPARTICLE_API_SECRET="$MPARTICLE_API_SECRET" + fi + LAUNCH_OUTPUT=$(xcrun simctl launch "$DEVICE_ID" "$BUNDLE_ID") APP_PID=$(echo "$LAUNCH_OUTPUT" | awk -F': ' '{print $2}') @@ -171,7 +183,7 @@ launch_application() { wait_for_app_completion() { echo "⏳ Waiting for app to complete execution..." - local MAX_WAIT=60 + local MAX_WAIT=120 local WAIT_COUNT=0 while kill -0 "$APP_PID" 2>/dev/null; do sleep 1 @@ -262,3 +274,47 @@ stop_wiremock_with_logs() { stop_wiremock } +create_proxy_mappings() { + echo "📝 Creating proxy mappings for recording mode..." + + local PROXY_DIR="${MAPPINGS_DIR}/mappings" + mkdir -p "$PROXY_DIR" + + # Create proxy-identify.json + cat > "${PROXY_DIR}/proxy-identify.json" << 'EOF' +{ + "priority": 1, + "request": { + "urlPathPattern": "/v1/identify" + }, + "response": { + "proxyBaseUrl": "https://identity.mparticle.com" + } +} +EOF + + # Create proxy-events.json + cat > "${PROXY_DIR}/proxy-events.json" << 'EOF' +{ + "priority": 1, + "request": { + "urlPathPattern": "/v2/events" + }, + "response": { + "proxyBaseUrl": "https://nativesdks.mparticle.com" + } +} +EOF + + echo "✅ Proxy mappings created" +} + +remove_proxy_mappings() { + echo "🗑️ Removing proxy mappings for verification mode..." + + rm -f "${MAPPINGS_DIR}/mappings/proxy-identify.json" 2>/dev/null || true + rm -f "${MAPPINGS_DIR}/mappings/proxy-events.json" 2>/dev/null || true + + echo "✅ Proxy mappings removed" +} + diff --git a/IntegrationTests/run_clean_integration_tests.sh b/IntegrationTests/run_clean_integration_tests.sh index b087a5078..a851e8953 100755 --- a/IntegrationTests/run_clean_integration_tests.sh +++ b/IntegrationTests/run_clean_integration_tests.sh @@ -167,6 +167,7 @@ find_app_path reset_simulators find_available_device find_device +remove_proxy_mappings escape_mapping_bodies start_wiremock "verify" wait_for_wiremock diff --git a/IntegrationTests/run_wiremock_recorder.sh b/IntegrationTests/run_wiremock_recorder.sh index d17c8358b..2551c85e4 100755 --- a/IntegrationTests/run_wiremock_recorder.sh +++ b/IntegrationTests/run_wiremock_recorder.sh @@ -10,6 +10,13 @@ TARGET_URL=${4:-"https://config2.mparticle.com"} SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${SCRIPT_DIR}/common.sh" +# === Check required environment variables for recording === +if [ -z "$MPARTICLE_API_KEY" ] || [ -z "$MPARTICLE_API_SECRET" ]; then + echo "❌ Error: MPARTICLE_API_KEY and MPARTICLE_API_SECRET environment variables must be set for recording mode" + echo " Real API keys are required to record actual API responses from mParticle servers" + exit 1 +fi + # === Build framework and generate project === build_framework @@ -23,6 +30,9 @@ CONTAINER_NAME="wiremock-recorder" mkdir -p "${MAPPINGS_DIR}/mappings" mkdir -p "${MAPPINGS_DIR}/__files" +# Create proxy mappings for recording +create_proxy_mappings + # Trap to ensure cleanup on exit trap stop_wiremock EXIT INT TERM diff --git a/IntegrationTests/transform_mapping_body.py b/IntegrationTests/transform_mapping_body.py index 15e454e98..34dd26a39 100644 --- a/IntegrationTests/transform_mapping_body.py +++ b/IntegrationTests/transform_mapping_body.py @@ -41,8 +41,10 @@ 'dlc', # Device Locale 'dn', # Device Name 'dosv', # Device OS Version + 'el', # Event Length (duration in milliseconds for timed events) 'en', # Event Number (position in session, e.g., 0, 1, 2...) 'est', # Event Start Time + 'iba', # Instruction Base Address (memory address for errors) 'ict', # Init Config Time 'id', # ID (various message/event IDs) 'lud', # Last Update Date diff --git a/IntegrationTests/wiremock-recordings/__files/body-ccpa-consent.json b/IntegrationTests/wiremock-recordings/__files/body-ccpa-consent.json new file mode 100644 index 000000000..6f02bf774 --- /dev/null +++ b/IntegrationTests/wiremock-recordings/__files/body-ccpa-consent.json @@ -0,0 +1 @@ +{"dt":"rh","id":"e3d7fc9b-15d2-4109-b90b-1dc892641c97","ct":1764796657912,"msgs":[],"ci":{"mpid":6504934091054997508,"ck":{"uid":{"c":"g=7f6d2e60-d81a-4edf-a5d6-996c6f15fa70","e":"2035-11-04T19:37:06.7933933Z"}},"das":"7f6d2e60-d81a-4edf-a5d6-996c6f15fa70"}} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/__files/body-gdpr-consent.json b/IntegrationTests/wiremock-recordings/__files/body-gdpr-consent.json new file mode 100644 index 000000000..89c9ec2e2 --- /dev/null +++ b/IntegrationTests/wiremock-recordings/__files/body-gdpr-consent.json @@ -0,0 +1 @@ +{"dt":"rh","id":"a7c8f4d7-aeb2-4f55-91e5-91a267afc382","ct":1764858535905,"err":[{"dt":"err","id":"92e1921b-09d0-434c-a3ef-0484baa5c2c3","ct":1764858535905,"msg":"Invalid Consent State provided - please verify the Consent Purposes that you have defined for this workspace.","code":"invalid_consent"}]} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/__files/body-get-user-audiences.json b/IntegrationTests/wiremock-recordings/__files/body-get-user-audiences.json new file mode 100644 index 000000000..9db7b1d17 --- /dev/null +++ b/IntegrationTests/wiremock-recordings/__files/body-get-user-audiences.json @@ -0,0 +1 @@ +{"audience_memberships":[{"audience_id":12345,"audience_name":"Test Audience 1"},{"audience_id":67890,"audience_name":"Test Audience 2"}]} diff --git a/IntegrationTests/wiremock-recordings/__files/body-increment-session-attribute-ss.json b/IntegrationTests/wiremock-recordings/__files/body-increment-session-attribute-ss.json new file mode 100644 index 000000000..1cb596e9b --- /dev/null +++ b/IntegrationTests/wiremock-recordings/__files/body-increment-session-attribute-ss.json @@ -0,0 +1 @@ +{"dt":"rh","id":"71a50897-9ff8-4b56-9a73-9ff4281cf33a","ct":1764789344543,"msgs":[],"ci":{"mpid":6504934091054997508,"ck":{"uid":{"c":"g=a6af0b2e-86ae-4d5f-a0d2-2e5d6d71fcb4","e":"2035-11-04T19:37:06.7933933Z"}},"das":"a6af0b2e-86ae-4d5f-a0d2-2e5d6d71fcb4"}} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/__files/body-increment-session-attribute.json b/IntegrationTests/wiremock-recordings/__files/body-increment-session-attribute.json new file mode 100644 index 000000000..19c72698f --- /dev/null +++ b/IntegrationTests/wiremock-recordings/__files/body-increment-session-attribute.json @@ -0,0 +1 @@ +{"dt":"rh","id":"a177f742-06d8-49f7-a8e3-87ef73107560","ct":1764789344635,"msgs":[],"ci":{"mpid":6504934091054997508,"ck":{"uid":{"c":"g=a6af0b2e-86ae-4d5f-a0d2-2e5d6d71fcb4","e":"2035-11-04T19:37:06.7933933Z"}},"das":"a6af0b2e-86ae-4d5f-a0d2-2e5d6d71fcb4"}} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/__files/body-increment-user-attribute-set.json b/IntegrationTests/wiremock-recordings/__files/body-increment-user-attribute-set.json new file mode 100644 index 000000000..039dc176a --- /dev/null +++ b/IntegrationTests/wiremock-recordings/__files/body-increment-user-attribute-set.json @@ -0,0 +1 @@ +{"dt":"rh","id":"109b9248-c587-4f3e-8bcc-f2b294707b6c","ct":1764620922698,"msgs":[],"ci":{"mpid":6504934091054997508,"ck":{"uid":{"c":"g=0b876fb7-59a2-4b88-94c7-0ad23ca58452","e":"2035-11-04T19:37:06.7933933Z"}},"das":"0b876fb7-59a2-4b88-94c7-0ad23ca58452"}} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/__files/body-increment-user-attribute.json b/IntegrationTests/wiremock-recordings/__files/body-increment-user-attribute.json new file mode 100644 index 000000000..6a4a4b124 --- /dev/null +++ b/IntegrationTests/wiremock-recordings/__files/body-increment-user-attribute.json @@ -0,0 +1 @@ +{"dt":"rh","id":"5943ab4c-eeab-48c6-9a8c-9432e7d4f6ae","ct":1764620932703,"msgs":[],"ci":{"mpid":6504934091054997508,"ck":{"uid":{"c":"g=0b876fb7-59a2-4b88-94c7-0ad23ca58452","e":"2035-11-04T19:37:06.7933933Z"}},"das":"0b876fb7-59a2-4b88-94c7-0ad23ca58452"}} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/__files/body-log-error.json b/IntegrationTests/wiremock-recordings/__files/body-log-error.json new file mode 100644 index 000000000..5067b9b6a --- /dev/null +++ b/IntegrationTests/wiremock-recordings/__files/body-log-error.json @@ -0,0 +1 @@ +{"dt":"rh","id":"62c9bed1-e59c-488f-b30c-f06990223c73","ct":1764611788151,"msgs":[],"ci":{"mpid":6504934091054997508,"ck":{"uid":{"c":"g=cf0a8016-279b-4933-88e5-0644e88ff82c","e":"2035-11-04T19:37:06.7933933Z"}},"das":"cf0a8016-279b-4933-88e5-0644e88ff82c"}} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/__files/body-log-exception.json b/IntegrationTests/wiremock-recordings/__files/body-log-exception.json new file mode 100644 index 000000000..6692c5a28 --- /dev/null +++ b/IntegrationTests/wiremock-recordings/__files/body-log-exception.json @@ -0,0 +1 @@ +{"dt":"rh","id":"99323d4a-48fa-410f-91df-f8165d1be676","ct":1764613212857,"msgs":[],"ci":{"mpid":6504934091054997508,"ck":{"uid":{"c":"g=3b8cc9d7-af48-43db-8e15-ebff948f6020","e":"2035-11-04T19:37:06.7933933Z"}},"das":"3b8cc9d7-af48-43db-8e15-ebff948f6020"}} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/__files/body-log-idfa.txt b/IntegrationTests/wiremock-recordings/__files/body-log-idfa.txt new file mode 100644 index 000000000..e69de29bb diff --git a/IntegrationTests/wiremock-recordings/__files/body-rokt-identify.json b/IntegrationTests/wiremock-recordings/__files/body-rokt-identify.json new file mode 100644 index 000000000..0ef4e9618 --- /dev/null +++ b/IntegrationTests/wiremock-recordings/__files/body-rokt-identify.json @@ -0,0 +1 @@ +{"context":null,"matched_identities":{"customerid":"123456","email":"j.smit@example.com"},"is_ephemeral":false,"mpid":"6504934091054997508","is_logged_in":true} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/__files/body-set-att-status.json b/IntegrationTests/wiremock-recordings/__files/body-set-att-status.json new file mode 100644 index 000000000..70eb13382 --- /dev/null +++ b/IntegrationTests/wiremock-recordings/__files/body-set-att-status.json @@ -0,0 +1 @@ +{"dt":"rh","id":"845193e5-1f2e-4d0b-8062-685272884982","ct":1764865609530,"err":[{"dt":"err","id":"e00cc073-74b0-4434-ae09-037e4ce2b553","ct":1764865609531,"msg":"Invalid Consent State provided - please verify the Consent Purposes that you have defined for this workspace.","code":"invalid_consent"}]} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/__files/body-set-session-attribute.json b/IntegrationTests/wiremock-recordings/__files/body-set-session-attribute.json new file mode 100644 index 000000000..47939ad9a --- /dev/null +++ b/IntegrationTests/wiremock-recordings/__files/body-set-session-attribute.json @@ -0,0 +1 @@ +{"dt":"rh","id":"4a60510e-7407-4aac-90c2-4f8dba92c78e","ct":1764773430070,"msgs":[],"ci":{"mpid":6504934091054997508,"ck":{"uid":{"c":"g=729f918a-e41a-48f1-9ac9-ec0e762e9963","e":"2035-11-04T19:37:06.7933933Z"}},"das":"729f918a-e41a-48f1-9ac9-ec0e762e9963"}} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/__files/body-set-user-attributes.json b/IntegrationTests/wiremock-recordings/__files/body-set-user-attributes.json new file mode 100644 index 000000000..b6234941c --- /dev/null +++ b/IntegrationTests/wiremock-recordings/__files/body-set-user-attributes.json @@ -0,0 +1 @@ +{"dt":"rh","id":"9182e451-d96e-4e08-b350-6da24ab3f0e7","ct":1764616655403,"msgs":[],"ci":{"mpid":6504934091054997508,"ck":{"uid":{"c":"g=140f02c6-7a15-4c14-92d0-d1dc1532e292","e":"2035-11-04T19:37:06.7933933Z"}},"das":"140f02c6-7a15-4c14-92d0-d1dc1532e292"}} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/__files/body-timed-event.json b/IntegrationTests/wiremock-recordings/__files/body-timed-event.json new file mode 100644 index 000000000..905362fb7 --- /dev/null +++ b/IntegrationTests/wiremock-recordings/__files/body-timed-event.json @@ -0,0 +1 @@ +{"dt":"rh","id":"283eb295-b5a3-42ea-8463-783756145b93","ct":1764605104156,"msgs":[],"ci":{"mpid":6504934091054997508,"ck":{"uid":{"c":"g=bc7ddd85-f6cd-4739-9852-faaa18237c16","e":"2035-11-04T19:37:06.7933933Z"}},"das":"bc7ddd85-f6cd-4739-9852-faaa18237c16"}} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/__files/body-v4-us1-get-config-response.json b/IntegrationTests/wiremock-recordings/__files/body-v4-us1-get-config-response.json index d08166328..a69b7dd09 100644 --- a/IntegrationTests/wiremock-recordings/__files/body-v4-us1-get-config-response.json +++ b/IntegrationTests/wiremock-recordings/__files/body-v4-us1-get-config-response.json @@ -1 +1 @@ -{"dt":"ac","id":"03fcd379-b420-43a3-9004-c7bb821e0495","ct":1762457821105,"dbg":false,"cue":"appdefined","pmk":["mp_message","com.urbanairship.push.ALERT","alert","a","message","lp_message","gcm.notification.body"],"cnp":"appdefined","soc":0,"oo":false,"lsv":"6.13.0","rdlat":true,"inhd":false,"iasr":false,"wst":"D38F29DF","amw":90,"crml":1024000,"dur":false,"flags":{"AudienceAPI":"False"},"atos":0,"pio":30} \ No newline at end of file +{"dt":"ac","id":"03fcd379-b420-43a3-9004-c7bb821e0495","ct":1762457821105,"dbg":false,"cue":"appdefined","pmk":["mp_message","com.urbanairship.push.ALERT","alert","a","message","lp_message","gcm.notification.body"],"cnp":"appdefined","soc":0,"oo":false,"lsv":"6.13.0","rdlat":true,"inhd":false,"iasr":false,"wst":"D38F29DF","amw":90,"crml":1024000,"dur":false,"flags":{"AudienceAPI":"True"},"atos":0,"pio":30} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/mappings/mapping-ccpa-consent.json b/IntegrationTests/wiremock-recordings/mappings/mapping-ccpa-consent.json new file mode 100644 index 000000000..9624489c0 --- /dev/null +++ b/IntegrationTests/wiremock-recordings/mappings/mapping-ccpa-consent.json @@ -0,0 +1,141 @@ +{ + "id": "dfb0699f-cad2-32c6-a80f-6cc849905de0", + "request": { + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": { + "id": "${json-unit.ignore}", + "ltv": 0, + "msgs": [ + { + "dt": "ss", + "id": "${json-unit.ignore}", + "ct": "${json-unit.ignore}", + "pss": "${json-unit.ignore}", + "psl": 0, + "mt": false, + "vc": "off_thread", + "pid": "${json-unit.ignore}" + }, + { + "et": "Other", + "id": "${json-unit.ignore}", + "vc": "off_thread", + "dt": "e", + "el": "${json-unit.ignore}", + "ct": "${json-unit.ignore}", + "attrs": { + "consent_status": "opted_in" + }, + "sct": "${json-unit.ignore}", + "sid": "${json-unit.ignore}", + "en": "${json-unit.ignore}", + "n": "CCPA Consent Updated", + "est": "${json-unit.ignore}", + "mt": false + } + ], + "dt": "h", + "a": "${json-unit.ignore}", + "ai": { + "av": "1.0", + "sideloaded_kits_count": 0, + "bid": "${json-unit.ignore}", + "pir": false, + "fi": true, + "lud": "${json-unit.ignore}", + "arc": "arm64", + "tsv": "90000", + "apn": "com.mparticle.IntegrationTests", + "env": 1, + "abn": "1", + "bsv": "${json-unit.ignore}", + "ict": "${json-unit.ignore}" + }, + "ct": "${json-unit.ignore}", + "ck": "${json-unit.ignore}", + "das": "${json-unit.ignore}", + "mpid": 6504934091054997508, + "ui": [ + { + "i": "123456", + "n": 1 + }, + { + "i": "j.smit@example.com", + "n": 7 + } + ], + "uitl": 60, + "oo": false, + "sdk": "8.40.0", + "di": { + "p": "arm64", + "tz": "-5", + "bid": "${json-unit.ignore}", + "dn": "${json-unit.ignore}", + "dll": "en", + "dma": "Apple", + "dsh": "1440", + "idst": false, + "vid": "${json-unit.ignore}", + "dlc": "${json-unit.ignore}", + "tzn": "America/New_York", + "dp": "iOS", + "dsw": "960", + "dosv": "${json-unit.ignore}", + "it": false, + "dr": "None", + "dmdl": "arm64", + "jb": { + "cydia": false + }, + "lat": false, + "arc": "arm64e", + "b": "arm64" + }, + "ua": { + "$Age": "45", + "$Gender": "m", + "Achieved Level": "11" + }, + "con": { + "ccpa": { + "data_sale_opt_out": { + "d": "ccpa_consent_agreement_v3", + "ts": 1700000000000, + "l": "17 Cherry Tree Lane", + "c": true, + "h": "IDFA:a5d934n0-232f-4afc-2e9a-3832d95zc702" + } + } + }, + "stl": 60 + }, + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ], + "urlPattern": "/v2/us1-[a-f0-9]+/events" + }, + "response": { + "status": 202, + "bodyFileName": "body-ccpa-consent.json", + "headers": { + "X-Cache": "MISS, MISS", + "X-MP-Trace-Id": "6930a8f1ecf5194d379cd641e80ae902", + "Server": "Kestrel", + "X-Origin-Name": "fastlyshield--shield_ssl_cache_iad_kcgs7200038_IAD", + "Date": "Wed, 03 Dec 2025 21:17:37 GMT", + "X-Timer": "S1764796658.870805,VS0,VE47", + "Via": "1.1 varnish, 1.1 varnish", + "Accept-Ranges": "bytes", + "X-Served-By": "cache-iad-kcgs7200038-IAD, cache-lga21937-LGA", + "Vary": "Accept-Encoding", + "X-Cache-Hits": "0, 0", + "Content-Type": "application/json" + } + }, + "uuid": "dfb0699f-cad2-32c6-a80f-6cc849905de0" +} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/mappings/mapping-gdpr-consent.json b/IntegrationTests/wiremock-recordings/mappings/mapping-gdpr-consent.json new file mode 100644 index 000000000..5ab1fb4e7 --- /dev/null +++ b/IntegrationTests/wiremock-recordings/mappings/mapping-gdpr-consent.json @@ -0,0 +1,139 @@ +{ + "id": "d105cc90-17aa-3b74-8c01-59f49db347cb", + "request": { + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": { + "id": "${json-unit.ignore}", + "ltv": 0, + "msgs": [ + { + "et": "Other", + "id": "${json-unit.ignore}", + "vc": "off_thread", + "dt": "e", + "el": "${json-unit.ignore}", + "ct": "${json-unit.ignore}", + "attrs": { + "consent_status": "opted_in" + }, + "sct": "${json-unit.ignore}", + "sid": "${json-unit.ignore}", + "en": "${json-unit.ignore}", + "n": "GDPR Consent Updated", + "est": "${json-unit.ignore}", + "mt": false + } + ], + "dt": "h", + "a": "${json-unit.ignore}", + "ai": { + "av": "1.0", + "sideloaded_kits_count": 0, + "bid": "${json-unit.ignore}", + "pir": false, + "fi": true, + "lud": "${json-unit.ignore}", + "arc": "arm64", + "tsv": "90000", + "apn": "com.mparticle.IntegrationTests", + "env": 1, + "abn": "1", + "bsv": "${json-unit.ignore}", + "ict": "${json-unit.ignore}" + }, + "ct": "${json-unit.ignore}", + "ck": "${json-unit.ignore}", + "das": "${json-unit.ignore}", + "mpid": 6504934091054997508, + "ui": [ + { + "i": "123456", + "n": 1 + }, + { + "i": "j.smit@example.com", + "n": 7 + } + ], + "uitl": 60, + "oo": false, + "sdk": "8.40.0", + "di": { + "tz": "-5", + "p": "arm64", + "bid": "${json-unit.ignore}", + "dn": "${json-unit.ignore}", + "dll": "en", + "dsh": "1440", + "dma": "Apple", + "idst": false, + "vid": "${json-unit.ignore}", + "dlc": "${json-unit.ignore}", + "dp": "iOS", + "tzn": "America/New_York", + "dsw": "960", + "dosv": "${json-unit.ignore}", + "it": false, + "dr": "None", + "dmdl": "arm64", + "jb": { + "cydia": false + }, + "lat": false, + "arc": "arm64e", + "b": "arm64" + }, + "ua": { + "$Age": "45", + "$Gender": "m", + "Achieved Level": "11" + }, + "con": { + "ccpa": { + "data_sale_opt_out": { + "d": "ccpa_consent_agreement_v3", + "ts": 1700000000000, + "l": "17 Cherry Tree Lane", + "c": true, + "h": "IDFA:a5d934n0-232f-4afc-2e9a-3832d95zc702" + } + }, + "gdpr": { + "my gdpr purpose": { + "d": "location_collection_agreement_v4", + "ts": 1700000000000, + "l": "17 Cherry Tree Lane", + "c": true, + "h": "IDFA:a5d934n0-232f-4afc-2e9a-3832d95zc702" + } + } + }, + "stl": 60 + }, + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ], + "urlPattern": "/v2/us1-[a-f0-9]+/events" + }, + "response": { + "status": 400, + "bodyFileName": "body-gdpr-consent.json", + "headers": { + "X-Cache": "MISS, MISS", + "Server": "Kestrel", + "X-Origin-Name": "fastlyshield--shield_ssl_cache_iad_kjyo7100162_IAD", + "Date": "Thu, 04 Dec 2025 14:28:55 GMT", + "X-Timer": "S1764858536.892263,VS0,VE18", + "Via": "1.1 varnish, 1.1 varnish", + "Accept-Ranges": "bytes", + "X-Served-By": "cache-iad-kjyo7100162-IAD, cache-lga21931-LGA", + "Vary": "Accept-Encoding", + "X-Cache-Hits": "0, 0", + "Content-Type": "application/json" + } + }, + "uuid": "d105cc90-17aa-3b74-8c01-59f49db347cb" +} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/mappings/mapping-get-user-audiences.json b/IntegrationTests/wiremock-recordings/mappings/mapping-get-user-audiences.json new file mode 100644 index 000000000..a4aec722d --- /dev/null +++ b/IntegrationTests/wiremock-recordings/mappings/mapping-get-user-audiences.json @@ -0,0 +1,24 @@ +{ + "id": "1185200e-3f83-3ae5-8323-4810b47060cb", + "request": { + "method": "GET", + "urlPattern": "/v1/us1-[a-f0-9]+/audience\\?mpid=[0-9]+" + }, + "response": { + "status": 200, + "bodyFileName": "body-get-user-audiences.json", + "headers": { + "Content-Type": "application/json; charset=utf-8", + "Accept-Ranges": "bytes", + "X-Cache": "MISS, MISS", + "Server": "Kestrel", + "X-Origin-Name": "fastlyshield--shield_ssl_cache_iad_kjyo7100175_IAD", + "X-Served-By": "cache-iad-kjyo7100175-IAD, cache-lga21925-LGA", + "X-Cache-Hits": "0, 0", + "Date": "Mon, 01 Dec 2025 15:33:54 GMT", + "X-Timer": "S1764603234.125633,VS0,VE40", + "Via": "1.1 varnish, 1.1 varnish" + } + }, + "uuid": "1185200e-3f83-3ae5-8323-4810b47060cb" +} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/mappings/mapping-increment-session-attribute-ss.json b/IntegrationTests/wiremock-recordings/mappings/mapping-increment-session-attribute-ss.json new file mode 100644 index 000000000..ca40fc7a1 --- /dev/null +++ b/IntegrationTests/wiremock-recordings/mappings/mapping-increment-session-attribute-ss.json @@ -0,0 +1,113 @@ +{ + "id": "72701c5d-44e6-3a4b-8035-c7bb101b5619", + "request": { + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": { + "id": "${json-unit.ignore}", + "ltv": 0, + "msgs": [ + { + "dt": "ss", + "id": "${json-unit.ignore}", + "ct": "${json-unit.ignore}", + "pss": "${json-unit.ignore}", + "psl": "${json-unit.ignore}", + "mt": false, + "vc": "off_thread", + "pid": "${json-unit.ignore}" + } + ], + "dt": "h", + "a": "${json-unit.ignore}", + "ai": { + "av": "1.0", + "sideloaded_kits_count": 0, + "bid": "${json-unit.ignore}", + "pir": false, + "fi": true, + "lud": "${json-unit.ignore}", + "arc": "arm64", + "tsv": "90000", + "apn": "com.mparticle.IntegrationTests", + "env": 1, + "abn": "1", + "bsv": "${json-unit.ignore}", + "ict": "${json-unit.ignore}" + }, + "ct": "${json-unit.ignore}", + "ck": "${json-unit.ignore}", + "das": "${json-unit.ignore}", + "mpid": 6504934091054997508, + "ui": [ + { + "i": "123456", + "n": 1 + }, + { + "i": "j.smit@example.com", + "n": 7 + } + ], + "uitl": 60, + "oo": false, + "sdk": "8.40.0", + "di": { + "b": "arm64", + "tz": "-5", + "p": "arm64", + "dn": "${json-unit.ignore}", + "dma": "Apple", + "dlc": "${json-unit.ignore}", + "idst": false, + "dsh": "1440", + "vid": "${json-unit.ignore}", + "dll": "en", + "dp": "iOS", + "tzn": "America/New_York", + "dsw": "960", + "dosv": "${json-unit.ignore}", + "it": false, + "dr": "None", + "dmdl": "arm64", + "jb": { + "cydia": false + }, + "lat": false, + "arc": "arm64e", + "bid": "${json-unit.ignore}" + }, + "ua": { + "$Age": "45", + "$Gender": "m", + "Achieved Level": "11" + }, + "stl": 60 + }, + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ], + "urlPattern": "/v2/us1-[a-f0-9]+/events" + }, + "response": { + "status": 202, + "bodyFileName": "body-increment-session-attribute-ss.json", + "headers": { + "X-Cache": "MISS, MISS", + "X-MP-Trace-Id": "69308c60994d559e8855cb8f1ec1c0f4", + "Server": "Kestrel", + "X-Origin-Name": "fastlyshield--shield_ssl_cache_iad_kjyo7100163_IAD", + "Date": "Wed, 03 Dec 2025 19:15:44 GMT", + "X-Timer": "S1764789345.530236,VS0,VE17", + "Via": "1.1 varnish, 1.1 varnish", + "Accept-Ranges": "bytes", + "X-Served-By": "cache-iad-kjyo7100163-IAD, cache-lga21966-LGA", + "Vary": "Accept-Encoding", + "X-Cache-Hits": "0, 0", + "Content-Type": "application/json" + } + }, + "uuid": "72701c5d-44e6-3a4b-8035-c7bb101b5619" +} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/mappings/mapping-increment-session-attribute.json b/IntegrationTests/wiremock-recordings/mappings/mapping-increment-session-attribute.json new file mode 100644 index 000000000..3c9ac8f67 --- /dev/null +++ b/IntegrationTests/wiremock-recordings/mappings/mapping-increment-session-attribute.json @@ -0,0 +1,121 @@ +{ + "id": "6ea418c0-9535-33e1-9eb1-c6a6e9067852", + "request": { + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": { + "id": "${json-unit.ignore}", + "ltv": 0, + "msgs": [ + { + "id": "${json-unit.ignore}", + "smpids": [ + 6504934091054997508 + ], + "vc": "off_thread", + "slx": "${json-unit.ignore}", + "dt": "se", + "ct": "${json-unit.ignore}", + "attrs": { + "Song Count": "6" + }, + "sl": "${json-unit.ignore}", + "sct": "${json-unit.ignore}", + "sid": "${json-unit.ignore}", + "en": "${json-unit.ignore}", + "mt": false + } + ], + "dt": "h", + "a": "${json-unit.ignore}", + "ai": { + "av": "1.0", + "sideloaded_kits_count": 0, + "bid": "${json-unit.ignore}", + "pir": false, + "fi": true, + "lud": "${json-unit.ignore}", + "arc": "arm64", + "tsv": "90000", + "apn": "com.mparticle.IntegrationTests", + "env": 1, + "abn": "1", + "bsv": "${json-unit.ignore}", + "ict": "${json-unit.ignore}" + }, + "ct": "${json-unit.ignore}", + "ck": "${json-unit.ignore}", + "das": "${json-unit.ignore}", + "mpid": 6504934091054997508, + "ui": [ + { + "i": "123456", + "n": 1 + }, + { + "i": "j.smit@example.com", + "n": 7 + } + ], + "uitl": 60, + "oo": false, + "sdk": "8.40.0", + "di": { + "b": "arm64", + "tz": "-5", + "p": "arm64", + "dn": "${json-unit.ignore}", + "dma": "Apple", + "dlc": "${json-unit.ignore}", + "idst": false, + "dsh": "1440", + "vid": "${json-unit.ignore}", + "dll": "en", + "dp": "iOS", + "tzn": "America/New_York", + "dsw": "960", + "dosv": "${json-unit.ignore}", + "it": false, + "dr": "None", + "dmdl": "arm64", + "jb": { + "cydia": false + }, + "lat": false, + "arc": "arm64e", + "bid": "${json-unit.ignore}" + }, + "ua": { + "$Age": "45", + "$Gender": "m", + "Achieved Level": "11" + }, + "stl": 60 + }, + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ], + "urlPattern": "/v2/us1-[a-f0-9]+/events" + }, + "response": { + "status": 202, + "bodyFileName": "body-increment-session-attribute.json", + "headers": { + "X-Cache": "MISS, MISS", + "X-MP-Trace-Id": "69308c60400ecd0cbf06f60286aa0e54", + "Server": "Kestrel", + "X-Origin-Name": "fastlyshield--shield_ssl_cache_iad_kiad7000170_IAD", + "Date": "Wed, 03 Dec 2025 19:15:44 GMT", + "X-Timer": "S1764789345.623117,VS0,VE17", + "Via": "1.1 varnish, 1.1 varnish", + "Accept-Ranges": "bytes", + "X-Served-By": "cache-iad-kiad7000170-IAD, cache-lga21982-LGA", + "Vary": "Accept-Encoding", + "X-Cache-Hits": "0, 0", + "Content-Type": "application/json" + } + }, + "uuid": "6ea418c0-9535-33e1-9eb1-c6a6e9067852" +} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/mappings/mapping-increment-user-attribute-set.json b/IntegrationTests/wiremock-recordings/mappings/mapping-increment-user-attribute-set.json new file mode 100644 index 000000000..d9adbc84c --- /dev/null +++ b/IntegrationTests/wiremock-recordings/mappings/mapping-increment-user-attribute-set.json @@ -0,0 +1,117 @@ +{ + "id": "aed30477-6d91-3f88-a946-64bd4437d64e", + "request": { + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": { + "id": "${json-unit.ignore}", + "ltv": 0, + "msgs": [ + { + "id": "${json-unit.ignore}", + "vc": "off_thread", + "ov": 4, + "dt": "uac", + "ct": "${json-unit.ignore}", + "nv": "10", + "sct": "${json-unit.ignore}", + "d": false, + "sid": "${json-unit.ignore}", + "na": false, + "n": "Achieved Level", + "mt": false + } + ], + "dt": "h", + "a": "${json-unit.ignore}", + "ai": { + "av": "1.0", + "sideloaded_kits_count": 0, + "bid": "${json-unit.ignore}", + "pir": false, + "fi": false, + "lud": "${json-unit.ignore}", + "arc": "arm64", + "tsv": "90000", + "apn": "com.mparticle.IntegrationTests", + "env": 1, + "abn": "1", + "bsv": "${json-unit.ignore}", + "ict": "${json-unit.ignore}" + }, + "ct": "${json-unit.ignore}", + "ck": "${json-unit.ignore}", + "das": "${json-unit.ignore}", + "mpid": 6504934091054997508, + "ui": [ + { + "i": "123456", + "n": 1 + }, + { + "i": "j.smit@example.com", + "n": 7 + } + ], + "uitl": 60, + "oo": false, + "sdk": "8.40.0", + "di": { + "p": "arm64", + "b": "arm64", + "tz": "-5", + "dn": "${json-unit.ignore}", + "dll": "en", + "dsh": "1440", + "idst": false, + "dlc": "${json-unit.ignore}", + "vid": "${json-unit.ignore}", + "dma": "Apple", + "tzn": "America/New_York", + "dp": "iOS", + "dsw": "960", + "dosv": "${json-unit.ignore}", + "it": false, + "dmdl": "arm64", + "dr": "None", + "jb": { + "cydia": false + }, + "lat": false, + "arc": "arm64e", + "bid": "${json-unit.ignore}" + }, + "ua": { + "$Age": "45", + "$Gender": "m", + "Achieved Level": "10" + }, + "stl": 60 + }, + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ], + "urlPattern": "/v2/us1-[a-f0-9]+/events" + }, + "response": { + "status": 202, + "bodyFileName": "body-increment-user-attribute-set.json", + "headers": { + "X-Cache": "MISS, MISS", + "X-MP-Trace-Id": "692dfa7afafc3dd1fdf859faef19f59a", + "Server": "Kestrel", + "X-Origin-Name": "fastlyshield--shield_ssl_cache_iad_kcgs7200037_IAD", + "Date": "Mon, 01 Dec 2025 20:28:42 GMT", + "X-Timer": "S1764620923.692953,VS0,VE10", + "Via": "1.1 varnish, 1.1 varnish", + "Accept-Ranges": "bytes", + "X-Served-By": "cache-iad-kcgs7200037-IAD, cache-lga21991-LGA", + "Vary": "Accept-Encoding", + "X-Cache-Hits": "0, 0", + "Content-Type": "application/json" + } + }, + "uuid": "aed30477-6d91-3f88-a946-64bd4437d64e" +} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/mappings/mapping-increment-user-attribute.json b/IntegrationTests/wiremock-recordings/mappings/mapping-increment-user-attribute.json new file mode 100644 index 000000000..bafb26bda --- /dev/null +++ b/IntegrationTests/wiremock-recordings/mappings/mapping-increment-user-attribute.json @@ -0,0 +1,117 @@ +{ + "id": "50514c8b-0999-3025-917b-445ebbc3c646", + "request": { + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": { + "id": "${json-unit.ignore}", + "ltv": 0, + "msgs": [ + { + "id": "${json-unit.ignore}", + "vc": "off_thread", + "ov": 10, + "dt": "uac", + "ct": "${json-unit.ignore}", + "nv": "11", + "sct": "${json-unit.ignore}", + "d": false, + "sid": "${json-unit.ignore}", + "na": false, + "n": "Achieved Level", + "mt": false + } + ], + "dt": "h", + "a": "${json-unit.ignore}", + "ai": { + "av": "1.0", + "sideloaded_kits_count": 0, + "bid": "${json-unit.ignore}", + "pir": false, + "fi": false, + "lud": "${json-unit.ignore}", + "arc": "arm64", + "tsv": "90000", + "apn": "com.mparticle.IntegrationTests", + "env": 1, + "abn": "1", + "bsv": "${json-unit.ignore}", + "ict": "${json-unit.ignore}" + }, + "ct": "${json-unit.ignore}", + "ck": "${json-unit.ignore}", + "das": "${json-unit.ignore}", + "mpid": 6504934091054997508, + "ui": [ + { + "i": "123456", + "n": 1 + }, + { + "i": "j.smit@example.com", + "n": 7 + } + ], + "uitl": 60, + "oo": false, + "sdk": "8.40.0", + "di": { + "p": "arm64", + "b": "arm64", + "tz": "-5", + "dn": "${json-unit.ignore}", + "dll": "en", + "dsh": "1440", + "idst": false, + "dlc": "${json-unit.ignore}", + "vid": "${json-unit.ignore}", + "dma": "Apple", + "tzn": "America/New_York", + "dp": "iOS", + "dsw": "960", + "dosv": "${json-unit.ignore}", + "it": false, + "dmdl": "arm64", + "dr": "None", + "jb": { + "cydia": false + }, + "lat": false, + "arc": "arm64e", + "bid": "${json-unit.ignore}" + }, + "ua": { + "$Age": "45", + "$Gender": "m", + "Achieved Level": "11" + }, + "stl": 60 + }, + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ], + "urlPattern": "/v2/us1-[a-f0-9]+/events" + }, + "response": { + "status": 202, + "bodyFileName": "body-increment-user-attribute.json", + "headers": { + "X-Cache": "MISS, MISS", + "X-MP-Trace-Id": "692dfa848fa0fd2b1e49687c3aa7083d", + "Server": "Kestrel", + "X-Origin-Name": "fastlyshield--shield_ssl_cache_iad_kiad7000144_IAD", + "Date": "Mon, 01 Dec 2025 20:28:52 GMT", + "X-Timer": "S1764620933.691339,VS0,VE17", + "Via": "1.1 varnish, 1.1 varnish", + "Accept-Ranges": "bytes", + "X-Served-By": "cache-iad-kiad7000144-IAD, cache-lga21949-LGA", + "Vary": "Accept-Encoding", + "X-Cache-Hits": "0, 0", + "Content-Type": "application/json" + } + }, + "uuid": "50514c8b-0999-3025-917b-445ebbc3c646" +} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/mappings/mapping-log-error.json b/IntegrationTests/wiremock-recordings/mappings/mapping-log-error.json new file mode 100644 index 000000000..16327bd1f --- /dev/null +++ b/IntegrationTests/wiremock-recordings/mappings/mapping-log-error.json @@ -0,0 +1,115 @@ +{ + "id": "1393a0c9-7861-3968-90c3-0cdb20104b4d", + "request": { + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": { + "id": "${json-unit.ignore}", + "ltv": 0, + "msgs": [ + { + "id": "${json-unit.ignore}", + "vc": "off_thread", + "dt": "x", + "is": "${json-unit.ignore}", + "ct": "${json-unit.ignore}", + "attrs": { + "cause": "slippery floor" + }, + "eh": "true", + "sct": "${json-unit.ignore}", + "s": "error", + "sid": "${json-unit.ignore}", + "m": "Oops", + "iba": "${json-unit.ignore}", + "mt": false + } + ], + "dt": "h", + "a": "${json-unit.ignore}", + "ai": { + "av": "1.0", + "sideloaded_kits_count": 0, + "bid": "${json-unit.ignore}", + "pir": false, + "fi": false, + "lud": "${json-unit.ignore}", + "arc": "arm64", + "tsv": "90000", + "apn": "com.mparticle.IntegrationTests", + "env": 1, + "abn": "1", + "bsv": "${json-unit.ignore}", + "ict": "${json-unit.ignore}" + }, + "ct": "${json-unit.ignore}", + "ck": "${json-unit.ignore}", + "das": "${json-unit.ignore}", + "mpid": 6504934091054997508, + "ui": [ + { + "i": "123456", + "n": 1 + }, + { + "i": "j.smit@example.com", + "n": 7 + } + ], + "uitl": 60, + "oo": false, + "sdk": "8.40.0", + "di": { + "p": "arm64", + "b": "arm64", + "tz": "-5", + "dn": "${json-unit.ignore}", + "dma": "Apple", + "dsh": "1440", + "idst": false, + "dlc": "${json-unit.ignore}", + "vid": "${json-unit.ignore}", + "dll": "en", + "dp": "iOS", + "tzn": "America/New_York", + "dsw": "960", + "dosv": "${json-unit.ignore}", + "it": false, + "dmdl": "arm64", + "dr": "None", + "jb": { + "cydia": false + }, + "lat": false, + "arc": "arm64e", + "bid": "${json-unit.ignore}" + }, + "stl": 60 + }, + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ], + "urlPattern": "/v2/us1-[a-f0-9]+/events" + }, + "response": { + "status": 202, + "bodyFileName": "body-log-error.json", + "headers": { + "X-Cache": "MISS, MISS", + "X-MP-Trace-Id": "692dd6cc4c581190f73bde872046f0ae", + "Server": "Kestrel", + "X-Origin-Name": "fastlyshield--shield_ssl_cache_iad_kjyo7100066_IAD", + "Date": "Mon, 01 Dec 2025 17:56:28 GMT", + "X-Timer": "S1764611788.131532,VS0,VE24", + "Via": "1.1 varnish, 1.1 varnish", + "Accept-Ranges": "bytes", + "X-Served-By": "cache-iad-kjyo7100066-IAD, cache-lga21920-LGA", + "Vary": "Accept-Encoding", + "X-Cache-Hits": "0, 0", + "Content-Type": "application/json" + } + }, + "uuid": "1393a0c9-7861-3968-90c3-0cdb20104b4d" +} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/mappings/mapping-log-exception.json b/IntegrationTests/wiremock-recordings/mappings/mapping-log-exception.json new file mode 100644 index 000000000..e54e0ba07 --- /dev/null +++ b/IntegrationTests/wiremock-recordings/mappings/mapping-log-exception.json @@ -0,0 +1,113 @@ +{ + "id": "ed21a661-dd24-3c78-88e9-0e4f7a4c639b", + "request": { + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": { + "id": "${json-unit.ignore}", + "ltv": 0, + "msgs": [ + { + "id": "${json-unit.ignore}", + "vc": "off_thread", + "dt": "x", + "is": "${json-unit.ignore}", + "ct": "${json-unit.ignore}", + "eh": "true", + "c": "NSInvalidArgumentException", + "sct": "${json-unit.ignore}", + "s": "error", + "sid": "${json-unit.ignore}", + "m": "-[ViewController someMethodThatDoesNotExist]: unrecognized selector sent to instance", + "iba": "${json-unit.ignore}", + "mt": false + } + ], + "dt": "h", + "a": "${json-unit.ignore}", + "ai": { + "av": "1.0", + "sideloaded_kits_count": 0, + "bid": "${json-unit.ignore}", + "pir": false, + "fi": false, + "lud": "${json-unit.ignore}", + "arc": "arm64", + "tsv": "90000", + "apn": "com.mparticle.IntegrationTests", + "env": 1, + "abn": "1", + "bsv": "${json-unit.ignore}", + "ict": "${json-unit.ignore}" + }, + "ct": "${json-unit.ignore}", + "ck": "${json-unit.ignore}", + "das": "${json-unit.ignore}", + "mpid": 6504934091054997508, + "ui": [ + { + "i": "123456", + "n": 1 + }, + { + "i": "j.smit@example.com", + "n": 7 + } + ], + "uitl": 60, + "oo": false, + "sdk": "8.40.0", + "di": { + "tz": "-5", + "bid": "${json-unit.ignore}", + "p": "arm64", + "dn": "${json-unit.ignore}", + "dll": "en", + "dma": "Apple", + "dsh": "1440", + "dlc": "${json-unit.ignore}", + "vid": "${json-unit.ignore}", + "idst": false, + "tzn": "America/New_York", + "dp": "iOS", + "dsw": "960", + "dosv": "${json-unit.ignore}", + "it": false, + "dmdl": "arm64", + "dr": "None", + "jb": { + "cydia": false + }, + "lat": false, + "arc": "arm64e", + "b": "arm64" + }, + "stl": 60 + }, + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ], + "urlPattern": "/v2/us1-[a-f0-9]+/events" + }, + "response": { + "status": 202, + "bodyFileName": "body-log-exception.json", + "headers": { + "X-Cache": "MISS, MISS", + "X-MP-Trace-Id": "692ddc5c414ea0173fc8815b5ab4ac31", + "Server": "Kestrel", + "X-Origin-Name": "fastlyshield--shield_ssl_cache_iad_kiad7000038_IAD", + "Date": "Mon, 01 Dec 2025 18:20:12 GMT", + "X-Timer": "S1764613213.841436,VS0,VE20", + "Via": "1.1 varnish, 1.1 varnish", + "Accept-Ranges": "bytes", + "X-Served-By": "cache-iad-kiad7000038-IAD, cache-lga21987-LGA", + "Vary": "Accept-Encoding", + "X-Cache-Hits": "0, 0", + "Content-Type": "application/json" + } + }, + "uuid": "ed21a661-dd24-3c78-88e9-0e4f7a4c639b" +} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/mappings/mapping-log-idfa.json b/IntegrationTests/wiremock-recordings/mappings/mapping-log-idfa.json new file mode 100644 index 000000000..1c571b1f2 --- /dev/null +++ b/IntegrationTests/wiremock-recordings/mappings/mapping-log-idfa.json @@ -0,0 +1,47 @@ +{ + "id": "a20d4746-5f12-3170-9589-11e5d7a2703e", + "request": { + "urlPattern": "/v1/[0-9]+/modify", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": { + "client_sdk": { + "platform": "ios", + "sdk_version": "${json-unit.ignore}", + "sdk_vendor": "mparticle" + }, + "environment": "development", + "request_timestamp_ms": "${json-unit.ignore}", + "request_id": "${json-unit.ignore}", + "identity_changes": [ + { + "new_value": "A5D934N0-232F-4AFC-2E9A-3832D95ZC702", + "old_value": null, + "identity_type": "ios_idfa" + } + ] + }, + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 404, + "bodyFileName": "body-log-idfa.txt", + "headers": { + "Accept-Ranges": "bytes", + "X-Cache": "MISS, MISS", + "Server": "Kestrel", + "X-Origin-Name": "fastlyshield--shield_ssl_cache_iad_kjyo7100065_IAD", + "X-Served-By": "cache-iad-kjyo7100065-IAD, cache-lga21945-LGA", + "Vary": "Accept-Encoding", + "X-Cache-Hits": "0, 0", + "Date": "Thu, 04 Dec 2025 15:39:30 GMT", + "X-Timer": "S1764862771.947527,VS0,VE9", + "Via": "1.1 varnish, 1.1 varnish" + } + }, + "uuid": "a20d4746-5f12-3170-9589-11e5d7a2703e" +} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/mappings/mapping-rokt-identify.json b/IntegrationTests/wiremock-recordings/mappings/mapping-rokt-identify.json new file mode 100644 index 000000000..995f9bbf0 --- /dev/null +++ b/IntegrationTests/wiremock-recordings/mappings/mapping-rokt-identify.json @@ -0,0 +1,53 @@ +{ + "id": "a5526351-3efc-3c34-a8cc-c1173ad5d153", + "request": { + "url": "/v1/identify", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": { + "client_sdk": { + "platform": "ios", + "sdk_version": "8.40.0", + "sdk_vendor": "mparticle" + }, + "environment": "development", + "request_timestamp_ms": "${json-unit.ignore}", + "request_id": "${json-unit.ignore}", + "known_identities": { + "email": "j.smit@example.com", + "customerid": "123456", + "ios_idfv": "${json-unit.ignore}", + "device_application_stamp": "${json-unit.ignore}" + }, + "previous_mpid": "${json-unit.ignore}" + }, + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "body-rokt-identify.json", + "headers": { + "X-Cache": "MISS", + "X-MP-Trace-Id": "692f29e6c420372d1290a7d10bd25d68", + "Server": "Kestrel", + "X-Origin-Name": "4PrgpUXX9K0sNAH1JImfyI--F_us1_origin", + "X-Fastly-Trace-Id": "3402929065", + "X-MP-Max-Age": "86400", + "Date": "Tue, 02 Dec 2025 18:03:18 GMT", + "X-Timer": "S1764698599.589821,VS0,VE58", + "Via": "1.1 varnish", + "Accept-Ranges": "bytes", + "Strict-Transport-Security": "max-age=900", + "Access-Control-Expose-Headers": "X-MP-Max-Age", + "X-Served-By": "cache-lga21939-LGA", + "Vary": "Accept-Encoding", + "X-Cache-Hits": "0", + "Content-Type": "application/json; charset=utf-8" + } + }, + "uuid": "a5526351-3efc-3c34-a8cc-c1173ad5d153" +} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/mappings/mapping-set-att-status.json b/IntegrationTests/wiremock-recordings/mappings/mapping-set-att-status.json new file mode 100644 index 000000000..e2b44ab87 --- /dev/null +++ b/IntegrationTests/wiremock-recordings/mappings/mapping-set-att-status.json @@ -0,0 +1,141 @@ +{ + "id": "c43a090d-ecf3-3318-a31d-f7950c361e69", + "request": { + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": { + "id": "${json-unit.ignore}", + "ltv": 0, + "msgs": [ + { + "et": "Other", + "id": "${json-unit.ignore}", + "vc": "off_thread", + "dt": "e", + "el": "${json-unit.ignore}", + "ct": "${json-unit.ignore}", + "attrs": { + "att_status": "authorized" + }, + "sct": "${json-unit.ignore}", + "sid": "${json-unit.ignore}", + "en": "${json-unit.ignore}", + "n": "ATT Status Updated", + "est": "${json-unit.ignore}", + "mt": false + } + ], + "dt": "h", + "a": "${json-unit.ignore}", + "ai": { + "ict": "${json-unit.ignore}", + "sideloaded_kits_count": 0, + "bid": "${json-unit.ignore}", + "pir": false, + "fi": true, + "lud": "${json-unit.ignore}", + "arc": "arm64", + "tsv": "90000", + "apn": "com.mparticle.IntegrationTests", + "env": 1, + "abn": "1", + "bsv": "${json-unit.ignore}", + "av": "1.0" + }, + "ct": "${json-unit.ignore}", + "ck": "${json-unit.ignore}", + "das": "${json-unit.ignore}", + "mpid": 6504934091054997508, + "ui": [ + { + "i": "123456", + "n": 1 + }, + { + "i": "j.smit@example.com", + "n": 7 + } + ], + "uitl": 60, + "oo": false, + "sdk": "8.40.0", + "di": { + "tz": "-5", + "p": "arm64", + "b": "arm64", + "dn": "${json-unit.ignore}", + "dll": "en", + "dlc": "${json-unit.ignore}", + "idst": false, + "dsh": "1440", + "vid": "${json-unit.ignore}", + "dma": "Apple", + "atts": "authorized", + "tzn": "America/New_York", + "dp": "iOS", + "dsw": "960", + "attt": 1700000000000, + "dosv": "${json-unit.ignore}", + "it": false, + "dmdl": "arm64", + "dr": "None", + "jb": { + "cydia": false + }, + "lat": false, + "arc": "arm64e", + "bid": "${json-unit.ignore}" + }, + "ua": { + "$Age": "45", + "$Gender": "m", + "Achieved Level": "11" + }, + "con": { + "ccpa": { + "data_sale_opt_out": { + "d": "ccpa_consent_agreement_v3", + "ts": 1700000000000, + "l": "17 Cherry Tree Lane", + "c": true, + "h": "IDFA:a5d934n0-232f-4afc-2e9a-3832d95zc702" + } + }, + "gdpr": { + "my gdpr purpose": { + "d": "location_collection_agreement_v4", + "ts": 1700000000000, + "l": "17 Cherry Tree Lane", + "c": true, + "h": "IDFA:a5d934n0-232f-4afc-2e9a-3832d95zc702" + } + } + }, + "stl": 60 + }, + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ], + "urlPattern": "/v2/us1-[a-f0-9]+/events" + }, + "response": { + "status": 400, + "bodyFileName": "body-set-att-status.json", + "headers": { + "X-Cache": "MISS, MISS", + "Server": "Kestrel", + "X-Origin-Name": "fastlyshield--shield_ssl_cache_iad_kiad7000150_IAD", + "Date": "Thu, 04 Dec 2025 16:26:49 GMT", + "X-Timer": "S1764865610.515283,VS0,VE22", + "Via": "1.1 varnish, 1.1 varnish", + "Accept-Ranges": "bytes", + "X-Served-By": "cache-iad-kiad7000150-IAD, cache-lga21931-LGA", + "Vary": "Accept-Encoding", + "X-Cache-Hits": "0, 0", + "Content-Type": "application/json" + } + }, + "uuid": "c43a090d-ecf3-3318-a31d-f7950c361e69" +} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/mappings/mapping-set-session-attribute.json b/IntegrationTests/wiremock-recordings/mappings/mapping-set-session-attribute.json new file mode 100644 index 000000000..0f3bcfad5 --- /dev/null +++ b/IntegrationTests/wiremock-recordings/mappings/mapping-set-session-attribute.json @@ -0,0 +1,121 @@ +{ + "id": "08b6ce22-0b43-31f0-886c-5a26f479a864", + "request": { + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": { + "id": "${json-unit.ignore}", + "ltv": 0, + "msgs": [ + { + "id": "${json-unit.ignore}", + "smpids": [ + 6504934091054997508 + ], + "vc": "off_thread", + "slx": "${json-unit.ignore}", + "dt": "se", + "ct": "${json-unit.ignore}", + "attrs": { + "Station": "Classic Rock" + }, + "sl": "${json-unit.ignore}", + "sct": "${json-unit.ignore}", + "sid": "${json-unit.ignore}", + "en": "${json-unit.ignore}", + "mt": false + } + ], + "dt": "h", + "a": "${json-unit.ignore}", + "ai": { + "av": "1.0", + "sideloaded_kits_count": 0, + "bid": "${json-unit.ignore}", + "pir": false, + "fi": false, + "lud": "${json-unit.ignore}", + "arc": "arm64", + "tsv": "90000", + "apn": "com.mparticle.IntegrationTests", + "env": 1, + "abn": "1", + "bsv": "${json-unit.ignore}", + "ict": "${json-unit.ignore}" + }, + "ct": "${json-unit.ignore}", + "ck": "${json-unit.ignore}", + "das": "${json-unit.ignore}", + "mpid": 6504934091054997508, + "ui": [ + { + "i": "123456", + "n": 1 + }, + { + "i": "j.smit@example.com", + "n": 7 + } + ], + "uitl": 60, + "oo": false, + "sdk": "8.40.0", + "di": { + "p": "arm64", + "tz": "-5", + "bid": "${json-unit.ignore}", + "dn": "${json-unit.ignore}", + "dma": "Apple", + "dsh": "1440", + "idst": false, + "dll": "en", + "dlc": "${json-unit.ignore}", + "vid": "${json-unit.ignore}", + "dp": "iOS", + "tzn": "America/New_York", + "dsw": "960", + "dosv": "${json-unit.ignore}", + "it": false, + "dmdl": "arm64", + "dr": "None", + "jb": { + "cydia": false + }, + "lat": false, + "arc": "arm64e", + "b": "arm64" + }, + "ua": { + "$Age": "45", + "$Gender": "m", + "Achieved Level": "11" + }, + "stl": 60 + }, + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ], + "urlPattern": "/v2/us1-[a-f0-9]+/events" + }, + "response": { + "status": 202, + "bodyFileName": "body-set-session-attribute.json", + "headers": { + "X-Cache": "MISS, MISS", + "X-MP-Trace-Id": "69304e36e3e1bc5ad0f28209bf28f429", + "Server": "Kestrel", + "X-Origin-Name": "fastlyshield--shield_ssl_cache_iad_kjyo7100170_IAD", + "Date": "Wed, 03 Dec 2025 14:50:30 GMT", + "X-Timer": "S1764773430.055993,VS0,VE19", + "Via": "1.1 varnish, 1.1 varnish", + "Accept-Ranges": "bytes", + "X-Served-By": "cache-iad-kjyo7100170-IAD, cache-lga21922-LGA", + "Vary": "Accept-Encoding", + "X-Cache-Hits": "0, 0", + "Content-Type": "application/json" + } + }, + "uuid": "08b6ce22-0b43-31f0-886c-5a26f479a864" +} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/mappings/mapping-set-user-attributes.json b/IntegrationTests/wiremock-recordings/mappings/mapping-set-user-attributes.json new file mode 100644 index 000000000..bed09f7e4 --- /dev/null +++ b/IntegrationTests/wiremock-recordings/mappings/mapping-set-user-attributes.json @@ -0,0 +1,145 @@ +{ + "id": "4d641caa-122f-34be-9d26-7a8080b8d8b6", + "request": { + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": { + "id": "${json-unit.ignore}", + "ltv": 0, + "msgs": [ + { + "id": "${json-unit.ignore}", + "vc": "off_thread", + "ov": null, + "dt": "uac", + "ct": "${json-unit.ignore}", + "nv": "45", + "sct": "${json-unit.ignore}", + "d": false, + "sid": "${json-unit.ignore}", + "na": true, + "n": "$Age", + "mt": false + }, + { + "id": "${json-unit.ignore}", + "vc": "off_thread", + "ov": null, + "dt": "uac", + "ct": "${json-unit.ignore}", + "nv": "m", + "sct": "${json-unit.ignore}", + "d": false, + "sid": "${json-unit.ignore}", + "na": true, + "n": "$Gender", + "mt": false + }, + { + "id": "${json-unit.ignore}", + "vc": "off_thread", + "ov": null, + "dt": "uac", + "ct": "${json-unit.ignore}", + "nv": "4", + "sct": "${json-unit.ignore}", + "d": false, + "sid": "${json-unit.ignore}", + "na": true, + "n": "Achieved Level", + "mt": false + } + ], + "dt": "h", + "a": "${json-unit.ignore}", + "ai": { + "av": "1.0", + "sideloaded_kits_count": 0, + "bid": "${json-unit.ignore}", + "pir": false, + "fi": false, + "lud": "${json-unit.ignore}", + "arc": "arm64", + "tsv": "90000", + "apn": "com.mparticle.IntegrationTests", + "env": 1, + "abn": "1", + "bsv": "${json-unit.ignore}", + "ict": "${json-unit.ignore}" + }, + "ct": "${json-unit.ignore}", + "ck": "${json-unit.ignore}", + "das": "${json-unit.ignore}", + "mpid": 6504934091054997508, + "ui": [ + { + "i": "123456", + "n": 1 + }, + { + "i": "j.smit@example.com", + "n": 7 + } + ], + "uitl": 60, + "oo": false, + "sdk": "8.40.0", + "di": { + "p": "arm64", + "b": "arm64", + "tz": "-5", + "dn": "${json-unit.ignore}", + "dma": "Apple", + "dlc": "${json-unit.ignore}", + "dsh": "1440", + "idst": false, + "dll": "en", + "vid": "${json-unit.ignore}", + "tzn": "America/New_York", + "dp": "iOS", + "dsw": "960", + "dosv": "${json-unit.ignore}", + "it": false, + "dmdl": "arm64", + "dr": "None", + "jb": { + "cydia": false + }, + "lat": false, + "arc": "arm64e", + "bid": "${json-unit.ignore}" + }, + "ua": { + "$Age": "45", + "$Gender": "m", + "Achieved Level": "4" + }, + "stl": 60 + }, + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ], + "urlPattern": "/v2/us1-[a-f0-9]+/events" + }, + "response": { + "status": 202, + "bodyFileName": "body-set-user-attributes.json", + "headers": { + "X-Cache": "MISS, MISS", + "X-MP-Trace-Id": "692de9cffcd99a7298285f465aabf842", + "Server": "Kestrel", + "X-Origin-Name": "fastlyshield--shield_ssl_cache_iad_kcgs7200110_IAD", + "Date": "Mon, 01 Dec 2025 19:17:35 GMT", + "X-Timer": "S1764616655.393677,VS0,VE14", + "Via": "1.1 varnish, 1.1 varnish", + "Accept-Ranges": "bytes", + "X-Served-By": "cache-iad-kcgs7200110-IAD, cache-lga21930-LGA", + "Vary": "Accept-Encoding", + "X-Cache-Hits": "0, 0", + "Content-Type": "application/json" + } + }, + "uuid": "4d641caa-122f-34be-9d26-7a8080b8d8b6" +} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/mappings/mapping-timed-event.json b/IntegrationTests/wiremock-recordings/mappings/mapping-timed-event.json new file mode 100644 index 000000000..9e7d8068a --- /dev/null +++ b/IntegrationTests/wiremock-recordings/mappings/mapping-timed-event.json @@ -0,0 +1,115 @@ +{ + "id": "35c40706-b94c-3dc5-9de7-954f74178568", + "request": { + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": { + "id": "${json-unit.ignore}", + "ltv": 0, + "msgs": [ + { + "et": "Transaction", + "id": "${json-unit.ignore}", + "vc": "off_thread", + "dt": "e", + "el": "${json-unit.ignore}", + "ct": "${json-unit.ignore}", + "attrs": { + "EventLength": "${json-unit.ignore}" + }, + "sct": "${json-unit.ignore}", + "sid": "${json-unit.ignore}", + "en": "${json-unit.ignore}", + "n": "Timed Event", + "est": "${json-unit.ignore}", + "mt": false + } + ], + "dt": "h", + "a": "${json-unit.ignore}", + "ai": { + "av": "1.0", + "sideloaded_kits_count": 0, + "bid": "${json-unit.ignore}", + "pir": false, + "fi": false, + "lud": "${json-unit.ignore}", + "arc": "arm64", + "tsv": "90000", + "apn": "com.mparticle.IntegrationTests", + "env": 1, + "abn": "1", + "bsv": "${json-unit.ignore}", + "ict": "${json-unit.ignore}" + }, + "ct": "${json-unit.ignore}", + "ck": "${json-unit.ignore}", + "das": "${json-unit.ignore}", + "mpid": 6504934091054997508, + "ui": [ + { + "i": "123456", + "n": 1 + }, + { + "i": "j.smit@example.com", + "n": 7 + } + ], + "uitl": 60, + "oo": false, + "sdk": "8.40.0", + "di": { + "tz": "-5", + "bid": "${json-unit.ignore}", + "p": "arm64", + "dn": "${json-unit.ignore}", + "dll": "en", + "dsh": "1440", + "idst": false, + "dlc": "${json-unit.ignore}", + "vid": "${json-unit.ignore}", + "dma": "Apple", + "dp": "iOS", + "tzn": "America/New_York", + "dsw": "960", + "dosv": "${json-unit.ignore}", + "it": false, + "dmdl": "arm64", + "dr": "None", + "jb": { + "cydia": false + }, + "lat": false, + "arc": "arm64e", + "b": "arm64" + }, + "stl": 60 + }, + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ], + "urlPattern": "/v2/us1-[a-f0-9]+/events" + }, + "response": { + "status": 202, + "bodyFileName": "body-timed-event.json", + "headers": { + "X-Cache": "MISS, MISS", + "X-MP-Trace-Id": "692dbcb044c20919c68bac1420c1ab2f", + "Server": "Kestrel", + "X-Origin-Name": "fastlyshield--shield_ssl_cache_iad_kjyo7100098_IAD", + "Date": "Mon, 01 Dec 2025 16:05:04 GMT", + "X-Timer": "S1764605104.140119,VS0,VE21", + "Via": "1.1 varnish, 1.1 varnish", + "Accept-Ranges": "bytes", + "X-Served-By": "cache-iad-kjyo7100098-IAD, cache-lga21971-LGA", + "Vary": "Accept-Encoding", + "X-Cache-Hits": "0, 0", + "Content-Type": "application/json" + } + }, + "uuid": "35c40706-b94c-3dc5-9de7-954f74178568" +} \ No newline at end of file diff --git a/IntegrationTests/wiremock-recordings/mappings/proxy-events.json b/IntegrationTests/wiremock-recordings/mappings/proxy-events.json deleted file mode 100644 index f15500c3b..000000000 --- a/IntegrationTests/wiremock-recordings/mappings/proxy-events.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "priority": 1, - "request": { - "urlPathPattern": "/v2/events" - }, - "response": { - "proxyBaseUrl": "https://nativesdks.mparticle.com" - } -} diff --git a/IntegrationTests/wiremock-recordings/mappings/proxy-identify.json b/IntegrationTests/wiremock-recordings/mappings/proxy-identify.json deleted file mode 100644 index f6633297b..000000000 --- a/IntegrationTests/wiremock-recordings/mappings/proxy-identify.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "priority": 1, - "request": { - "urlPathPattern": "/v1/identify" - }, - "response": { - "proxyBaseUrl": "https://identity.mparticle.com" - } -}