dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #29702
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15045: Test fix
------------------------------------------------------------
revno: 15045
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-04-28 11:05:50 +0200
message:
Test fix
modified:
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalLevelServiceTest.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-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalLevelServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalLevelServiceTest.java 2014-04-27 22:31:59 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalLevelServiceTest.java 2014-04-28 09:05:50 +0000
@@ -202,49 +202,12 @@
@Test
public void testAddDataApprovalLevel() throws Exception
{
- List<DataApprovalLevel> levels;
-
- levels = dataApprovalLevelService.getAllDataApprovalLevels();
- assertEquals( 0, levels.size() );
-
dataApprovalLevelService.addDataApprovalLevel( level3B );
- levels = dataApprovalLevelService.getAllDataApprovalLevels();
- assertEquals( 1, levels.size() );
-
- assertEquals( 3, levels.get( 0 ).getOrgUnitLevel() );
- assertEquals( "Set B", levels.get( 0 ).getCategoryOptionGroupSet().getName() );
- assertEquals( "3B", levels.get( 0 ).getName() );
-
dataApprovalLevelService.addDataApprovalLevel( level2C );
- levels = dataApprovalLevelService.getAllDataApprovalLevels();
- assertEquals( 2, levels.size() );
-
- assertEquals( 2, levels.get( 0 ).getOrgUnitLevel() );
- assertEquals( "Set C", levels.get( 0 ).getCategoryOptionGroupSet().getName() );
- assertEquals( "2C", levels.get( 0 ).getName() );
-
- assertEquals( 3, levels.get( 1 ).getOrgUnitLevel() );
- assertEquals( "Set B", levels.get( 1 ).getCategoryOptionGroupSet().getName() );
- assertEquals( "3B", levels.get( 1 ).getName() );
-
dataApprovalLevelService.addDataApprovalLevel( level3 );
- levels = dataApprovalLevelService.getAllDataApprovalLevels();
- assertEquals( 3, levels.size() );
-
- assertEquals( 2, levels.get( 0 ).getOrgUnitLevel() );
- assertEquals( "Set C", levels.get( 0 ).getCategoryOptionGroupSet().getName() );
- assertEquals( "2C", levels.get( 0 ).getName() );
-
- assertEquals( 3, levels.get( 1 ).getOrgUnitLevel() );
- assertNull( levels.get( 1 ).getCategoryOptionGroupSet() );
- assertEquals( "03", levels.get( 1 ).getName() );
-
- assertEquals( 3, levels.get( 2 ).getOrgUnitLevel() );
- assertEquals( "Set B", levels.get( 2 ).getCategoryOptionGroupSet().getName() );
- assertEquals( "3B", levels.get( 2 ).getName() );
-
dataApprovalLevelService.addDataApprovalLevel( level4A );
- levels = dataApprovalLevelService.getAllDataApprovalLevels();
+
+ List<DataApprovalLevel> levels = dataApprovalLevelService.getAllDataApprovalLevels();
assertEquals( 4, levels.size() );
assertEquals( 2, levels.get( 0 ).getOrgUnitLevel() );