Skip to content

Commit

Permalink
test: use merged simple_metadata.json
Browse files Browse the repository at this point in the history
  • Loading branch information
teleivo committed Nov 8, 2024
1 parent 0a5aa88 commit 1cb3306
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 241 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,6 @@
"categoryOptionCombos": [
{
"id": "HllvX50cXC0",
"attributeValues": [
{
"attribute": {
"id": "j45AR9cBQKc"
},
"value": "categoryOptionCombo HllvX50cXC0"
}
],
"categoryCombo": {
"id": "bjDvmb4bfuf"
},
Expand All @@ -120,8 +112,8 @@
"id": "xYerKDKCefk"
}
],
"code": "HllvX50cXC0 code",
"name": "HllvX50cXC0 name"
"code": "default",
"name": "default"
},
{
"id": "tzsPhPtE94U",
Expand Down Expand Up @@ -229,6 +221,14 @@
},
{
"id": "SeWJkpLAyLt",
"attributeValues": [
{
"attribute": {
"id": "j45AR9cBQKc"
},
"value": "categoryOptionCombo SeWJkpLAyLt"
}
],
"categoryCombo": {
"id": "O4VaNks6tta"
},
Expand Down Expand Up @@ -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"
}
Expand Down Expand Up @@ -1017,7 +1017,7 @@
"attribute": {
"id": "j45AR9cBQKc"
},
"value": "multi-program-stage-attribute"
"value": "programStage qLZC0lvvxQH"
}
],
"autoGenerateEvent": true,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import java.util.stream.Stream;
import org.hisp.dhis.attribute.Attribute;
import org.hisp.dhis.category.CategoryOptionCombo;
import org.hisp.dhis.category.CategoryService;
import org.hisp.dhis.common.IdentifiableObject;
import org.hisp.dhis.common.IdentifiableObjectManager;
import org.hisp.dhis.dxf2.metadata.objectbundle.ObjectBundle;
Expand Down Expand Up @@ -95,6 +96,7 @@ class IdSchemeExportControllerTest extends PostgresControllerIntegrationTestBase
@Autowired private TrackerImportService trackerImportService;

@Autowired private IdentifiableObjectManager manager;
@Autowired private CategoryService service;

private OrganisationUnit orgUnit;
private ProgramStage programStage;
Expand Down Expand Up @@ -132,10 +134,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();
Expand Down Expand Up @@ -173,12 +175,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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

This file was deleted.

0 comments on commit 1cb3306

Please sign in to comment.