@Test
 public void testIssuerInResults() throws Exception {
   tokenServices.setIssuer("http://some.other.issuer");
   tokenServices.afterPropertiesSet();
   accessToken = tokenServices.createAccessToken(authentication);
   Map<String, ?> result = endpoint.checkToken(accessToken.getValue());
   assertNotNull("iss field is not present", result.get("iss"));
   assertEquals("http://some.other.issuer/oauth/token", result.get("iss"));
 }
 @Test
 public void testIssuerInResultsInNonDefaultZone() throws Exception {
   try {
     IdentityZoneHolder.set(MultitenancyFixture.identityZone("id", "subdomain"));
     tokenServices.setIssuer("http://some.other.issuer");
     tokenServices.afterPropertiesSet();
     accessToken = tokenServices.createAccessToken(authentication);
     Map<String, ?> result = endpoint.checkToken(accessToken.getValue());
     assertNotNull("iss field is not present", result.get("iss"));
     assertEquals("http://subdomain.some.other.issuer/oauth/token", result.get("iss"));
   } finally {
     IdentityZoneHolder.clear();
   }
 }
 @Test(expected = InvalidTokenException.class)
 public void testRejectInvalidIssuer() {
   tokenServices.setIssuer("http://some.other.issuer");
   endpoint.checkToken(accessToken.getValue());
 }