@Test
public void testUserDetailsMapping() {

    MockUserDetailsWithAttributes detailsWithAttributes =  new MockUserDetailsWithAttributes();
    mapper = new UserDetailsExpressionUserMapper(attributeMappings);
    User user = new User();
    detailsWithAttributes.getAttributes().put("sample", "mock");
    attributeMappings.put("transformed", "sample");
    mapper.mapUser(detailsWithAttributes, user);
    
    assertEquals(1, user.getAttribute().size());
    assertEquals("transformed", user.getAttribute().get(0).getName());
    assertEquals("mock", user.getAttribute().get(0).getValue());
}