private ITenant tenant = mock( ITenant.class );
@Test
public void testGetRolesForUser() throws Exception {
IUserRoleListService mockService = mock( IUserRoleListService.class );
when( mockService.getRolesForUser( tenant, "joe" ) ).thenReturn( Arrays.asList( "foo", "bar" ) );
when( mockService.getRolesForUser( tenant, "admin" ) ).thenReturn( Arrays.asList( "foo", "bar" ) );
CachingUserRoleListServiceDecorator decorator = new CachingUserRoleListServiceDecorator( mockService );
List<String> allRoles = decorator.getRolesForUser( tenant, "joe" );
assertArrayEquals( "does not match", new String[] { "foo", "bar" }, allRoles.toArray() );