Skip to content

Commit

Permalink
fix: Test coverage update (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitolo-Andrea authored Nov 26, 2024
1 parent aac5f76 commit c071443
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,21 @@ private CitizenConsent createMockCitizenConsent(String hashedFiscalCode, String

return citizenConsent;
}

@Test
void testFindByTppIdEnabled_Success() {
String tppId = "tpp1";
CitizenConsent citizenConsent = createMockCitizenConsent("hashedCode", tppId);

when(mongoTemplate.aggregate(
Mockito.any(Aggregation.class),
Mockito.eq("citizen_consents"),
Mockito.eq(CitizenConsent.class)
)).thenReturn(Flux.just(citizenConsent));

StepVerifier.create(repository.findByTppIdEnabled(tppId))
.expectNextMatches(result -> result.getConsents().containsKey(tppId) && result.getConsents().get(tppId).getTppState())
.verifyComplete();

}
}

0 comments on commit c071443

Please sign in to comment.