userDetails = mock(UserDetails.class);
mockUserDetails(userDetails);
mockUaaWithUser();
userAttributes = new LinkedMultiValueMap<>();
userAttributes.put("1", Arrays.asList("1"));
<BUG>userAttributes.put("2", Arrays.asList("2", "3"));
}</BUG>
private void mockUaaWithUser() {
applicationEventPublisher = mock(ApplicationEventPublisher.class);
uaaUserDatabase = mock(UaaUserDatabase.class);

userDetails = mock(UserDetails.class);
mockUserDetails(userDetails);
mockUaaWithUser();
userAttributes = new LinkedMultiValueMap<>();
userAttributes.put("1", Arrays.asList("1"));
userAttributes.put("2", Arrays.asList("2", "3"));
externalGroups = Arrays.asList("role1", "role2", "role3");
}
private void mockUaaWithUser() {
applicationEventPublisher = mock(ApplicationEventPublisher.class);
uaaUserDatabase = mock(UaaUserDatabase.class);
