@Test public void getSubaccountId() { XsuaaToken userTokenWithSubaccountId = Mockito.spy(userToken); when(userTokenWithSubaccountId.getClaimAsJsonObject(TokenClaims.XSUAA.EXTERNAL_ATTRIBUTE)) .thenReturn(new DefaultJsonObject("{\"subaccountid\": \"abc123\"}")); assertThat(userTokenWithSubaccountId.getSubaccountId()).isEqualTo("abc123"); }
@Nullable public String getSubaccountId() { return Optional.ofNullable(getAttributeFromClaimAsString(EXTERNAL_ATTRIBUTE, EXTERNAL_ATTRIBUTE_SUBACCOUNTID)) .orElse(getClaimAsString(ZONE_ID)); }
XsuaaToken extends AbstractToken implements AccessToken { @Nullable public String getSubaccountId() { return Optional.ofNullable(getAttributeFromClaimAsString(EXTERNAL_ATTRIBUTE, EXTERNAL_ATTRIBUTE_SUBACCOUNTID)) .orElse(getClaimAsString(ZONE_ID)); } }
XsuaaToken extends AbstractToken implements AccessToken { @Nullable public String getSubaccountId() { return Optional.ofNullable(getAttributeFromClaimAsString(EXTERNAL_ATTRIBUTE, EXTERNAL_ATTRIBUTE_SUBACCOUNTID)) .orElse(getClaimAsString(ZONE_ID)); } XsuaaToken(@Nonnull DecodedJwt decodedJwt);  XsuaaToken(@Nonnull String accessToken); }
XsuaaToken extends AbstractToken implements AccessToken { @Nullable public String getSubaccountId() { return Optional.ofNullable(getAttributeFromClaimAsString(EXTERNAL_ATTRIBUTE, EXTERNAL_ATTRIBUTE_SUBACCOUNTID)) .orElse(getClaimAsString(ZONE_ID)); } XsuaaToken(@Nonnull DecodedJwt decodedJwt);  XsuaaToken(@Nonnull String accessToken); XsuaaToken withScopeConverter(@Nullable ScopeConverter converter); @Override Set<String> getScopes(); @Override Principal getPrincipal(); @Override Service getService(); @Override boolean hasScope(String scope); @Override boolean hasLocalScope(@Nonnull String scope); @Override GrantType getGrantType(); @Nullable String getSubdomain(); @Nullable String getSubaccountId(); @Override String getZoneId(); }
XsuaaToken extends AbstractToken implements AccessToken { @Nullable public String getSubaccountId() { return Optional.ofNullable(getAttributeFromClaimAsString(EXTERNAL_ATTRIBUTE, EXTERNAL_ATTRIBUTE_SUBACCOUNTID)) .orElse(getClaimAsString(ZONE_ID)); } XsuaaToken(@Nonnull DecodedJwt decodedJwt);  XsuaaToken(@Nonnull String accessToken); XsuaaToken withScopeConverter(@Nullable ScopeConverter converter); @Override Set<String> getScopes(); @Override Principal getPrincipal(); @Override Service getService(); @Override boolean hasScope(String scope); @Override boolean hasLocalScope(@Nonnull String scope); @Override GrantType getGrantType(); @Nullable String getSubdomain(); @Nullable String getSubaccountId(); @Override String getZoneId();  }