shiro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lhazlew...@apache.org
Subject svn commit: r1479181 - in /shiro/trunk/samples/aspectj: pom.xml src/test/java/org/apache/shiro/samples/aspectj/bank/SecureBankServiceTest.java src/test/resources/shiroBankServiceTest.ini
Date Sat, 04 May 2013 21:33:21 GMT
Author: lhazlewood
Date: Sat May  4 21:33:20 2013
New Revision: 1479181

URL: http://svn.apache.org/r1479181
Log:
SHIRO-316: applied patch.  Due to patch's age, I did not use the patch's AspectJ version 1.6.7
since the project is already using a later stable version (1.6.12)

Modified:
    shiro/trunk/samples/aspectj/pom.xml
    shiro/trunk/samples/aspectj/src/test/java/org/apache/shiro/samples/aspectj/bank/SecureBankServiceTest.java
    shiro/trunk/samples/aspectj/src/test/resources/shiroBankServiceTest.ini

Modified: shiro/trunk/samples/aspectj/pom.xml
URL: http://svn.apache.org/viewvc/shiro/trunk/samples/aspectj/pom.xml?rev=1479181&r1=1479180&r2=1479181&view=diff
==============================================================================
--- shiro/trunk/samples/aspectj/pom.xml (original)
+++ shiro/trunk/samples/aspectj/pom.xml Sat May  4 21:33:20 2013
@@ -52,6 +52,7 @@
 					<execution>
 						<id>aspectj-compile</id>
 						<goals>
+							<goal>compile</goal>
 							<goal>test-compile</goal>
 						</goals>
 					</execution>

Modified: shiro/trunk/samples/aspectj/src/test/java/org/apache/shiro/samples/aspectj/bank/SecureBankServiceTest.java
URL: http://svn.apache.org/viewvc/shiro/trunk/samples/aspectj/src/test/java/org/apache/shiro/samples/aspectj/bank/SecureBankServiceTest.java?rev=1479181&r1=1479180&r2=1479181&view=diff
==============================================================================
--- shiro/trunk/samples/aspectj/src/test/java/org/apache/shiro/samples/aspectj/bank/SecureBankServiceTest.java
(original)
+++ shiro/trunk/samples/aspectj/src/test/java/org/apache/shiro/samples/aspectj/bank/SecureBankServiceTest.java
Sat May  4 21:33:20 2013
@@ -21,11 +21,16 @@ package org.apache.shiro.samples.aspectj
 import junit.framework.Assert;
 import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.authc.UsernamePasswordToken;
+import org.apache.shiro.authz.UnauthorizedException;
 import org.apache.shiro.config.IniSecurityManagerFactory;
 import org.apache.shiro.mgt.SecurityManager;
 import org.apache.shiro.subject.Subject;
 import org.apache.shiro.util.Factory;
-import org.junit.*;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -196,6 +201,12 @@ public class SecureBankServiceTest {
         service.closeAccount(accountId);
     }
 
+    @Test(expected = UnauthorizedException.class)
+    public void testCloseAccount_unauthorizedAttempt() throws Exception {
+        loginAsUser();
+        long accountId = createAndValidateAccountFor("Chris Smith");
+        service.closeAccount(accountId);
+    }
 
     protected long createAndValidateAccountFor(String anOwner) throws Exception {
         long createdId = service.createNewAccount(anOwner);

Modified: shiro/trunk/samples/aspectj/src/test/resources/shiroBankServiceTest.ini
URL: http://svn.apache.org/viewvc/shiro/trunk/samples/aspectj/src/test/resources/shiroBankServiceTest.ini?rev=1479181&r1=1479180&r2=1479181&view=diff
==============================================================================
--- shiro/trunk/samples/aspectj/src/test/resources/shiroBankServiceTest.ini (original)
+++ shiro/trunk/samples/aspectj/src/test/resources/shiroBankServiceTest.ini Sat May  4 21:33:20
2013
@@ -38,5 +38,5 @@ dan = 123, user
 # -----------------------------------------------------------------------------
 [roles]
 admin = bankAccount:*
-superviser = bankAccount:create, bankAccount:read bankAccount:close
+superviser = bankAccount:create, bankAccount:read, bankAccount:close
 user = bankAccount:create, bankAccount:read, bankAccount:operate



Mime
View raw message