@Test public void testGetPayload() { String payload = "eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJteXByb2plY3QiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlY3JldC5uYW1lIjoiZGVmYXVsdC10b2tlbi1ydHE2ayIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiZjgwYjU0YTktYTcxMC0xMWU5LTg1NzEtMzIxZjFhYzFmNTlkIiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Om15cHJvamVjdDpkZWZhdWx0In0"; assertEquals(payload, OAuthBearerTokenImpl.getPayload(SAMPLE_TOKEN)); }
static String getPayload(String token) { int first = token.indexOf('.'); int last = token.lastIndexOf('.'); return token.substring(first+1, last); }
OAuthBearerTokenImpl implements OAuthBearerToken { static String getPayload(String token) { int first = token.indexOf('.'); int last = token.lastIndexOf('.'); return token.substring(first+1, last); } }
OAuthBearerTokenImpl implements OAuthBearerToken { static String getPayload(String token) { int first = token.indexOf('.'); int last = token.lastIndexOf('.'); return token.substring(first+1, last); } OAuthBearerTokenImpl(String token); }
OAuthBearerTokenImpl implements OAuthBearerToken { static String getPayload(String token) { int first = token.indexOf('.'); int last = token.lastIndexOf('.'); return token.substring(first+1, last); } OAuthBearerTokenImpl(String token); @Override String value(); @Override Set<String> scope(); @Override long lifetimeMs(); @Override String principalName(); @Override Long startTimeMs(); @Override String toString(); }
OAuthBearerTokenImpl implements OAuthBearerToken { static String getPayload(String token) { int first = token.indexOf('.'); int last = token.lastIndexOf('.'); return token.substring(first+1, last); } OAuthBearerTokenImpl(String token); @Override String value(); @Override Set<String> scope(); @Override long lifetimeMs(); @Override String principalName(); @Override Long startTimeMs(); @Override String toString();  }