Search in sources :

Example 51 with ImmutableEvent

use of org.hisp.dhis.dxf2.events.importer.shared.ImmutableEvent in project dhis2-core by dhis2.

the class EventBaseCheckTest method verifyErrorOnMissingProgramInstance.

@Test
void verifyErrorOnMissingProgramInstance() {
    event.setEvent(event.getUid());
    ImportSummary importSummary = rule.check(new ImmutableEvent(event), workContext);
    assertHasError(importSummary, event, null);
    assertHasConflict(importSummary, event, "No program instance found for event: " + event.getEvent());
}
Also used : ImportSummary(org.hisp.dhis.dxf2.importsummary.ImportSummary) ImmutableEvent(org.hisp.dhis.dxf2.events.importer.shared.ImmutableEvent) Test(org.junit.jupiter.api.Test) BaseValidationTest(org.hisp.dhis.dxf2.events.importer.validation.BaseValidationTest)

Aggregations

ImportSummary (org.hisp.dhis.dxf2.importsummary.ImportSummary)49 ImmutableEvent (org.hisp.dhis.dxf2.events.importer.shared.ImmutableEvent)38 Test (org.junit.jupiter.api.Test)35 BaseValidationTest (org.hisp.dhis.dxf2.events.importer.validation.BaseValidationTest)34 Program (org.hisp.dhis.program.Program)18 HashMap (java.util.HashMap)17 DhisConvenienceTest.createProgram (org.hisp.dhis.DhisConvenienceTest.createProgram)13 ProgramStageInstance (org.hisp.dhis.program.ProgramStageInstance)11 ProgramInstance (org.hisp.dhis.program.ProgramInstance)10 DataValue (org.hisp.dhis.dxf2.events.event.DataValue)9 ProgramStage (org.hisp.dhis.program.ProgramStage)8 DataElement (org.hisp.dhis.dataelement.DataElement)7 ImportOptions (org.hisp.dhis.dxf2.common.ImportOptions)7 TrackedEntityInstance (org.hisp.dhis.trackedentity.TrackedEntityInstance)7 DhisConvenienceTest.createDataElement (org.hisp.dhis.DhisConvenienceTest.createDataElement)5 DhisConvenienceTest.createProgramStageDataElement (org.hisp.dhis.DhisConvenienceTest.createProgramStageDataElement)5 DhisConvenienceTest.createTrackedEntityInstance (org.hisp.dhis.DhisConvenienceTest.createTrackedEntityInstance)5 CategoryOptionCombo (org.hisp.dhis.category.CategoryOptionCombo)5 EventTestUtils.createDataValue (org.hisp.dhis.dxf2.events.importer.EventTestUtils.createDataValue)5 EventTestUtils.createEventDataValue (org.hisp.dhis.dxf2.events.importer.EventTestUtils.createEventDataValue)5