use of org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken in project spring-security by spring-projects.
the class JwtAuthenticationTokenTests method getNameWhenConstructedWithNameThenReturnsProvidedName.
@Test
public void getNameWhenConstructedWithNameThenReturnsProvidedName() {
Collection<GrantedAuthority> authorities = AuthorityUtils.createAuthorityList("test");
Jwt jwt = builder().claim("claim", "value").build();
JwtAuthenticationToken token = new JwtAuthenticationToken(jwt, authorities, "Hayden");
assertThat(token.getName()).isEqualTo("Hayden");
}
Aggregations