use of org.springframework.security.access.prepost.PreInvocationAttribute in project spring-security by spring-projects.
the class ExpressionBasedPreInvocationAdviceTests method findFilterTargetNameNotProvidedTypeNotSupported.
@Test
public void findFilterTargetNameNotProvidedTypeNotSupported() throws Exception {
PreInvocationAttribute attribute = new PreInvocationExpressionAttribute("true", "", null);
MockMethodInvocation methodInvocation = new MockMethodInvocation(new TestClass(), TestClass.class, "doSomethingString", new Class[] { String.class }, new Object[] { "param" });
assertThatIllegalArgumentException().isThrownBy(() -> this.expressionBasedPreInvocationAdvice.before(this.authentication, methodInvocation, attribute));
}
use of org.springframework.security.access.prepost.PreInvocationAttribute in project spring-security by spring-projects.
the class ExpressionBasedPreInvocationAdviceTests method findFilterTargetNameProvidedButNotMatch.
@Test
public void findFilterTargetNameProvidedButNotMatch() throws Exception {
PreInvocationAttribute attribute = new PreInvocationExpressionAttribute("true", "filterTargetDoesNotMatch", null);
MockMethodInvocation methodInvocation = new MockMethodInvocation(new TestClass(), TestClass.class, "doSomethingCollection", new Class[] { List.class }, new Object[] { new ArrayList<>() });
assertThatIllegalArgumentException().isThrownBy(() -> this.expressionBasedPreInvocationAdvice.before(this.authentication, methodInvocation, attribute));
}
Aggregations