Search in sources :

Example 26 with TrackerImportParams

use of org.hisp.dhis.tracker.TrackerImportParams in project dhis2-core by dhis2.

the class TrackerImportParamsBuilderTest method testDataElementIdentifier.

@Test
void testDataElementIdentifier() {
    Arrays.stream(TrackerIdScheme.values()).forEach(e -> {
        paramMap.put("dataElementIdScheme", Collections.singletonList(e.name()));
        TrackerImportParams params = TrackerImportParamsBuilder.build(paramMap);
        assertThat(params.getIdentifiers().getDataElementIdScheme().getIdScheme(), is(e));
    });
}
Also used : TrackerImportParams(org.hisp.dhis.tracker.TrackerImportParams) Test(org.junit.jupiter.api.Test)

Example 27 with TrackerImportParams

use of org.hisp.dhis.tracker.TrackerImportParams in project dhis2-core by dhis2.

the class TrackerImportParamsBuilderTest method testAtomicMode.

@Test
void testAtomicMode() {
    Arrays.stream(AtomicMode.values()).forEach(e -> {
        paramMap.put(ATOMIC_MODE_KEY.getKey(), Collections.singletonList(e.name()));
        TrackerImportParams params = TrackerImportParamsBuilder.build(paramMap);
        assertThat(params.getAtomicMode(), is(e));
    });
}
Also used : TrackerImportParams(org.hisp.dhis.tracker.TrackerImportParams) Test(org.junit.jupiter.api.Test)

Example 28 with TrackerImportParams

use of org.hisp.dhis.tracker.TrackerImportParams in project dhis2-core by dhis2.

the class TrackerImportParamsBuilderTest method testImportStrategy.

@Test
void testImportStrategy() {
    Arrays.stream(TrackerImportStrategy.values()).forEach(e -> {
        paramMap.put(IMPORT_STRATEGY_KEY.getKey(), Collections.singletonList(e.name()));
        TrackerImportParams params = TrackerImportParamsBuilder.build(paramMap);
        assertThat(params.getImportStrategy(), is(e));
    });
}
Also used : TrackerImportParams(org.hisp.dhis.tracker.TrackerImportParams) Test(org.junit.jupiter.api.Test)

Example 29 with TrackerImportParams

use of org.hisp.dhis.tracker.TrackerImportParams in project dhis2-core by dhis2.

the class TrackerImportParamsBuilderTest method testCategoryOptionComboIdentifier.

@Test
void testCategoryOptionComboIdentifier() {
    Arrays.stream(TrackerIdScheme.values()).forEach(e -> {
        paramMap.put("categoryOptionComboIdScheme", Collections.singletonList(e.name()));
        TrackerImportParams params = TrackerImportParamsBuilder.build(paramMap);
        assertThat(params.getIdentifiers().getCategoryOptionComboIdScheme().getIdScheme(), is(e));
    });
}
Also used : TrackerImportParams(org.hisp.dhis.tracker.TrackerImportParams) Test(org.junit.jupiter.api.Test)

Example 30 with TrackerImportParams

use of org.hisp.dhis.tracker.TrackerImportParams in project dhis2-core by dhis2.

the class TrackerImportParamsBuilderTest method testValidationMode.

@Test
void testValidationMode() {
    Arrays.stream(ValidationMode.values()).forEach(e -> {
        paramMap.put(VALIDATION_MODE_KEY.getKey(), Collections.singletonList(e.name()));
        TrackerImportParams params = TrackerImportParamsBuilder.build(paramMap);
        assertThat(params.getValidationMode(), is(e));
    });
}
Also used : TrackerImportParams(org.hisp.dhis.tracker.TrackerImportParams) Test(org.junit.jupiter.api.Test)

Aggregations

TrackerImportParams (org.hisp.dhis.tracker.TrackerImportParams)163 Test (org.junit.jupiter.api.Test)142 TrackerImportReport (org.hisp.dhis.tracker.report.TrackerImportReport)105 TrackerTest (org.hisp.dhis.tracker.TrackerTest)46 User (org.hisp.dhis.user.User)26 ClassPathResource (org.springframework.core.io.ClassPathResource)23 TrackedEntityInstance (org.hisp.dhis.trackedentity.TrackedEntityInstance)21 TransactionalIntegrationTest (org.hisp.dhis.TransactionalIntegrationTest)17 InputStream (java.io.InputStream)16 TrackedEntityAttributeValue (org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue)11 OrganisationUnit (org.hisp.dhis.organisationunit.OrganisationUnit)10 List (java.util.List)9 TrackerPreheat (org.hisp.dhis.tracker.preheat.TrackerPreheat)9 ProgramStageInstance (org.hisp.dhis.program.ProgramStageInstance)8 Event (org.hisp.dhis.tracker.domain.Event)7 Pair (org.apache.commons.lang3.tuple.Pair)6 ProgramInstance (org.hisp.dhis.program.ProgramInstance)6 TrackedEntityAttribute (org.hisp.dhis.trackedentity.TrackedEntityAttribute)6 ImmutablePair (org.apache.commons.lang3.tuple.ImmutablePair)5 Program (org.hisp.dhis.program.Program)5