@Test public void isAdminNotAndWrongAuthorities() { List<GrantedAuthority> authorities = singletonList(new SimpleGrantedAuthority("ROLE_NO")); HumanCoffeeNetUser sut = new HumanCoffeeNetUser("username", "email@coffeenet", authorities); assertThat(sut.isCoffeeNetAdmin(), is(false)); }
@Override public boolean isCoffeeNetAdmin() { return getAuthorities().contains(new SimpleGrantedAuthority("ROLE_COFFEENET-ADMIN")); }
HumanCoffeeNetUser extends AbstractCoffeeNetUser { @Override public boolean isCoffeeNetAdmin() { return getAuthorities().contains(new SimpleGrantedAuthority("ROLE_COFFEENET-ADMIN")); } }
HumanCoffeeNetUser extends AbstractCoffeeNetUser { @Override public boolean isCoffeeNetAdmin() { return getAuthorities().contains(new SimpleGrantedAuthority("ROLE_COFFEENET-ADMIN")); } HumanCoffeeNetUser(String username, String email, Collection<GrantedAuthority> authorities); }
HumanCoffeeNetUser extends AbstractCoffeeNetUser { @Override public boolean isCoffeeNetAdmin() { return getAuthorities().contains(new SimpleGrantedAuthority("ROLE_COFFEENET-ADMIN")); } HumanCoffeeNetUser(String username, String email, Collection<GrantedAuthority> authorities); @Override String getUsername(); @Override String getEmail(); @Override Collection<GrantedAuthority> getAuthorities(); @Override boolean isCoffeeNetAdmin(); @Override boolean isMachineUser(); @Override String toString(); }
HumanCoffeeNetUser extends AbstractCoffeeNetUser { @Override public boolean isCoffeeNetAdmin() { return getAuthorities().contains(new SimpleGrantedAuthority("ROLE_COFFEENET-ADMIN")); } HumanCoffeeNetUser(String username, String email, Collection<GrantedAuthority> authorities); @Override String getUsername(); @Override String getEmail(); @Override Collection<GrantedAuthority> getAuthorities(); @Override boolean isCoffeeNetAdmin(); @Override boolean isMachineUser(); @Override String toString();  }