Program: 114847
Project: 114847
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str",enabled=true) public void testSpecificUserJWTClaims() throws Exception {
  server.setFinished(false);
  server.start();
  String subscriberUser="String_Node_Str";
  String password="String_Node_Str";
  String accessToken;
  if ((userManagementClient1 != null) && !userManagementClient1.userNameExists("String_Node_Str",subscriberUser)) {
    userManagementClient1.addUser(subscriberUser,password,new String[]{"String_Node_Str"},null);
  }
  RemoteUserStoreManagerServiceClient remoteUserStoreManagerServiceClient=new RemoteUserStoreManagerServiceClient(keyManagerContext.getContextUrls().getBackEndUrl(),keyManagerContext.getContextTenant().getContextUser().getUserName(),keyManagerContext.getContextTenant().getContextUser().getPassword());
  String profile="String_Node_Str";
  remoteUserStoreManagerServiceClient.setUserClaimValue(subscriberUser,"String_Node_Str","String_Node_Str",profile);
  remoteUserStoreManagerServiceClient.setUserClaimValue(subscriberUser,"String_Node_Str","String_Node_Str",profile);
  serverConfigurationManager.restartGracefully();
  super.init();
  APIStoreRestClient apiStoreRestClient=new APIStoreRestClient(storeURLHttp);
  apiStoreRestClient.login(subscriberUser,password);
  apiStoreRestClient.addApplication(applicationName,APIMIntegrationConstants.APPLICATION_TIER.LARGE,"String_Node_Str","String_Node_Str");
  SubscriptionRequest subscriptionRequest=new SubscriptionRequest(apiName,providerName);
  subscriptionRequest.setApplicationName(applicationName);
  apiStoreRestClient.subscribe(subscriptionRequest);
  APPKeyRequestGenerator generateAppKeyRequest=new APPKeyRequestGenerator(applicationName);
  String responseString=apiStoreRestClient.generateApplicationKey(generateAppKeyRequest).getData();
  JSONObject response=new JSONObject(responseString);
  if (response.getJSONObject("String_Node_Str") == null) {
    log.info("String_Node_Str");
    serverConfigurationManager.restartGracefully();
    super.init();
    Thread.sleep(10000);
    responseString=apiStoreRestClient.generateApplicationKey(generateAppKeyRequest).getData();
    response=new JSONObject(responseString);
  }
  accessToken=response.getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").get("String_Node_Str").toString();
  String url=gatewayUrlsWrk.getWebAppURLNhttp() + "String_Node_Str";
  APIMTestCaseUtils.sendGetRequest(url,accessToken);
  String serverMessage=server.getCapturedMessage();
  Assert.assertTrue(serverMessage.contains("String_Node_Str"),"String_Node_Str" + serverMessage);
  String decodedJWTString=APIMTestCaseUtils.getDecodedURLSafeJWT(serverMessage);
  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("String_Node_Str"));
  claim=jsonObject.getString("String_Node_Str");
  assertTrue("String_Node_Str" + claim,claim.contains("String_Node_Str"));
  apiStoreRestClient.removeAPISubscriptionByApplicationName(apiName,apiVersion,providerName,applicationName);
  apiStoreRestClient.removeApplication(applicationName);
  Thread.sleep(20000);
  Thread.sleep(20000);
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str",enabled=true,dependsOnMethods="String_Node_Str") public void testSpecificUserJWTClaims() throws Exception {
  server.setFinished(false);
  server.start();
  String subscriberUser="String_Node_Str" + user.getUserDomain();
  String password="String_Node_Str";
  String accessToken;
  if ((userManagementClient1 != null) && !userManagementClient1.userNameExists("String_Node_Str",subscriberUser)) {
    userManagementClient1.addUser(subscriberUser,password,new String[]{"String_Node_Str"},null);
  }
  RemoteUserStoreManagerServiceClient remoteUserStoreManagerServiceClient=new RemoteUserStoreManagerServiceClient(keyManagerContext.getContextUrls().getBackEndUrl(),keyManagerContext.getContextTenant().getContextUser().getUserName(),keyManagerContext.getContextTenant().getContextUser().getPassword());
  String profile="String_Node_Str";
  remoteUserStoreManagerServiceClient.setUserClaimValue(subscriberUser,"String_Node_Str","String_Node_Str",profile);
  remoteUserStoreManagerServiceClient.setUserClaimValue(subscriberUser,"String_Node_Str","String_Node_Str",profile);
  ServerConfigurationManager serverConfigManagerForTenant=new ServerConfigurationManager(superTenantKeyManagerContext);
  serverConfigManagerForTenant.restartGracefully();
  super.init(userMode);
  waitForAPIDeploymentSync(providerName,apiName,apiVersion,APIMIntegrationConstants.IS_API_EXISTS);
  APIStoreRestClient apiStoreRestClient=new APIStoreRestClient(storeURLHttp);
  apiStoreRestClient.login(subscriberUser,password);
  apiStoreRestClient.addApplication(applicationName,APIMIntegrationConstants.APPLICATION_TIER.LARGE,"String_Node_Str","String_Node_Str");
  SubscriptionRequest subscriptionRequest=new SubscriptionRequest(apiName,providerName);
  subscriptionRequest.setApplicationName(applicationName);
  apiStoreRestClient.subscribe(subscriptionRequest);
  APPKeyRequestGenerator generateAppKeyRequest=new APPKeyRequestGenerator(applicationName);
  String responseString=apiStoreRestClient.generateApplicationKey(generateAppKeyRequest).getData();
  JSONObject response=new JSONObject(responseString);
  accessToken=response.getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").get("String_Node_Str").toString();
  String url=getAPIInvocationURLHttp("String_Node_Str","String_Node_Str");
  APIMTestCaseUtils.sendGetRequest(url,accessToken);
  String serverMessage=server.getCapturedMessage();
  log.info("String_Node_Str" + serverMessage);
  Assert.assertTrue(serverMessage.contains("String_Node_Str"),"String_Node_Str" + serverMessage);
  String decodedJWTString=APIMTestCaseUtils.getDecodedURLSafeJWT(serverMessage);
  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("String_Node_Str"));
  claim=jsonObject.getString("String_Node_Str");
  assertTrue("String_Node_Str" + claim,claim.contains("String_Node_Str"));
  apiStoreRestClient.removeAPISubscriptionByApplicationName(apiName,apiVersion,providerName,applicationName);
  apiStoreRestClient.removeApplication(applicationName);
}