diff options
Diffstat (limited to 'spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java')
-rw-r--r-- | spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java index 42bb2334..73cf1ffc 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java @@ -324,7 +324,8 @@ public class CallbacksSecurityTests { try { acc.checkPermission(new PropertyPermission("*", "read")); fail("Acc should not have any permissions"); - } catch (SecurityException se) { + } + catch (SecurityException se) { // expected } @@ -342,7 +343,8 @@ public class CallbacksSecurityTests { } }, acc); fail("expected security exception"); - } catch (Exception ex) { + } + catch (Exception ex) { } final Class<ConstructorBean> cl = ConstructorBean.class; @@ -356,7 +358,8 @@ public class CallbacksSecurityTests { } }, acc); fail("expected security exception"); - } catch (Exception ex) { + } + catch (Exception ex) { } } @@ -365,7 +368,8 @@ public class CallbacksSecurityTests { try { beanFactory.getBean("spring-init"); fail("expected security exception"); - } catch (BeanCreationException ex) { + } + catch (BeanCreationException ex) { assertTrue(ex.getCause() instanceof SecurityException); } } @@ -375,7 +379,8 @@ public class CallbacksSecurityTests { try { beanFactory.getBean("custom-init"); fail("expected security exception"); - } catch (BeanCreationException ex) { + } + catch (BeanCreationException ex) { assertTrue(ex.getCause() instanceof SecurityException); } } @@ -399,7 +404,8 @@ public class CallbacksSecurityTests { try { beanFactory.getBean("spring-factory"); fail("expected security exception"); - } catch (BeanCreationException ex) { + } + catch (BeanCreationException ex) { assertTrue(ex.getCause() instanceof SecurityException); } @@ -416,7 +422,8 @@ public class CallbacksSecurityTests { try { beanFactory.getBean("custom-static-factory-method"); fail("expected security exception"); - } catch (BeanCreationException ex) { + } + catch (BeanCreationException ex) { assertTrue(ex.getMostSpecificCause() instanceof SecurityException); } } @@ -426,7 +433,8 @@ public class CallbacksSecurityTests { try { beanFactory.getBean("custom-factory-method"); fail("expected security exception"); - } catch (BeanCreationException ex) { + } + catch (BeanCreationException ex) { assertTrue(ex.getMostSpecificCause() instanceof SecurityException); } } @@ -436,7 +444,8 @@ public class CallbacksSecurityTests { try { beanFactory.getBean("privileged-static-factory-method"); fail("expected security exception"); - } catch (BeanCreationException ex) { + } + catch (BeanCreationException ex) { assertTrue(ex.getMostSpecificCause() instanceof SecurityException); } } @@ -446,7 +455,8 @@ public class CallbacksSecurityTests { try { beanFactory.getBean("constructor"); fail("expected security exception"); - } catch (BeanCreationException ex) { + } + catch (BeanCreationException ex) { // expected assertTrue(ex.getMostSpecificCause() instanceof SecurityException); } @@ -472,7 +482,8 @@ public class CallbacksSecurityTests { try { beanFactory.getBean("property-injection"); fail("expected security exception"); - } catch (BeanCreationException ex) { + } + catch (BeanCreationException ex) { assertTrue(ex.getMessage().contains("security")); } |