### Question:
KnoxPamRealm extends org.apache.knox.gateway.shirorealm.KnoxPamRealm { @Override protected AuthenticationInfo doGetAuthenticationInfo( AuthenticationToken token) throws AuthenticationException { return super.doGetAuthenticationInfo(token); } KnoxPamRealm();   }### Answer:
@Test public void testDoGetAuthenticationInfo() { KnoxPamRealm realm = new KnoxPamRealm(); realm.setService("sshd"); String pamuser = System.getenv("PAMUSER"); String pampass = System.getenv("PAMPASS"); assumeTrue(pamuser != null); assumeTrue(pampass != null); UsernamePasswordToken authToken = createMock(UsernamePasswordToken.class); expect(authToken.getUsername()).andReturn(pamuser); expect(authToken.getPassword()).andReturn(pampass.toCharArray()); expect(authToken.getCredentials()).andReturn(pampass); replay(authToken); AuthenticationInfo authInfo = realm.doGetAuthenticationInfo(authToken); assertNotNull(authInfo.getCredentials()); }