Example usage for org.springframework.security.authentication RememberMeAuthenticationToken getDetails

List of usage examples for org.springframework.security.authentication RememberMeAuthenticationToken getDetails

Introduction

In this page you can find the example usage for org.springframework.security.authentication RememberMeAuthenticationToken getDetails.

Prototype

public Object getDetails() 

Source Link

Usage

From source file:at.ac.univie.isc.asio.security.HttpMethodRestrictionFilterTest.java

@Test
public void should_keep_rememberme_type() throws Exception {
    final RememberMeAuthenticationToken token = new RememberMeAuthenticationToken("key", "principal",
            Collections.<GrantedAuthority>singletonList(Permission.INVOKE_UPDATE));
    token.setDetails("details");
    setAuthentication(token);//from   w  w w  . ja  va  2 s  .c  o m
    request.setMethod(HttpMethod.GET.name());
    subject.doFilter(request, response, chain);
    final Authentication filtered = getAuthentication();
    assertThat(filtered, instanceOf(RememberMeAuthenticationToken.class));
    assertThat(filtered.getPrincipal(), equalTo(token.getPrincipal()));
    assertThat(filtered.getDetails(), equalTo(token.getDetails()));
}