Skip to content

Conversation

obaidgini
Copy link
Contributor

Description

  • Adds the unit test for BufferedUserAnalyticsEventTracker
  • Following classes are involved for the Integration test
    • BufferedUserAnalyticsEventTracker
    • GiniCaptureFragment
    • NetworkRequestsManager
    • ImageMultiPageDocumentMemoryStore
    • GiniCapture

Some of the above mentioned classes are used for mocks only.

Notes for reviewer

Analytics for android uses multiple classes, please read the comments mentioned in GiniCaptureFragmentTest and specially in BufferedUserAnalyticsEventTrackerTest. These comments explain how our analytics are working, and how we can test the behaviors.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive testing for the user analytics feature flag functionality, specifically testing how BufferedUserAnalyticsEventTracker behaves when the user journey analytics is enabled or disabled.

  • Unit tests for BufferedUserAnalyticsEventTracker to verify tracker initialization based on feature flag state
  • Integration tests using GiniCaptureFragment to test the analytics behavior in a realistic scenario
  • Helper class to facilitate testing with mocked GiniCapture instances

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
BufferedUserAnalyticsEventTrackerTest.kt Comprehensive unit tests for analytics tracker behavior with feature flag
BufferedUserAnalyticsEventTracker.kt Adds test-only method to expose internal trackers for verification
GiniCaptureFragmentTest.kt Integration tests verifying analytics behavior through fragment lifecycle
GiniCaptureHelperForInstrumentationTests.java Test helper to inject mocked GiniCapture instances
build.gradle.kts Adds mockito-kotlin2 dependency for testing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@obaidgini obaidgini requested a review from zladzeyka September 8, 2025 15:18
Copy link
Contributor

@abolfazlimahdi abolfazlimahdi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, it looks very good. I have three suggestions that we can discuss in our Android sync. Thanks Obaid.

Copy link
Contributor

@abolfazlimahdi abolfazlimahdi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you 🥇

Copy link

sonarqubecloud bot commented Oct 1, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants