dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21259
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10007: minor fix
------------------------------------------------------------
revno: 10007
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-03-06 12:25:29 +0300
message:
minor fix
modified:
dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/webapi/v1/utils/OrganisationUnitToFacilityConverter.java
dhis-2/dhis-web/dhis-web-api-fred/src/test/java/org/hisp/dhis/web/webapi/v1/utils/OrganisationUnitToFacilityConverterTest.java
--
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-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/webapi/v1/utils/OrganisationUnitToFacilityConverter.java'
--- dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/webapi/v1/utils/OrganisationUnitToFacilityConverter.java 2013-03-04 12:07:19 +0000
+++ dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/webapi/v1/utils/OrganisationUnitToFacilityConverter.java 2013-03-06 09:25:29 +0000
@@ -63,7 +63,14 @@
facility.setActive( organisationUnit.isActive() );
facility.setCreatedAt( organisationUnit.getCreated() );
facility.setUpdatedAt( organisationUnit.getLastUpdated() );
- facility.setUrl( linkTo( FacilityController.class ).slash( organisationUnit.getUid() ).toString() );
+
+ try
+ {
+ facility.setUrl( linkTo( FacilityController.class ).slash( organisationUnit.getUid() ).toString() );
+ }
+ catch ( IllegalStateException ignored )
+ {
+ }
if ( organisationUnit.getFeatureType() != null && organisationUnit.getFeatureType().equalsIgnoreCase( "POINT" )
&& organisationUnit.getCoordinates() != null )
=== modified file 'dhis-2/dhis-web/dhis-web-api-fred/src/test/java/org/hisp/dhis/web/webapi/v1/utils/OrganisationUnitToFacilityConverterTest.java'
--- dhis-2/dhis-web/dhis-web-api-fred/src/test/java/org/hisp/dhis/web/webapi/v1/utils/OrganisationUnitToFacilityConverterTest.java 2013-03-06 09:21:16 +0000
+++ dhis-2/dhis-web/dhis-web-api-fred/src/test/java/org/hisp/dhis/web/webapi/v1/utils/OrganisationUnitToFacilityConverterTest.java 2013-03-06 09:25:29 +0000
@@ -140,6 +140,7 @@
List<String> dataSets = (List<String>) facility.getProperties().get( "dataSets" );
+ Assert.assertEquals( 3, dataSets.size() );
Assert.assertTrue( dataSets.contains( dataSet1.getUid() ) );
Assert.assertTrue( dataSets.contains( dataSet2.getUid() ) );
Assert.assertTrue( dataSets.contains( dataSet3.getUid() ) );