From c62cbe7a08cedc0ebb9b4234d03a6de52752a6ba Mon Sep 17 00:00:00 2001 From: zubaira Date: Mon, 20 Jan 2025 08:37:55 +0100 Subject: [PATCH] fix test --- .../category/CategoryOptionComboMergeServiceTest.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/merge/category/CategoryOptionComboMergeServiceTest.java b/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/merge/category/CategoryOptionComboMergeServiceTest.java index fce4dc7bee1..649afb2ee55 100644 --- a/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/merge/category/CategoryOptionComboMergeServiceTest.java +++ b/dhis-2/dhis-test-integration/src/test/java/org/hisp/dhis/merge/category/CategoryOptionComboMergeServiceTest.java @@ -95,6 +95,7 @@ import org.hisp.dhis.sms.command.hibernate.SMSCommandStore; import org.hisp.dhis.test.integration.PostgresIntegrationTestBase; import org.hisp.dhis.trackedentity.TrackedEntity; +import org.hisp.dhis.trackedentity.TrackedEntityType; import org.hisp.dhis.util.DateUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -1385,7 +1386,9 @@ void dataApprovalMergeCocDiscardTest() throws ConflictException { "Event attributeOptionCombo references to source COCs are replaced with target COC when using LAST_UPDATED, source COCs are not deleted") void eventMergeTest() throws ConflictException { // given - TrackedEntity trackedEntity = createTrackedEntity(ou1); + TrackedEntityType entityType = createTrackedEntityType('T'); + manager.save(entityType); + TrackedEntity trackedEntity = createTrackedEntity(ou1, entityType); manager.save(trackedEntity); Enrollment enrollment = createEnrollment(program, trackedEntity, ou1); manager.save(enrollment); @@ -1437,7 +1440,9 @@ void eventMergeTest() throws ConflictException { "Event eventDataValues references to source COCs are deleted using DISCARD, source COCs are deleted") void eventMergeSourcesDeletedTest() throws ConflictException { // given - TrackedEntity trackedEntity = createTrackedEntity(ou1); + TrackedEntityType entityType = createTrackedEntityType('T'); + manager.save(entityType); + TrackedEntity trackedEntity = createTrackedEntity(ou1, entityType); manager.save(trackedEntity); Enrollment enrollment = createEnrollment(program, trackedEntity, ou1); manager.save(enrollment);