List of usage examples for org.springframework.security.authentication TestingAuthenticationToken getPrincipal
public Object getPrincipal()
From source file:at.ac.univie.isc.asio.security.HttpMethodRestrictionFilterTest.java
@Test public void should_keep_other_token_properties() throws Exception { final TestingAuthenticationToken token = new TestingAuthenticationToken("user", "secret", Collections.<GrantedAuthority>singletonList(Permission.INVOKE_UPDATE)); token.setDetails("details"); setAuthentication(token);//from w ww . ja va 2s. com request.setMethod(HttpMethod.GET.name()); subject.doFilter(request, response, chain); final Authentication filtered = getAuthentication(); assertThat(filtered.getPrincipal(), equalTo(token.getPrincipal())); assertThat(filtered.getCredentials(), equalTo(token.getCredentials())); assertThat(filtered.getDetails(), equalTo(token.getDetails())); }