← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 22022: added new metadata test file for object bundle service test, includes user / userroles

 

------------------------------------------------------------
revno: 22022
committer: Morten Olav Hansen <morten@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2016-02-23 13:02:53 +0700
message:
  added new metadata test file for object bundle service test, includes user / userroles
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.java
  dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/simple_metadata1.json


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.java	2016-02-19 03:45:37 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.java	2016-02-23 06:02:53 +0000
@@ -442,6 +442,7 @@
         List<OrganisationUnit> organisationUnits = manager.getAll( OrganisationUnit.class );
         List<DataElement> dataElements = manager.getAll( DataElement.class );
         List<DataSet> dataSets = manager.getAll( DataSet.class );
+        List<User> users = manager.getAll( User.class );
         DataSet dataSet = dataSets.get( 0 );
 
         Map<Class<? extends IdentifiableObject>, IdentifiableObject> defaults = manager.getDefaults();
@@ -449,6 +450,7 @@
         assertFalse( organisationUnits.isEmpty() );
         assertFalse( dataElements.isEmpty() );
         assertFalse( dataSets.isEmpty() );
+        assertFalse( users.isEmpty() );
 
         for ( DataElement dataElement : dataElements )
         {

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/simple_metadata1.json'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/simple_metadata1.json	2016-02-17 09:17:36 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/simple_metadata1.json	2016-02-23 06:02:53 +0000
@@ -1,87 +1,128 @@
 {
+  "users": [
+    {
+      "organisationUnits": [
+        {
+          "id": "PdWlltZnVZe"
+        }
+      ],
+      "surname": "admin",
+      "created": "2016-02-17T06:14:12.250+0000",
+      "userCredentials": {
+        "disabled": false,
+        "cogsDimensionConstraints": [],
+        "lastLogin": "2016-02-17T06:14:12.274+0000",
+        "username": "admin",
+        "externalAccess": false,
+        "userInfo": {
+          "id": "ueKaFVdR8Fz"
+        },
+        "catDimensionConstraints": [],
+        "externalAuth": false,
+        "name": "admin",
+        "invitation": false,
+        "displayName": "admin",
+        "selfRegistered": false,
+        "passwordLastUpdated": "2016-02-17T06:14:12.274+0000",
+        "attributeValues": [],
+        "created": "2016-02-17T06:14:12.362+0000",
+        "code": "admin",
+        "userGroupAccesses": [],
+        "userRoles": [
+          {
+            "id": "rKLtmQLRMU8"
+          }
+        ]
+      },
+      "dataViewOrganisationUnits": [],
+      "id": "ueKaFVdR8Fz",
+      "firstName": "admin",
+      "attributeValues": [],
+      "lastUpdated": "2016-02-17T06:14:12.250+0000"
+    }
+  ],
   "organisationUnitLevels": [
     {
       "id": "e1DcQuAONBm",
+      "name": "Country",
       "level": 1,
-      "lastUpdated": "2016-02-17T06:19:09.255+0000",
       "created": "2016-02-17T06:17:12.379+0000",
-      "name": "Country"
-    }
-  ],
-  "categoryOptions": [
-    {
-      "created": "2016-02-17T06:13:29.120+0000",
-      "name": "default",
-      "attributeValues": [],
-      "publicAccess": "--------",
-      "shortName": "default",
-      "lastUpdated": "2016-02-17T06:13:29.137+0000",
-      "userGroupAccesses": [],
-      "organisationUnits": [],
-      "id": "SMHi6P8WZ1H"
-    }
-  ],
-  "categories": [
-    {
-      "name": "default",
-      "created": "2016-02-17T06:13:29.131+0000",
-      "categoryOptions": [
-        {
-          "id": "SMHi6P8WZ1H"
-        }
-      ],
-      "dataDimension": true,
-      "publicAccess": "--------",
-      "userGroupAccesses": [],
-      "lastUpdated": "2016-02-17T06:25:08.743+0000",
-      "dataDimensionType": "DISAGGREGATION",
-      "id": "XSypGD15atv"
-    }
-  ],
-  "categoryOptionCombos": [
-    {
-      "categoryCombo": {
-        "id": "zU1OZFVxnw7"
-      },
-      "id": "gOeVvNgprQ8",
-      "name": "default",
-      "ignoreApproval": false,
-      "lastUpdated": "2016-02-17T06:13:29.134+0000",
-      "created": "2016-02-17T06:13:29.133+0000",
-      "categoryOptions": [
-        {
-          "id": "SMHi6P8WZ1H"
-        }
-      ]
+      "lastUpdated": "2016-02-17T06:19:09.255+0000"
+    }
+  ],
+  "dataElements": [
+    {
+      "domainType": "AGGREGATE",
+      "code": "DataElementCodeA",
+      "created": "2016-02-17T06:15:06.079+0000",
+      "userGroupAccesses": [],
+      "shortName": "DataElementShortA",
+      "name": "DataElementA",
+      "id": "SG4HuKlNEFH",
+      "publicAccess": "rw------",
+      "attributeValues": [],
+      "user": {
+        "id": "ueKaFVdR8Fz"
+      },
+      "valueType": "TEXT",
+      "zeroIsSignificant": false,
+      "categoryCombo": {
+        "id": "zU1OZFVxnw7"
+      },
+      "lastUpdated": "2016-02-17T06:15:59.378+0000",
+      "aggregationType": "SUM",
+      "aggregationLevels": []
+    },
+    {
+      "attributeValues": [],
+      "publicAccess": "rw------",
+      "name": "DataElementB",
+      "id": "CCwk5Yx440o",
+      "shortName": "DataElementShortB",
+      "userGroupAccesses": [],
+      "domainType": "AGGREGATE",
+      "created": "2016-02-17T06:15:49.487+0000",
+      "code": "DataElementCodeB",
+      "aggregationLevels": [],
+      "aggregationType": "SUM",
+      "lastUpdated": "2016-02-17T06:16:08.180+0000",
+      "categoryCombo": {
+        "id": "zU1OZFVxnw7"
+      },
+      "zeroIsSignificant": false,
+      "user": {
+        "id": "ueKaFVdR8Fz"
+      },
+      "valueType": "TEXT"
     }
   ],
   "dataSets": [
     {
+      "renderAsTabs": false,
+      "validCompleteOnly": false,
+      "lastUpdated": "2016-02-17T06:19:18.986+0000",
+      "version": 1,
+      "categoryCombo": {
+        "id": "zU1OZFVxnw7"
+      },
       "indicators": [],
-      "dataElementDecoration": false,
-      "renderHorizontally": false,
-      "code": "DataSetCodeA",
+      "periodType": "Monthly",
       "fieldCombinationRequired": false,
+      "mobile": false,
+      "noValueRequiresComment": false,
+      "compulsoryDataElementOperands": [],
       "notifyCompletingUser": false,
-      "created": "2016-02-17T06:16:40.204+0000",
-      "renderAsTabs": false,
-      "id": "DSaKQTwN4qg",
-      "lastUpdated": "2016-02-17T06:19:18.986+0000",
-      "expiryDays": 0,
-      "validCompleteOnly": false,
-      "userGroupAccesses": [],
-      "attributeValues": [],
+      "user": {
+        "id": "ueKaFVdR8Fz"
+      },
       "skipOffline": false,
+      "attributeValues": [],
       "publicAccess": "rw------",
-      "noValueRequiresComment": false,
-      "shortName": "DataSetShortA",
-      "compulsoryDataElementOperands": [],
+      "renderHorizontally": false,
       "timelyDays": 15,
+      "id": "DSaKQTwN4qg",
       "name": "DataSetA",
-      "openFuturePeriods": 0,
-      "categoryCombo": {
-        "id": "zU1OZFVxnw7"
-      },
+      "dataElementDecoration": false,
       "dataElements": [
         {
           "id": "CCwk5Yx440o"
@@ -90,97 +131,158 @@
           "id": "SG4HuKlNEFH"
         }
       ],
-      "mobile": false,
+      "openFuturePeriods": 0,
+      "shortName": "DataSetShortA",
+      "expiryDays": 0,
       "organisationUnits": [
         {
           "id": "PdWlltZnVZe"
         }
       ],
-      "version": 1,
-      "periodType": "Monthly"
+      "userGroupAccesses": [],
+      "created": "2016-02-17T06:16:40.204+0000",
+      "code": "DataSetCodeA"
+    }
+  ],
+  "categories": [
+    {
+      "dataDimensionType": "DISAGGREGATION",
+      "publicAccess": "--------",
+      "lastUpdated": "2016-02-23T04:45:41.246+0000",
+      "id": "XSypGD15atv",
+      "name": "default",
+      "dataDimension": true,
+      "userGroupAccesses": [],
+      "created": "2016-02-17T06:13:29.131+0000",
+      "categoryOptions": [
+        {
+          "id": "SMHi6P8WZ1H"
+        }
+      ]
     }
   ],
   "categoryCombos": [
     {
-      "lastUpdated": "2016-02-17T06:13:29.135+0000",
       "userGroupAccesses": [],
+      "created": "2016-02-17T06:13:29.133+0000",
       "dataDimensionType": "DISAGGREGATION",
-      "id": "zU1OZFVxnw7",
-      "created": "2016-02-17T06:13:29.133+0000",
+      "skipTotal": false,
       "categories": [
         {
           "id": "XSypGD15atv"
         }
       ],
+      "publicAccess": "--------",
+      "lastUpdated": "2016-02-17T06:13:29.135+0000",
       "name": "default",
-      "skipTotal": false,
-      "publicAccess": "--------"
-    }
-  ],
-  "dataElements": [
-    {
-      "zeroIsSignificant": false,
-      "aggregationType": "SUM",
-      "domainType": "AGGREGATE",
-      "created": "2016-02-17T06:15:06.079+0000",
-      "code": "DataElementCodeA",
-      "id": "SG4HuKlNEFH",
-      "userGroupAccesses": [],
-      "lastUpdated": "2016-02-17T06:15:59.378+0000",
-      "shortName": "DataElementShortA",
-      "publicAccess": "rw------",
-      "attributeValues": [],
-      "name": "DataElementA",
-      "categoryCombo": {
-        "id": "zU1OZFVxnw7"
-      },
-      "aggregationLevels": [],
-      "valueType": "TEXT"
-    },
-    {
-      "publicAccess": "rw------",
-      "attributeValues": [],
-      "shortName": "DataElementShortB",
-      "name": "DataElementB",
-      "categoryCombo": {
-        "id": "zU1OZFVxnw7"
-      },
-      "aggregationLevels": [],
-      "valueType": "TEXT",
-      "zeroIsSignificant": false,
-      "aggregationType": "SUM",
-      "created": "2016-02-17T06:15:49.487+0000",
-      "code": "DataElementCodeB",
-      "domainType": "AGGREGATE",
-      "id": "CCwk5Yx440o",
-      "lastUpdated": "2016-02-17T06:16:08.180+0000",
-      "userGroupAccesses": []
-    }
-  ],
+      "id": "zU1OZFVxnw7"
+    }
+  ],
+  "date": "2016-02-23T04:46:54.176+0000",
   "organisationUnits": [
     {
+      "name": "OrgUnitA",
       "id": "PdWlltZnVZe",
-      "path": "/PdWlltZnVZe",
+      "attributeValues": [],
+      "openingDate": "2016-02-17",
       "lastUpdated": "2016-02-17T06:17:01.228+0000",
+      "user": {
+        "id": "ueKaFVdR8Fz"
+      },
+      "featureType": "NONE",
       "description": "",
-      "uuid": "6ea86a20-1eb1-4bbd-87ea-948ee1e01f20",
+      "code": "OrgUnitCodeA",
+      "path": "/PdWlltZnVZe",
+      "created": "2016-02-17T06:17:01.218+0000",
       "shortName": "OrgUnitShortA",
+      "uuid": "6ea86a20-1eb1-4bbd-87ea-948ee1e01f20"
+    }
+  ],
+  "categoryOptionCombos": [
+    {
+      "lastUpdated": "2016-02-17T06:13:29.134+0000",
+      "categoryOptions": [
+        {
+          "id": "SMHi6P8WZ1H"
+        }
+      ],
+      "ignoreApproval": false,
+      "created": "2016-02-17T06:13:29.133+0000",
+      "id": "gOeVvNgprQ8",
+      "categoryCombo": {
+        "id": "zU1OZFVxnw7"
+      },
+      "name": "default"
+    }
+  ],
+  "categoryOptions": [
+    {
+      "shortName": "default",
+      "created": "2016-02-17T06:13:29.120+0000",
+      "organisationUnits": [],
+      "userGroupAccesses": [],
+      "publicAccess": "--------",
+      "lastUpdated": "2016-02-17T06:13:29.137+0000",
       "attributeValues": [],
-      "name": "OrgUnitA",
-      "featureType": "NONE",
-      "created": "2016-02-17T06:17:01.218+0000",
-      "openingDate": "2016-02-17",
-      "code": "OrgUnitCodeA"
+      "id": "SMHi6P8WZ1H",
+      "name": "default"
+    }
+  ],
+  "userRoles": [
+    {
+      "authorities": [
+        "F_TRACKED_ENTITY_INSTANCE_SEARCH_IN_ALL_ORGUNITS",
+        "ALL",
+        "F_USERGROUP_MANAGING_RELATIONSHIPS_ADD",
+        "F_REPORTTABLE_PUBLIC_ADD",
+        "F_TRACKED_ENTITY_INSTANCE_DELETE",
+        "F_USER_GROUPS_READ_ONLY_ADD_MEMBERS",
+        "F_MAP_PUBLIC_ADD",
+        "F_USER_ADD_WITHIN_MANAGED_GROUP",
+        "F_TRACKED_ENTITY_INSTANCE_SEARCH",
+        "F_PROGRAM_ENROLLMENT",
+        "F_REPORTTABLE_EXTERNAL",
+        "F_SQLVIEW_EXTERNAL",
+        "F_GIS_ADMIN",
+        "F_REPLICATE_USER",
+        "F_INSERT_CUSTOM_JS_CSS",
+        "F_DASHBOARD_PUBLIC_ADD",
+        "F_METADATA_IMPORT",
+        "F_CHART_PUBLIC_ADD",
+        "F_VIEW_UNAPPROVED_DATA",
+        "F_CHART_EXTERNAL",
+        "F_USERGROUP_MANAGING_RELATIONSHIPS_VIEW",
+        "F_METADATA_EXPORT",
+        "F_PROGRAM_UNENROLLMENT",
+        "F_APPROVE_DATA",
+        "F_ACCEPT_DATA_LOWER_LEVELS",
+        "F_TRACKED_ENTITY_INSTANCE_ADD",
+        "F_USERGROUP_PUBLIC_ADD",
+        "F_OAUTH2_CLIENT_MANAGE",
+        "F_TRACKED_ENTITY_DATAVALUE_ADD",
+        "F_PROGRAM_DASHBOARD_CONFIG_ADMIN",
+        "F_MAP_EXTERNAL",
+        "F_APPROVE_DATA_LOWER_LEVELS",
+        "F_TRACKED_ENTITY_DATAVALUE_DELETE"
+      ],
+      "name": "Superuser",
+      "id": "rKLtmQLRMU8",
+      "dataSets": [],
+      "publicAccess": "--------",
+      "lastUpdated": "2016-02-17T06:14:12.260+0000",
+      "userGroupAccesses": [],
+      "created": "2016-02-17T06:14:12.260+0000",
+      "programs": []
     }
   ],
   "trackedEntities": [
     {
+      "attributeValues": [],
+      "lastUpdated": "2016-02-17T06:25:08.000+0000",
+      "description": "Person",
       "id": "NdUUIOhQPcu",
-      "attributeValues": [],
       "name": "Person",
-      "created": "2016-02-17T06:25:08.000+0000",
-      "lastUpdated": "2016-02-17T06:25:08.000+0000",
-      "description": "Person"
+      "created": "2016-02-17T06:25:08.000+0000"
     }
   ]
 }