AmbariAuthentication implements Authentication, UserIdAuthentication { @Override public Object getDetails() { return authentication.getDetails(); } AmbariAuthentication(Authentication authentication, Integer userId); @Override Collection<? extends GrantedAuthority> getAuthorities(); @Override Object getCredentials(); @Override Object getDetails(); @Override Object getPrincipal(); @Override boolean isAuthenticated(); @Override void setAuthenticated(boolean isAuthenticated); @Override String getName(); @Override boolean equals(Object o); @Override int hashCode(); @Override Integer getUserId();  }
@Test public void testGetDetails() throws Exception { TestingAuthenticationToken authentication = new TestingAuthenticationToken("user", "password"); authentication.setDetails("test auth details"); Authentication ambariAuthentication = new AmbariAuthentication(authentication, DEFAULT_USER_ID); Object authDetails = ambariAuthentication.getDetails(); Object expecteAuthDetails = authentication.getDetails(); assertSame(expecteAuthDetails, authDetails); }