Skip to content

Unit Tests for SynchronizeService#114

Open
Blue-B-code wants to merge 3 commits intoopenimis:developfrom
Y-Note-SAS:feature-35093
Open

Unit Tests for SynchronizeService#114
Blue-B-code wants to merge 3 commits intoopenimis:developfrom
Y-Note-SAS:feature-35093

Conversation

@Blue-B-code
Copy link

@Blue-B-code Blue-B-code commented Jan 8, 2026

Description

Here I've implemented a basic test for the SynchronizeService class. We used Robolectric to simulate an Android environment and access the application context, albeit within certain limitations.

Type of change

Chore(CI/CD)

Unit Tests added :

handleUploadClaims_WithPendingClaims_DoesNotCrash – PASSED ✅

handleUploadClaims_WhenNoPendingClaims_BroadcastsNoClaimError – PASSED ✅

handleUploadClaims_WhenNoNetwork_BroadcastsError – PASSED ✅

processClaimResponse_WithError_UpdatesStatusToError – PASSED ✅

processClaimResponse_WithSuccess_UpdatesStatusToAccepted – PASSED ✅

processClaimResponse_WithRejectedClaim_UpdatesStatusToRejected – PASSED ✅

handleGetClaimCount_BroadcastsCorrectCounts – PASSED ✅

Similarly, for the Policies app, we had to change certain attributes or methods from private to protected to be able to mock them with Mockito.

@Blue-B-code Blue-B-code changed the title Test Test for SynchronizeService Jan 9, 2026
@Blue-B-code Blue-B-code changed the title Test for SynchronizeService Unit Tests for SynchronizeService Jan 9, 2026
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