Program: 114827
Project: 114827
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str",enabled=true,dependsOnMethods="String_Node_Str") public void testSpecificUserJWTClaims() throws Exception {
  String accessToken;
  userManagementClient1=new UserManagementClient(keyManagerContext.getContextUrls().getBackEndUrl(),user.getUserName(),user.getPassword());
  if (!userManagementClient1.roleNameExists(INTERNAL_ROLE_SUBSCRIBER)) {
    userManagementClient1.addInternalRole(ROLE_SUBSCRIBER,new String[]{},new String[]{"String_Node_Str","String_Node_Str"});
  }
  if (!userManagementClient1.userNameExists(INTERNAL_ROLE_SUBSCRIBER,subscriberUsername)) {
    userManagementClient1.addUser(subscriberUsername,subscriberUserPassword,new String[]{INTERNAL_ROLE_SUBSCRIBER},null);
  }
  RemoteUserStoreManagerServiceClient remoteUserStoreManagerServiceClient=new RemoteUserStoreManagerServiceClient(keyManagerContext.getContextUrls().getBackEndUrl(),user.getUserName(),user.getPassword());
  String profile="String_Node_Str";
  remoteUserStoreManagerServiceClient.setUserClaimValue(subscriberUsername,"String_Node_Str","String_Node_Str",profile);
  remoteUserStoreManagerServiceClient.setUserClaimValue(subscriberUsername,"String_Node_Str","String_Node_Str",profile);
  ServerConfigurationManager serverConfigManagerForTenant=new ServerConfigurationManager(superTenantKeyManagerContext);
  serverConfigManagerForTenant.restartGracefully();
  super.init(userMode);
  User subscriberUser=new User();
  subscriberUser.setUserName(subscriberUserWithTenantDomain);
  subscriberUser.setPassword(subscriberUserPassword);
  addAndSubscribeToAPI(apiName2,apiVersion,apiContext2,description,backendURL,tags,providerName,subscriberUser);
  APIStoreRestClient apiStoreRestClient=new APIStoreRestClient(storeURLHttp);
  apiStoreRestClient.login(subscriberUserWithTenantDomain,subscriberUserPassword);
  APPKeyRequestGenerator generateAppKeyRequest=new APPKeyRequestGenerator(applicationName);
  String responseString=apiStoreRestClient.generateApplicationKey(generateAppKeyRequest).getData();
  accessToken=new JSONObject(responseString).getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").get("String_Node_Str").toString();
  HttpClient httpclient=HttpClientBuilder.create().build();
  HttpGet get=new HttpGet(getAPIInvocationURLHttp(apiContext2,apiVersion));
  get.addHeader("String_Node_Str","String_Node_Str" + accessToken);
  HttpResponse response=httpclient.execute(get);
  Assert.assertEquals(response.getStatusLine().getStatusCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  Header[] responseHeaders=response.getAllHeaders();
  Header jwtheader=pickHeader(responseHeaders,JWT_ASSERTION_HEADER);
  Assert.assertNotNull(jwtheader,JWT_ASSERTION_HEADER + "String_Node_Str");
  String decodedJWTString=APIMTestCaseUtils.getDecodedJWT(jwtheader.getValue());
  log.debug("String_Node_Str" + decodedJWTString);
  JSONObject jsonObject=new JSONObject(decodedJWTString);
  String claim=jsonObject.getString("String_Node_Str");
  assertTrue("String_Node_Str",claim.contains("String_Node_Str"));
  claim=jsonObject.getString("String_Node_Str");
  assertTrue("String_Node_Str" + claim,claim.contains(subscriberUsername));
  claim=jsonObject.getString("String_Node_Str");
  assertTrue("String_Node_Str" + claim,claim.contains(applicationName));
  apiStoreRestClient.removeAPISubscriptionByApplicationName(apiName2,apiVersion,providerName,applicationName);
  apiStoreRestClient.removeApplication(applicationName);
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str",enabled=true,dependsOnMethods="String_Node_Str") public void testSpecificUserJWTClaims() throws Exception {
  String accessToken;
  userManagementClient1=new UserManagementClient(keyManagerContext.getContextUrls().getBackEndUrl(),user.getUserName(),user.getPassword());
  if (!userManagementClient1.roleNameExists(INTERNAL_ROLE_SUBSCRIBER)) {
    userManagementClient1.addInternalRole(ROLE_SUBSCRIBER,new String[]{},new String[]{"String_Node_Str","String_Node_Str"});
  }
  if (!userManagementClient1.userNameExists(INTERNAL_ROLE_SUBSCRIBER,subscriberUsername)) {
    userManagementClient1.addUser(subscriberUsername,subscriberUserPassword,new String[]{INTERNAL_ROLE_SUBSCRIBER},null);
  }
  RemoteUserStoreManagerServiceClient remoteUserStoreManagerServiceClient=new RemoteUserStoreManagerServiceClient(keyManagerContext.getContextUrls().getBackEndUrl(),user.getUserName(),user.getPassword());
  String profile="String_Node_Str";
  remoteUserStoreManagerServiceClient.setUserClaimValue(subscriberUsername,"String_Node_Str","String_Node_Str",profile);
  remoteUserStoreManagerServiceClient.setUserClaimValue(subscriberUsername,"String_Node_Str","String_Node_Str",profile);
  ServerConfigurationManager serverConfigManagerForTenant=new ServerConfigurationManager(superTenantKeyManagerContext);
  serverConfigManagerForTenant.restartGracefully();
  super.init(userMode);
  User subscriberUser=new User();
  subscriberUser.setUserName(subscriberUserWithTenantDomain);
  subscriberUser.setPassword(subscriberUserPassword);
  addAndSubscribeToAPI(apiName2,apiVersion,apiContext2,description,tags,providerName,subscriberUser);
  APIStoreRestClient apiStoreRestClient=new APIStoreRestClient(storeURLHttp);
  apiStoreRestClient.login(subscriberUserWithTenantDomain,subscriberUserPassword);
  APPKeyRequestGenerator generateAppKeyRequest=new APPKeyRequestGenerator(applicationName);
  String responseString=apiStoreRestClient.generateApplicationKey(generateAppKeyRequest).getData();
  accessToken=new JSONObject(responseString).getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").get("String_Node_Str").toString();
  HttpClient httpclient=HttpClientBuilder.create().build();
  HttpGet get=new HttpGet(getAPIInvocationURLHttp(apiContext2,apiVersion));
  get.addHeader("String_Node_Str","String_Node_Str" + accessToken);
  HttpResponse response=httpclient.execute(get);
  Assert.assertEquals(response.getStatusLine().getStatusCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  Header[] responseHeaders=response.getAllHeaders();
  Header jwtheader=pickHeader(responseHeaders,JWT_ASSERTION_HEADER);
  Assert.assertNotNull(jwtheader,JWT_ASSERTION_HEADER + "String_Node_Str");
  String decodedJWTString=APIMTestCaseUtils.getDecodedJWT(jwtheader.getValue());
  log.debug("String_Node_Str" + decodedJWTString);
  JSONObject jsonObject=new JSONObject(decodedJWTString);
  String claim=jsonObject.getString("String_Node_Str");
  assertTrue("String_Node_Str",claim.contains("String_Node_Str"));
  claim=jsonObject.getString("String_Node_Str");
  assertTrue("String_Node_Str" + claim,claim.contains(subscriberUsername));
  claim=jsonObject.getString("String_Node_Str");
  assertTrue("String_Node_Str" + claim,claim.contains(applicationName));
  apiStoreRestClient.removeAPISubscriptionByApplicationName(apiName2,apiVersion,providerName,applicationName);
  apiStoreRestClient.removeApplication(applicationName);
}