### Question:
XSUserInfoAdapter implements XSUserInfo { @Override public String getHdbToken() { return getToken(SYSTEM, HDB); } XSUserInfoAdapter(Object accessToken);  XSUserInfoAdapter(AccessToken accessToken);   XSUserInfoAdapter(Object accessToken, OAuth2ServiceConfiguration configuration); @Override String getLogonName(); @Override String getGivenName(); @Override String getFamilyName(); @Override String getOrigin(); @Override String getIdentityZone(); @Override /** * "ext_attr": { "enhancer": "XSUAA", "subaccountid": "my-subaccount-1234" }, */ String getSubaccountId(); @Override String getZoneId(); @Override /** * "ext_attr": { "enhancer": "XSUAA", "zdn": "paas-subdomain" }, */ String getSubdomain(); @Override String getClientId(); @Override String getJsonValue(String attribute); @Override String getEmail(); @Override String getDBToken(); @Override String getHdbToken(); @Override String getAppToken(); @Override String getToken(String namespace, String name); @Override String[] getAttribute(String attributeName); @Override boolean hasAttributes(); @Override String[] getSystemAttribute(String attributeName); @Override boolean checkScope(String scope); @Override boolean checkLocalScope(String scope); @Override String getAdditionalAuthAttribute(String attributeName); @Override String getCloneServiceInstanceId(); @Override String getGrantType(); @Override boolean isInForeignMode(); @Override String requestTokenForClient(String clientId, String clientSecret, String baseUaaUrl); @Override String requestTokenForUser(String clientId, String clientSecret, String baseUaaUrl); @Override String requestToken(XSTokenRequest tokenRequest);  }### Answer:
@Test public void testGetHdbToken() throws XSUserInfoException { assertThat(cut.getHdbToken()).isEqualTo(cut.getAppToken()); }
@Test public void getHdbToken_AuthCodeToken_NoAttributes() throws XSUserInfoException, IOException { XsuaaToken token = new XsuaaToken( IOUtils.resourceToString("/xsuaaXsaAccessTokenRSA256_signedWithVerificationKey.txt", UTF_8)); OAuth2ServiceConfiguration configuration = OAuth2ServiceConfigurationBuilder.forService(Service.XSUAA) .withClientId("sb-java-hello-world!i1") .withProperty(CFConstants.XSUAA.APP_ID, "java-hello-world!i1") .withProperty(IDENTITY_ZONE, "uaa") .withProperty("identityzoneid", "uaa") .build(); cut = new XSUserInfoAdapter(token, configuration); assertThat(cut.getHdbToken()).isNotNull(); assertThat(cut.getHdbToken()).startsWith("eyJhbGciOiAiUlMyNTYiLCJ0eXAiOiAiS"); }