@Test public void isAdmin(){ assertTrue(auth.isAdmin(auth.authenticate("user1","password1"))); assertTrue(auth.isAdmin(auth.authenticate("user2","password2"))); assertFalse(auth.isAdmin(auth.authenticate("user3","password3"))); }
@Override boolean isAdmin(User user) { if (user == null) { return false; } return (inner != null && inner.isAdmin(user)) || (outer != null && outer.isAdmin(user)); }
AuthenticationManagerNested extends AuthenticationManager { @Override boolean isAdmin(User user) { if (user == null) { return false; } return (inner != null && inner.isAdmin(user)) || (outer != null && outer.isAdmin(user)); } }
AuthenticationManagerNested extends AuthenticationManager { @Override boolean isAdmin(User user) { if (user == null) { return false; } return (inner != null && inner.isAdmin(user)) || (outer != null && outer.isAdmin(user)); } @JsonCreator  AuthenticationManagerNested(@JsonProperty("inner") AuthenticationManager inner,
                                       @JsonProperty("outer") AuthenticationManager outer); }
AuthenticationManagerNested extends AuthenticationManager { @Override boolean isAdmin(User user) { if (user == null) { return false; } return (inner != null && inner.isAdmin(user)) || (outer != null && outer.isAdmin(user)); } @JsonCreator  AuthenticationManagerNested(@JsonProperty("inner") AuthenticationManager inner,
                                       @JsonProperty("outer") AuthenticationManager outer); @Override boolean verify(String username, String password, boolean ssl); @Override void evict(String username); @Override void close(); }
AuthenticationManagerNested extends AuthenticationManager { @Override boolean isAdmin(User user) { if (user == null) { return false; } return (inner != null && inner.isAdmin(user)) || (outer != null && outer.isAdmin(user)); } @JsonCreator  AuthenticationManagerNested(@JsonProperty("inner") AuthenticationManager inner,
                                       @JsonProperty("outer") AuthenticationManager outer); @Override boolean verify(String username, String password, boolean ssl); @Override void evict(String username); @Override void close();  }