Skip to content

Commit

Permalink
fix: failing enum conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaCambi77 committed Jan 8, 2024
1 parent 1e89dc7 commit 7471d68
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,32 @@ class TrackedEntityInstanceAuditStoreTest extends SingleSetupIntegrationTestBase

@Autowired private TrackedEntityInstanceAuditStore store;

private final TrackedEntityInstanceAudit teiaA =
new TrackedEntityInstanceAudit("WGW7UnVcIIb", "Access", CREATED, "userA", AuditType.CREATE);
private final TrackedEntityInstanceAudit teiaB =
new TrackedEntityInstanceAudit("WGW7UnVcIIb", "Access", CREATED, "userB", AuditType.UPDATE);
private final TrackedEntityInstanceAudit teiaC =
new TrackedEntityInstanceAudit("zIAwTY3Drrn", "Access", CREATED, "userA", AuditType.UPDATE);
private final TrackedEntityInstanceAudit teiaD =
new TrackedEntityInstanceAudit("zIAwTY3Drrn", "Access", CREATED, "userB", AuditType.DELETE);

@Test
void shouldAuditTrackedEntity_whenAddAuditList() {
store.addTrackedEntityInstanceAudit(List.of(teiaA, teiaB, teiaC, teiaD));

TrackedEntityInstanceAuditQueryParams params =
new TrackedEntityInstanceAuditQueryParams()
.setTrackedEntityInstances(List.of("WGW7UnVcIIb"));

assertContainsOnly(List.of(teiaA, teiaB), store.getTrackedEntityInstanceAudits(params));

params =
new TrackedEntityInstanceAuditQueryParams()
.setTrackedEntityInstances(List.of("zIAwTY3Drrn"));

assertContainsOnly(List.of(teiaC, teiaD), store.getTrackedEntityInstanceAudits(params));
}

@Test
void testGetAuditsByParams() {
TrackedEntityInstanceAudit teiaA =
Expand Down

0 comments on commit 7471d68

Please sign in to comment.