use of org.springframework.security.access.annotation.BusinessService in project spring-security by spring-projects.
the class SecuredAnnotationDrivenBeanDefinitionParserTests method targetIsSerializableAfterUse.
@Test(expected = AccessDeniedException.class)
public void targetIsSerializableAfterUse() throws Exception {
try {
target.someAdminMethod();
} catch (AuthenticationCredentialsNotFoundException expected) {
}
SecurityContextHolder.getContext().setAuthentication(new TestingAuthenticationToken("u", "p", "ROLE_A"));
BusinessService chompedTarget = (BusinessService) serializeAndDeserialize(target);
chompedTarget.someAdminMethod();
}
use of org.springframework.security.access.annotation.BusinessService in project spring-security by spring-projects.
the class SecuredAnnotationDrivenBeanDefinitionParserTests method targetIsSerializableBeforeUse.
// SEC-1387
@Test(expected = AuthenticationCredentialsNotFoundException.class)
public void targetIsSerializableBeforeUse() throws Exception {
BusinessService chompedTarget = (BusinessService) serializeAndDeserialize(target);
chompedTarget.someAdminMethod();
}
Aggregations