DuracloudUserDetails extends User implements UserDetails { public List<String> getGroups() { return groups; } DuracloudUserDetails(String username,
                                String password,
                                String email,
                                String ipLimits,
                                boolean enabled,
                                boolean accountNonExpired,
                                boolean credentialsNonExpired,
                                boolean accountNonLocked,
                                Collection<GrantedAuthority> authorities,
                                List<String> groups); String getEmail(); String getIpLimits(); @Override void eraseCredentials(); List<String> getGroups();  }
@Test public void testGetGroupsNull() throws Exception { List<String> expected = null; DuracloudUserDetails userDetails = createDuracloudUserDetails(expected); verifyGroups(expected, userDetails.getGroups()); }
@Test public void testGetGroupsEmpty() throws Exception { List<String> expected = new ArrayList<String>(); DuracloudUserDetails userDetails = createDuracloudUserDetails(expected); verifyGroups(expected, userDetails.getGroups()); }
@Test public void testGetGroups() throws Exception { List<String> expected = new ArrayList<String>(); expected.add("group.0"); expected.add("group.1"); expected.add("group.5"); DuracloudUserDetails userDetails = createDuracloudUserDetails(expected); verifyGroups(expected, userDetails.getGroups()); }