← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16628: minor test addition

 

------------------------------------------------------------
revno: 16628
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-09-05 09:23:29 +0700
message:
  minor test addition
modified:
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/common/SharingTest.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/common/SharingTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/common/SharingTest.java	2014-09-04 13:03:35 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/common/SharingTest.java	2014-09-05 02:23:29 +0000
@@ -31,6 +31,7 @@
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.acl.AccessStringHelper;
 import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.hibernate.exception.CreateAccessDeniedException;
 import org.hisp.dhis.user.User;
 import org.hisp.dhis.user.UserService;
 import org.junit.Test;
@@ -101,6 +102,13 @@
         assertFalse( AccessStringHelper.canWrite( dataElement.getPublicAccess() ) );
     }
 
+    @Test( expected = CreateAccessDeniedException.class )
+    public void userDeniedCreateObject()
+    {
+        createUserAndInjectSecurityContext( false );
+        identifiableObjectManager.save( createDataElement( 'A' ) );
+    }
+
     @Test
     public void objectsWithNoUser()
     {