diff --git a/dhis-2/dhis-support/dhis-support-test/src/main/resources/tracker/simple_metadata.json b/dhis-2/dhis-support/dhis-support-test/src/main/resources/tracker/simple_metadata.json index e7c22c646f5..484f971828e 100644 --- a/dhis-2/dhis-support/dhis-support-test/src/main/resources/tracker/simple_metadata.json +++ b/dhis-2/dhis-support/dhis-support-test/src/main/resources/tracker/simple_metadata.json @@ -104,14 +104,6 @@ "categoryOptionCombos": [ { "id": "HllvX50cXC0", - "attributeValues": [ - { - "attribute": { - "id": "j45AR9cBQKc" - }, - "value": "categoryOptionCombo HllvX50cXC0" - } - ], "categoryCombo": { "id": "bjDvmb4bfuf" }, @@ -120,8 +112,8 @@ "id": "xYerKDKCefk" } ], - "code": "HllvX50cXC0 code", - "name": "HllvX50cXC0 name" + "code": "default", + "name": "default" }, { "id": "tzsPhPtE94U", @@ -229,6 +221,14 @@ }, { "id": "SeWJkpLAyLt", + "attributeValues": [ + { + "attribute": { + "id": "j45AR9cBQKc" + }, + "value": "categoryOptionCombo SeWJkpLAyLt" + } + ], "categoryCombo": { "id": "O4VaNks6tta" }, @@ -680,21 +680,21 @@ "attribute": { "id": "j45AR9cBQKc" }, - "value": "multi-org-attribute" + "value": "orgUnit DiszpKrYNg8" } ], - "code": "org3", + "code": "DiszpKrYNg8 code", "created": "2020-05-31T08:56:15.922", - "description": "test-orgunit-3", + "description": "DiszpKrYNg8 description", "lastUpdated": "2020-05-31T11:41:22.384", "lastUpdatedBy": { "id": "tTgjgobT1oS" }, "level": 1, - "name": "test-orgunit-3", + "name": "DiszpKrYNg8 name", "openingDate": "2020-05-31T00:00:00.000", "path": "/DiszpKrYNg8", - "shortName": "test-orgunit-3", + "shortName": "DiszpKrYNg8 shortName", "user": { "id": "tTgjgobT1oS" } @@ -1017,7 +1017,7 @@ "attribute": { "id": "j45AR9cBQKc" }, - "value": "multi-program-stage-attribute" + "value": "programStage qLZC0lvvxQH" } ], "autoGenerateEvent": true, @@ -1429,13 +1429,13 @@ "attribute": { "id": "j45AR9cBQKc" }, - "value": "multi-program-attribute" + "value": "program iS7eutanDry" } ], "categoryCombo": { "id": "O4VaNks6tta" }, - "code": "multi-program", + "code": "iS7eutanDry code", "completeEventsExpiryDays": 0, "created": "2022-04-22T05:57:48.409", "displayIncidentDate": true, diff --git a/dhis-2/dhis-test-web-api/src/test/java/org/hisp/dhis/webapi/controller/tracker/export/IdSchemeExportControllerTest.java b/dhis-2/dhis-test-web-api/src/test/java/org/hisp/dhis/webapi/controller/tracker/export/IdSchemeExportControllerTest.java index 6f2dbaf3b68..8ddfe11406e 100644 --- a/dhis-2/dhis-test-web-api/src/test/java/org/hisp/dhis/webapi/controller/tracker/export/IdSchemeExportControllerTest.java +++ b/dhis-2/dhis-test-web-api/src/test/java/org/hisp/dhis/webapi/controller/tracker/export/IdSchemeExportControllerTest.java @@ -132,10 +132,10 @@ void setUp() throws IOException { assertNoErrors( trackerImportService.importTracker(params, fromJson("tracker/event_and_enrollment.json"))); get(Attribute.class, METADATA_ATTRIBUTE); // ensure this is created in setup - orgUnit = get(OrganisationUnit.class, "h4w96yEMlzO"); - program = get(Program.class, "BFcipDERJnf"); - programStage = get(ProgramStage.class, "NpsdDv6kKSO"); - categoryOptionCombo = get(CategoryOptionCombo.class, "HllvX50cXC0"); + orgUnit = get(OrganisationUnit.class, "DiszpKrYNg8"); + program = get(Program.class, "iS7eutanDry"); + programStage = get(ProgramStage.class, "qLZC0lvvxQH"); + categoryOptionCombo = get(CategoryOptionCombo.class, "SeWJkpLAyLt"); manager.flush(); manager.clear(); @@ -173,12 +173,12 @@ void shouldExportMetadataUsingGivenIdScheme(TrackerIdSchemeParam idSchemeParam) metadata.keySet().stream() .map(m -> idSchemeRequestParams.get(m) + "IdScheme=" + idSchemeParam) .collect(Collectors.joining("&")); - Event d9PbzJY8bJM = get(Event.class, "D9PbzJY8bJM"); + Event qRYjLTiJTrA = get(Event.class, "QRYjLTiJTrA"); JsonEvent actual = GET( "/tracker/events/{id}?fields={fields}&{idSchemes}", - d9PbzJY8bJM.getUid(), + qRYjLTiJTrA.getUid(), fields, idSchemes) .content(HttpStatus.OK) diff --git a/dhis-2/dhis-test-web-api/src/test/java/org/hisp/dhis/webapi/controller/tracker/export/trackedentity/TrackedEntitiesExportControllerPostgresTest.java b/dhis-2/dhis-test-web-api/src/test/java/org/hisp/dhis/webapi/controller/tracker/export/trackedentity/TrackedEntitiesExportControllerPostgresTest.java index c6e83aa1c9f..8dff7f95e87 100644 --- a/dhis-2/dhis-test-web-api/src/test/java/org/hisp/dhis/webapi/controller/tracker/export/trackedentity/TrackedEntitiesExportControllerPostgresTest.java +++ b/dhis-2/dhis-test-web-api/src/test/java/org/hisp/dhis/webapi/controller/tracker/export/trackedentity/TrackedEntitiesExportControllerPostgresTest.java @@ -96,7 +96,7 @@ class TrackedEntitiesExportControllerPostgresTest extends PostgresControllerInte @BeforeEach void setUp() throws IOException { this.renderService = _renderService; - setUpMetadata("tracker/simple_metadata_changelog.json"); + setUpMetadata("tracker/simple_metadata.json"); User importUser = userService.getUser("tTgjgobT1oS"); injectSecurityContextUser(importUser); diff --git a/dhis-2/dhis-test-web-api/src/test/resources/tracker/simple_metadata_changelog.json b/dhis-2/dhis-test-web-api/src/test/resources/tracker/simple_metadata_changelog.json deleted file mode 100644 index 1fe668a7a40..00000000000 --- a/dhis-2/dhis-test-web-api/src/test/resources/tracker/simple_metadata_changelog.json +++ /dev/null @@ -1,216 +0,0 @@ -{ - "attributes": [ - { - "id": "j45AR9cBQKc", - "name": "some attribute", - "sharing": { - "owner": "PQD6wXJ2r5j", - "public": "rw------" - }, - "valueType": "TEXT", - "mandatory": false, - "unique": true, - "programAttribute": true, - "programStageAttribute": true, - "trackedEntityTypeAttribute": true, - "trackedEntityAttributeAttribute": true, - "organisationUnitAttribute": true, - "dataElementAttribute": true, - "relationshipTypeAttribute": true, - "categoryOptionAttribute": true, - "categoryOptionComboAttribute": true - } - ], - "trackedEntityTypes": [ - { - "name": "Person", - "id": "ja8NY4PW7Xm", - "publicAccess": "rw------", - "description": "person", - "maxTeiCountToReturn": 0, - "allowAuditLog": true, - "featureType": "NONE", - "minAttributesRequiredToSearch": 1, - "user": { - "id": "tTgjgobT1oS" - }, - "sharing": { - "external": false, - "public": "rwrw----" - }, - "trackedEntityTypeAttributes": [ - { - "displayInList": true, - "displayName": "Person Given name", - "displayShortName": "null Given name", - "externalAccess": false, - "favorite": false, - "favorites": [], - "id": "hKZ9AJpnVcG", - "name": "Person Given name", - "searchable": true, - "trackedEntityAttribute": { - "id": "numericAttr" - }, - "trackedEntityType": { - "id": "ja8NY4PW7Xm" - }, - "valueType": "TEXT" - } - ] - }, - { - "name": "Inaccessible person", - "id": "Ip8NY4PW7Xm", - "publicAccess": "rw------", - "description": "person", - "maxTeiCountToReturn": 0, - "allowAuditLog": false, - "featureType": "NONE", - "minAttributesRequiredToSearch": 1, - "user": { - "id": "tTgjgobT1oS" - }, - "sharing": { - "external": false, - "public": "--------" - } - } - ], - "users": [ - { - "code": "tracker admin", - "id": "tTgjgobT1oS", - "password": "Test123###...", - "surname": "tracker Surnameadmin", - "firstName": "tracker FirstNameadmin", - "name": "tracker admin", - "lastLogin": "2020-05-31T08:55:38.571", - "displayName": "tracker admin", - "externalAuth": false, - "externalAccess": false, - "disabled": false, - "twoFA": false, - "passwordLastUpdated": "2020-05-31T08:55:28.232", - "invitation": false, - "selfRegistered": false, - "favorite": false, - "username": "trackeradmin", - "access": { - "read": true, - "update": true, - "externalize": true, - "delete": true, - "write": true, - "manage": true - }, - "userRoles": [ - { - "id": "nJ4Ml8ads4M" - } - ], - "teiSearchOrganisationUnits": [ - { - "id": "h4w96yEMlzO" - } - ], - "organisationUnits": [ - { - "id": "h4w96yEMlzO" - } - ] - } - ], - "organisationUnits": [ - { - "id": "h4w96yEMlzO", - "name": "test-orgunit", - "code": "test-orgunit-code", - "level": 1, - "publicAccess": "rwrw----", - "shortName": "test-orgunit", - "description": "test-orgunit", - "path": "/h4w96yEMlzO", - "openingDate": "2020-05-31T00:00:00.000", - "user": { - "id": "tTgjgobT1oS" - } - } - ], - "programs": [ - { - "id": "BFcipDERJnf", - "name": "test-program", - "shortName": "test-program", - "publicAccess": "rwrw----", - "completeEventsExpiryDays": 0, - "ignoreOverdueEvents": false, - "skipOffline": false, - "minAttributesRequiredToSearch": 1, - "displayFrontPageList": false, - "onlyEnrollOnce": false, - "programType": "WITH_REGISTRATION", - "accessLevel": "OPEN", - "version": 2, - "maxTeiCountToReturn": 0, - "selectIncidentDatesInFuture": false, - "displayIncidentDate": true, - "selectEnrollmentDatesInFuture": false, - "expiryDays": 0, - "useFirstStageDuringRegistration": false, - "categoryCombo": { - "id": "bjDvmb4bfuf" - }, - "trackedEntityType": { - "id": "ja8NY4PW7Xm" - }, - "user": { - "id": "tTgjgobT1oS" - }, - "organisationUnits": [ - { - "id": "h4w96yEMlzO" - } - ] - } - ], - "userRoles": [ - { - "code": "tracker Superuser", - "name": "tracker Superuser", - "id": "nJ4Ml8ads4M", - "publicAccess": "--------", - "description": "tracker Superuser", - "user": { - "id": "tTgjgobT1oS" - }, - "authorities": [ - "F_TRACKED_ENTITY_INSTANCE_SEARCH_IN_ALL_ORGUNITS", - "ALL" - ] - } - ], - "trackedEntityAttributes": [ - { - "id": "numericAttr", - "name": "numeric-attribute", - "shortName": "numeric-attribute", - "aggregationType": "NONE", - "displayInListNoProgram": false, - "publicAccess": "rw------", - "pattern": "", - "skipSynchronization": false, - "generated": false, - "displayOnVisitSchedule": false, - "valueType": "INTEGER", - "formName": "numeric-attribute", - "orgunitScope": false, - "confidential": false, - "unique": false, - "inherit": false, - "user": { - "id": "tTgjgobT1oS" - } - } - ] -} \ No newline at end of file