------------------------------------------------------------ revno: 14658 committer: Lars Helge Ă˜verland <larshe...@gmail.com> branch nick: dhis2 timestamp: Fri 2014-04-04 14:42:31 +0200 message: Test fix modified: dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/descriptors/DataApprovalLevelSchemaDescriptor.java 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/DataApprovalServiceTest.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-api/src/main/java/org/hisp/dhis/schema/descriptors/DataApprovalLevelSchemaDescriptor.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/descriptors/DataApprovalLevelSchemaDescriptor.java 2014-04-04 11:54:42 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/descriptors/DataApprovalLevelSchemaDescriptor.java 2014-04-04 12:42:31 +0000 @@ -47,9 +47,9 @@ schema.setShareable( true ); - schema.getAuthorities().add( new Authority( AuthorityType.CREATE_PUBLIC, Lists.newArrayList( "F_DATAAPPROVALLEVEL_PUBLIC_ADD" ) ) ); - schema.getAuthorities().add( new Authority( AuthorityType.CREATE_PRIVATE, Lists.newArrayList( "F_DATAAPPROVALLEVEL_PRIVATE_ADD" ) ) ); - schema.getAuthorities().add( new Authority( AuthorityType.DELETE, Lists.newArrayList( "F_DATAAPPROVALLEVEL_DELETE" ) ) ); + schema.getAuthorities().add( new Authority( AuthorityType.CREATE_PUBLIC, Lists.newArrayList( "F_SYSTEM_SETTING" ) ) ); + schema.getAuthorities().add( new Authority( AuthorityType.CREATE_PRIVATE, Lists.newArrayList( "F_SYSTEM_SETTING" ) ) ); + schema.getAuthorities().add( new Authority( AuthorityType.DELETE, Lists.newArrayList( "F_SYSTEM_SETTING" ) ) ); return schema; } === 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-04 11:54:42 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalLevelServiceTest.java 2014-04-04 12:42:31 +0000 @@ -49,11 +49,12 @@ /** * @author Jim Grace - * @version $Id$ */ public class DataApprovalLevelServiceTest - extends DhisSpringTest + extends DhisSpringTest { + private static final String AUTH_APPR_LEVEL = "F_SYSTEM_SETTING"; + @Autowired private DataApprovalLevelService dataApprovalLevelService; @@ -439,7 +440,7 @@ { Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitB ); - createUserAndInjectSecurityContext( units, false ); + createUserAndInjectSecurityContext( units, false, AUTH_APPR_LEVEL ); List<DataApprovalLevel> levels; @@ -468,7 +469,7 @@ { Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitB ); - createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE ); + createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, AUTH_APPR_LEVEL ); List<DataApprovalLevel> levels; @@ -499,7 +500,7 @@ { Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitB ); - createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE_LOWER_LEVELS ); + createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE_LOWER_LEVELS, AUTH_APPR_LEVEL ); List<DataApprovalLevel> levels; @@ -534,7 +535,7 @@ { Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitB ); - createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS ); + createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS, AUTH_APPR_LEVEL ); List<DataApprovalLevel> levels; @@ -570,7 +571,7 @@ { Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitB ); - createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_ACCEPT_LOWER_LEVELS ); + createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_ACCEPT_LOWER_LEVELS, AUTH_APPR_LEVEL ); List<DataApprovalLevel> levels; === modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceTest.java' --- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceTest.java 2014-04-03 16:03:26 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceTest.java 2014-04-04 12:42:31 +0000 @@ -61,11 +61,11 @@ /** * @author Jim Grace - * @version $Id$ */ public class DataApprovalServiceTest extends DhisSpringTest { + private static final String AUTH_APPR_LEVEL = "F_SYSTEM_SETTING"; @Autowired private DataApprovalService dataApprovalService; @@ -406,7 +406,7 @@ { Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitA ); - createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS ); + createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS, AUTH_APPR_LEVEL ); dataApprovalLevelService.addDataApprovalLevel( dataApprovalLevel1 ); dataApprovalLevelService.addDataApprovalLevel( dataApprovalLevel2 ); @@ -494,7 +494,7 @@ { Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitA ); - createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS ); + createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS, AUTH_APPR_LEVEL ); dataApprovalLevelService.addDataApprovalLevel( dataApprovalLevel1 ); dataApprovalLevelService.addDataApprovalLevel( dataApprovalLevel2 ); @@ -523,7 +523,7 @@ { Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitA ); - createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS ); + createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS, AUTH_APPR_LEVEL ); dataApprovalLevelService.addDataApprovalLevel( dataApprovalLevel1 ); dataApprovalLevelService.addDataApprovalLevel( dataApprovalLevel2 ); @@ -570,7 +570,7 @@ { Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitA ); - createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS ); + createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS, AUTH_APPR_LEVEL ); dataApprovalLevelService.addDataApprovalLevel( dataApprovalLevel1 ); dataApprovalLevelService.addDataApprovalLevel( dataApprovalLevel2 ); @@ -660,7 +660,7 @@ { Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitA ); - createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS ); + createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS, AUTH_APPR_LEVEL ); dataApprovalLevelService.addDataApprovalLevel( dataApprovalLevel1 ); dataApprovalLevelService.addDataApprovalLevel( dataApprovalLevel2 ); @@ -718,7 +718,7 @@ { Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitA ); - createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS ); + createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS, AUTH_APPR_LEVEL ); dataApprovalLevelService.addDataApprovalLevel( dataApprovalLevel1 ); dataApprovalLevelService.addDataApprovalLevel( dataApprovalLevel2 ); @@ -755,7 +755,7 @@ Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitB ); - createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE ); + createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, AUTH_APPR_LEVEL ); Date date = new Date(); @@ -789,7 +789,7 @@ Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitB ); - createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE_LOWER_LEVELS ); + createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE_LOWER_LEVELS, AUTH_APPR_LEVEL ); Date date = new Date(); @@ -823,7 +823,7 @@ Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitB ); - createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS ); + createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS, AUTH_APPR_LEVEL ); Date date = new Date(); @@ -857,7 +857,7 @@ Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitB ); - createUserAndInjectSecurityContext( units, false ); + createUserAndInjectSecurityContext( units, false, AUTH_APPR_LEVEL ); Date date = new Date(); @@ -886,7 +886,7 @@ Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitB ); - createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE ); + createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, AUTH_APPR_LEVEL ); Date date = new Date(); @@ -934,7 +934,7 @@ Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitB ); - createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE_LOWER_LEVELS ); + createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE_LOWER_LEVELS, AUTH_APPR_LEVEL ); Date date = new Date(); @@ -982,7 +982,7 @@ Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitB ); - createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS ); + createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS, AUTH_APPR_LEVEL ); Date date = new Date(); @@ -1030,7 +1030,7 @@ Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitB ); - createUserAndInjectSecurityContext( units, false ); + createUserAndInjectSecurityContext( units, false, AUTH_APPR_LEVEL ); Date date = new Date(); @@ -1077,7 +1077,7 @@ Set<OrganisationUnit> units = new HashSet<OrganisationUnit>(); units.add( organisationUnitA ); - createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS ); + createUserAndInjectSecurityContext( units, false, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS, AUTH_APPR_LEVEL ); Set<CategoryOptionGroup> groupASet = new HashSet<CategoryOptionGroup>(); groupASet.add ( groupA );
_______________________________________________ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp