@Test
public void testGetAuthenticatedUser() throws Exception {
List<GrantedAuthority> grantedAuthorities = new ArrayList<GrantedAuthority>();
grantedAuthorities.add(new SimpleGrantedAuthority("ROLE_USER"));
UserDetails userDetails = new UserImpl("1", "canonical");
Authentication authentication = new TestingAuthenticationToken(userDetails, "canonical", grantedAuthorities);
SecurityContextHolder.getContext().setAuthentication(authentication);
User returnedUser = userService.getAuthenticatedUser();
assertEquals(returnedUser, userDetails);