Program: 114901
Project: 114901
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 ((userManagementClient != null) && !userManagementClient.userNameExists("String_Node_Str",subscriberUser)) {
    userManagementClient.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);
  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");
  String decodedJWTString=APIMTestCaseUtils.getDecodedJWT(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"));
  String jwtHeader=APIMTestCaseUtils.getDecodedJWTHeader(serverMessage);
  byte[] jwtSignature=APIMTestCaseUtils.getDecodedJWTSignature(serverMessage);
  String jwtAssertion=APIMTestCaseUtils.getJWTAssertion(serverMessage);
  boolean isSignatureValid=APIMTestCaseUtils.isJwtSignatureValid(jwtAssertion,jwtSignature,jwtHeader);
  assertTrue("String_Node_Str",isSignatureValid);
  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);
}

Fixed version (ground truth):
@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);
  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");
  String decodedJWTString=APIMTestCaseUtils.getDecodedJWT(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"));
  String jwtHeader=APIMTestCaseUtils.getDecodedJWTHeader(serverMessage);
  byte[] jwtSignature=APIMTestCaseUtils.getDecodedJWTSignature(serverMessage);
  String jwtAssertion=APIMTestCaseUtils.getJWTAssertion(serverMessage);
  boolean isSignatureValid=APIMTestCaseUtils.isJwtSignatureValid(jwtAssertion,jwtSignature,jwtHeader);
  assertTrue("String_Node_Str",isSignatureValid);
  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);
}