nus-yam/ex-repair huggingface dataset:
Program: 114836
Project: 114836
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testEditEndPointURL() throws APIManagerIntegrationTestException, MalformedURLException {
  APICreationRequestBean apiCreationRequestBeanUpdate=new APICreationRequestBean(API_NAME,API_CONTEXT,API_VERSION_1_0_0,providerName,new URL(API2_END_POINT_URL));
  apiCreationRequestBeanUpdate.setTags(API_TAGS);
  apiCreationRequestBeanUpdate.setDescription(API_DESCRIPTION);
  HttpResponse updateAPIHTTPResponse=apiPublisherClientUser1.updateAPI(apiCreationRequestBeanUpdate);
  assertEquals(updateAPIHTTPResponse.getResponseCode(),HTTP_RESPONSE_CODE_OK,"String_Node_Str" + getAPIIdentifierString(apiIdentifier));
  assertEquals(getValueFromJSON(updateAPIHTTPResponse,"String_Node_Str"),"String_Node_Str","String_Node_Str" + getAPIIdentifierString(apiIdentifier) + "String_Node_Str"+ updateAPIHTTPResponse.getData());
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testEditEndPointURL() throws APIManagerIntegrationTestException, MalformedURLException {
  api2EndPointUrl=getGatewayURLHttp() + API2_END_POINT_POSTFIX_URL;
  APICreationRequestBean apiCreationRequestBeanUpdate=new APICreationRequestBean(API_NAME,API_CONTEXT,API_VERSION_1_0_0,providerName,new URL(api2EndPointUrl));
  apiCreationRequestBeanUpdate.setTags(API_TAGS);
  apiCreationRequestBeanUpdate.setDescription(API_DESCRIPTION);
  HttpResponse updateAPIHTTPResponse=apiPublisherClientUser1.updateAPI(apiCreationRequestBeanUpdate);
  assertEquals(updateAPIHTTPResponse.getResponseCode(),HTTP_RESPONSE_CODE_OK,"String_Node_Str" + getAPIIdentifierString(apiIdentifier));
  assertEquals(getValueFromJSON(updateAPIHTTPResponse,"String_Node_Str"),"String_Node_Str","String_Node_Str" + getAPIIdentifierString(apiIdentifier) + "String_Node_Str"+ updateAPIHTTPResponse.getData());
  waitForAPIDeployment();
}
Program: 114837
Project: 114837
Buggy source:
@AfterClass(alwaysRun=true) public void cleanUpArtifacts() throws APIManagerIntegrationTestException {
  apiStoreClientUser1.removeApplication(APPLICATION_NAME);
  deleteAPI(apiIdentifier,apiPublisherClientUser1);
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void cleanUpArtifacts() throws Exception {
  apiStoreClientUser1.removeApplication(APPLICATION_NAME);
  deleteAPI(apiIdentifier,apiPublisherClientUser1);
  super.cleanUp();
}
Program: 114842
Project: 114842
Buggy source:
private void checkDefaultUserClaims(JSONObject jsonObject) throws JSONException {
  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"));
  claim=jsonObject.getString("String_Node_Str");
  assertTrue("String_Node_Str" + claim,claim.contains(APIMIntegrationConstants.APPLICATION_TIER.LARGE));
  claim=jsonObject.getString("String_Node_Str");
  assertTrue("String_Node_Str" + claim,claim.contains("String_Node_Str" + "String_Node_Str" + jsonObject.getString("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"));
  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"));
  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") && claim.contains("String_Node_Str") && claim.contains("String_Node_Str"));
}

Fixed version (ground truth):
private void checkDefaultUserClaims(JSONObject jsonObject) throws JSONException {
  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(user.getUserName()));
  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(APIMIntegrationConstants.APPLICATION_TIER.LARGE));
  claim=jsonObject.getString("String_Node_Str");
  assertTrue("String_Node_Str" + claim,claim.contains("String_Node_Str" + "String_Node_Str" + jsonObject.getString("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"));
  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"));
  claim=jsonObject.getString("String_Node_Str");
  assertTrue("String_Node_Str" + claim,claim.contains("String_Node_Str") && claim.contains("String_Node_Str"));
}
Program: 114844
Project: 114844
Buggy source:
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  super.cleanUp();
  serverConfigurationManager.restoreToLastConfiguration();
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  super.cleanUp();
  if (TestUserMode.SUPER_TENANT_ADMIN == userMode) {
    serverConfigurationManager.restoreToLastConfiguration();
  }
}
Program: 114845
Project: 114845
Buggy source:
private void addAPI(String apiName,String apiVersion,String apiContext,String description,String endpointURL,String tags,String providerName) throws APIManagerIntegrationTestException, MalformedURLException, XPathExpressionException {
  APIPublisherRestClient apiPublisher=new APIPublisherRestClient(publisherURLHttp);
  apiPublisher.login(publisherContext.getContextTenant().getContextUser().getUserName(),publisherContext.getContextTenant().getContextUser().getPassword());
  APIRequest apiRequest=new APIRequest(apiName,apiContext,new URL(endpointURL));
  apiRequest.setTags(tags);
  apiRequest.setDescription(description);
  apiRequest.setVersion(apiVersion);
  apiRequest.setVisibility("String_Node_Str");
  apiRequest.setProvider(providerName);
  apiPublisher.addAPI(apiRequest);
  APILifeCycleStateRequest updateRequest=new APILifeCycleStateRequest(apiName,providerName,APILifeCycleState.PUBLISHED);
  apiPublisher.changeAPILifeCycleStatus(updateRequest);
}

Fixed version (ground truth):
private void addAPI(String apiName,String apiVersion,String apiContext,String description,String endpointURL,String tags,String providerName) throws APIManagerIntegrationTestException, MalformedURLException, XPathExpressionException {
  APIPublisherRestClient apiPublisher=new APIPublisherRestClient(publisherURLHttp);
  apiPublisher.login(user.getUserName(),user.getPassword());
  APIRequest apiRequest=new APIRequest(apiName,apiContext,new URL(endpointURL));
  apiRequest.setTags(tags);
  apiRequest.setDescription(description);
  apiRequest.setVersion(apiVersion);
  apiRequest.setVisibility("String_Node_Str");
  apiRequest.setProvider(providerName);
  apiPublisher.addAPI(apiRequest);
  APILifeCycleStateRequest updateRequest=new APILifeCycleStateRequest(apiName,providerName,APILifeCycleState.PUBLISHED);
  apiPublisher.changeAPILifeCycleStatus(updateRequest);
  waitForAPIDeploymentSync(providerName,apiName,apiVersion,APIMIntegrationConstants.IS_API_EXISTS);
}
Program: 114846
Project: 114846
Buggy source:
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init();
  publisherURLHttp=getPublisherURLHttp();
  storeURLHttp=getStoreURLHttp();
  serverConfigurationManager=new ServerConfigurationManager(gatewayContextWrk);
  serverConfigurationManager.applyConfigurationWithoutRestart(new File(getAMResourceLocation() + File.separator + "String_Node_Str"+ "String_Node_Str"));
  serverConfigurationManager.applyConfiguration(new File(getAMResourceLocation() + File.separator + "String_Node_Str"+ "String_Node_Str"));
  userManagementClient1=new UserManagementClient(keyManagerContext.getContextUrls().getBackEndUrl(),keyManagerContext.getContextTenant().getContextUser().getUserName(),keyManagerContext.getContextTenant().getContextUser().getPassword());
  URL url=new URL(gatewayUrlsWrk.getWebAppURLHttp());
  wireMonitorURL="String_Node_Str" + url.getHost() + "String_Node_Str"+ hostPort;
  server=new WireMonitorServer(hostPort);
  server.setReadTimeOut(30000);
  server.start();
  String gatewaySessionCookie=createSession(gatewayContextMgt);
  loadSynapseConfigurationFromClasspath("String_Node_Str" + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str",gatewayContextMgt,gatewaySessionCookie);
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init(userMode);
  publisherURLHttp=getPublisherURLHttp();
  storeURLHttp=getStoreURLHttp();
  if (TestUserMode.SUPER_TENANT_ADMIN == userMode) {
    serverConfigurationManager=new ServerConfigurationManager(gatewayContextWrk);
    serverConfigurationManager.applyConfigurationWithoutRestart(new File(getAMResourceLocation() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"));
    serverConfigurationManager.applyConfiguration(new File(getAMResourceLocation() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"));
    hostPort=9989;
  }
  userManagementClient1=new UserManagementClient(keyManagerContext.getContextUrls().getBackEndUrl(),user.getUserName(),user.getPassword());
  URL url=new URL(gatewayUrlsWrk.getWebAppURLHttp());
  wireMonitorURL="String_Node_Str" + url.getHost() + "String_Node_Str"+ hostPort;
  server=new WireMonitorServer(hostPort);
  server.setReadTimeOut(30000);
  server.start();
  providerName=user.getUserName();
}
Program: 114848
Project: 114848
Buggy source:
@BeforeClass(alwaysRun=true) public void setEnvironment() throws AutomationUtilException, XPathExpressionException, IOException, APIManagerIntegrationTestException, URISyntaxException, ResourceAdminServiceExceptionException {
  super.init();
  ServerConfigurationManager serverConfigurationManager;
  serverConfigurationManager=new ServerConfigurationManager(gatewayContextMgt);
  serverConfigurationManager.copyToComponentLib(new File(getAMResourceLocation() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"));
  serverConfigurationManager.restartGracefully();
  publisherURLHttp=getPublisherURLHttp();
  storeURLHttp=getStoreURLHttp();
  userName=user.getUserName();
  resourceAdminServiceClient=new ResourceAdminServiceClient(gatewayContextMgt.getContextUrls().getBackEndUrl(),createSession(gatewayContextMgt));
  originalWFExtentionsXML=resourceAdminServiceClient.getTextContent(DEFAULT_WF_EXTENTIONS_XML_REG_CONFIG_LOCATION);
  newWFExtentionsXML=readFile(getAMResourceLocation() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str");
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) public void setEnvironment() throws AutomationUtilException, XPathExpressionException, IOException, APIManagerIntegrationTestException, URISyntaxException, ResourceAdminServiceExceptionException {
  super.init();
  ServerConfigurationManager serverConfigurationManager;
  serverConfigurationManager=new ServerConfigurationManager(gatewayContextMgt);
  serverConfigurationManager.copyToComponentLib(new File(getAMResourceLocation() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"));
  serverConfigurationManager.restartGracefully();
  super.init();
  publisherURLHttp=getPublisherURLHttp();
  storeURLHttp=getStoreURLHttp();
  userName=user.getUserName();
  resourceAdminServiceClient=new ResourceAdminServiceClient(gatewayContextMgt.getContextUrls().getBackEndUrl(),createSession(gatewayContextMgt));
  originalWFExtentionsXML=resourceAdminServiceClient.getTextContent(DEFAULT_WF_EXTENTIONS_XML_REG_CONFIG_LOCATION);
  newWFExtentionsXML=readFile(getAMResourceLocation() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str");
}
Program: 114849
Project: 114849
Buggy source:
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  if (apiStore != null) {
    apiStore.removeApplication(APP_NAME);
  }
  if (apiPublisher != null) {
    apiPublisher.deleteAPI(API_NAME,API_VERSION,apiProvider);
  }
  if (userManagementClient1 != null) {
    userManagementClient1.deleteUser(USER_SAM);
    userManagementClient1.deleteUser(APP_DEV_USER);
    userManagementClient1.deleteRole(SUBSCRIBER_ROLE);
  }
  serverManager.restoreToLastConfiguration();
  serverManager.restartGracefully();
  log.info("String_Node_Str");
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  if (apiStore != null) {
    apiStore.removeApplication(APP_NAME);
  }
  if (apiPublisher != null) {
    apiPublisher.deleteAPI(API_NAME,API_VERSION,apiProvider);
  }
  if (userManagementClient1 != null) {
    userManagementClient1.deleteUser(USER_SAM);
    userManagementClient1.deleteUser(APP_DEV_USER);
    userManagementClient1.deleteRole(SUBSCRIBER_ROLE);
  }
  serverManager.restoreToLastConfiguration();
  log.info("String_Node_Str");
}
Program: 114851
Project: 114851
Buggy source:
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  if (apiPublisher != null) {
    apiPublisher.deleteAPI(API_NAME,API_VERSION,apiProvider);
  }
  serverManager.restoreToLastConfiguration();
  serverManager.restartGracefully();
  log.info("String_Node_Str");
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  if (apiPublisher != null) {
    apiPublisher.deleteAPI(API_NAME,API_VERSION,apiProvider);
  }
  serverManager.restoreToLastConfiguration();
  log.info("String_Node_Str");
}
Program: 114854
Project: 114854
Buggy source:
@Test(groups="String_Node_Str",description="String_Node_Str" + "String_Node_Str") public void testScriptMediatorWithNullObject() throws Exception {
  String endpoint=getGatewayURLNhttp() + "String_Node_Str";
  waitForAPIDeploymentSync(user.getUserName(),APIName,APIVersion,APIMIntegrationConstants.IS_API_EXISTS);
  HttpResponse response=HttpRequestUtil.doGet(endpoint,new HashMap<String,String>());
  assertNotNull(response,"String_Node_Str");
  JSONObject jsonResponse=new JSONObject(response.getData());
  assertEquals(jsonResponse.getString("String_Node_Str"),"String_Node_Str","String_Node_Str" + "String_Node_Str");
  assertEquals(jsonResponse.getString("String_Node_Str"),"String_Node_Str","String_Node_Str" + jsonResponse.getString("String_Node_Str"));
}

Fixed version (ground truth):
@Test(groups="String_Node_Str",description="String_Node_Str" + "String_Node_Str") public void testScriptMediatorWithNullObject() throws Exception {
  String endpoint=getGatewayURLNhttp() + "String_Node_Str";
  waitForAPIDeploymentSync(user.getUserName(),APIName,APIVersion + "String_Node_Str",APIMIntegrationConstants.IS_API_EXISTS);
  HttpResponse response=HttpRequestUtil.doGet(endpoint,new HashMap<String,String>());
  assertNotNull(response,"String_Node_Str");
  JSONObject jsonResponse=new JSONObject(response.getData());
  assertEquals(jsonResponse.getString("String_Node_Str"),"String_Node_Str","String_Node_Str" + "String_Node_Str");
  assertEquals(jsonResponse.getString("String_Node_Str"),"String_Node_Str","String_Node_Str" + jsonResponse.getString("String_Node_Str"));
}
Program: 114855
Project: 114855
Buggy source:
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  String synapseConfFile;
  super.init(userMode);
  gatewaySessionCookie=createSession(gatewayContextMgt);
  if (gatewayContextWrk.getContextTenant().getDomain().equals(FrameworkConstants.SUPER_TENANT_DOMAIN_NAME)) {
    synapseConfFile="String_Node_Str";
  }
 else {
    synapseConfFile="String_Node_Str";
  }
  loadSynapseConfigurationFromClasspath("String_Node_Str" + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ synapseConfFile,gatewayContextMgt,gatewaySessionCookie);
  waitForAPIDeploymentSync(gatewayContextWrk.getContextTenant().getContextUser().getUserName(),"String_Node_Str","String_Node_Str",APIMIntegrationConstants.IS_API_EXISTS);
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  String synapseConfFile;
  super.init(userMode);
  gatewaySessionCookie=createSession(gatewayContextMgt);
  if (gatewayContextWrk.getContextTenant().getDomain().equals(FrameworkConstants.SUPER_TENANT_DOMAIN_NAME)) {
    synapseConfFile="String_Node_Str";
  }
 else {
    synapseConfFile="String_Node_Str";
  }
  loadSynapseConfigurationFromClasspath("String_Node_Str" + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ synapseConfFile,gatewayContextMgt,gatewaySessionCookie);
  waitForAPIDeploymentSync(user.getUserName(),"String_Node_Str","String_Node_Str",APIMIntegrationConstants.IS_API_EXISTS);
}
Program: 114856
Project: 114856
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testCallUserInfoApiWithOpenIdAccessToken() throws Exception {
  Map<String,String> requestHeaders=new HashMap<String,String>();
  requestHeaders.put("String_Node_Str","String_Node_Str" + userAccessToken);
  HttpResponse youTubeResponse=HttpRequestUtil.doGet(gatewayUrlsMgt.getWebAppURLNhttp() + "String_Node_Str",requestHeaders);
  Assert.assertEquals(youTubeResponse.getResponseCode(),200,"String_Node_Str");
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testCallUserInfoApiWithOpenIdAccessToken() throws Exception {
  Map<String,String> requestHeaders=new HashMap<String,String>();
  requestHeaders.put("String_Node_Str","String_Node_Str" + userAccessToken);
  HttpResponse userInfoResponse=HttpRequestUtil.doGet(gatewayUrlsMgt.getWebAppURLNhttp() + "String_Node_Str",requestHeaders);
  Assert.assertEquals(userInfoResponse.getResponseCode(),200,"String_Node_Str");
}
Program: 114857
Project: 114857
Buggy source:
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init(userMode);
  apiPublisher=new APIPublisherRestClient(publisherURLHttp);
  apiStore=new APIStoreRestClient(storeURLHttp);
  apiPublisher.login(user.getUserName(),user.getPassword());
  url=gatewayUrlsMgt.getWebAppURLHttps() + "String_Node_Str";
  APIRequest apiRequest=new APIRequest(APIName,APIContext,new URL(url));
  apiRequest.setTags(tags);
  apiRequest.setDescription(description);
  apiRequest.setVersion(APIVersion);
  apiRequest.setSandbox(url);
  apiPublisher.addAPI(apiRequest);
  APILifeCycleStateRequest updateRequest=new APILifeCycleStateRequest(APIName,providerName,APILifeCycleState.PUBLISHED);
  waitForAPIDeploymentSync(user.getUserName(),APIName,APIVersion,APIMIntegrationConstants.IS_API_EXISTS);
  apiPublisher.changeAPILifeCycleStatus(updateRequest);
  apiStore.login(user.getUserName(),user.getPassword());
  apiStore.addApplication("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  SubscriptionRequest subscriptionRequest=new SubscriptionRequest(APIName,user.getUserName());
  subscriptionRequest.setApplicationName("String_Node_Str");
  subscriptionRequest.setTier("String_Node_Str");
  apiStore.subscribe(subscriptionRequest);
  APPKeyRequestGenerator generateAppKeyRequest=new APPKeyRequestGenerator("String_Node_Str");
  String responseString=apiStore.generateApplicationKey(generateAppKeyRequest).getData();
  JSONObject response=new JSONObject(responseString);
  consumerKey=response.getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").getString("String_Node_Str");
  consumerSecret=response.getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").getString("String_Node_Str");
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init(userMode);
  apiStore=new APIStoreRestClient(storeURLHttp);
  apiStore.login(user.getUserName(),user.getPassword());
  apiStore.addApplication("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  APPKeyRequestGenerator generateAppKeyRequest=new APPKeyRequestGenerator("String_Node_Str");
  String responseString=apiStore.generateApplicationKey(generateAppKeyRequest).getData();
  JSONObject response=new JSONObject(responseString);
  consumerKey=response.getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").getString("String_Node_Str");
  consumerSecret=response.getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").getString("String_Node_Str");
}
Program: 114860
Project: 114860
Buggy source:
/** 
 * return the required parameter value from the URL
 * @param url       URL as String
 * @param attribute name of the attribute
 * @return attribute value as String
 */
public static String getURLParameter(String url,String attribute){
  try {
    Pattern p=Pattern.compile(attribute + "String_Node_Str");
    Matcher m=p.matcher(url);
    while (m.find()) {
      return m.group(1);
    }
  }
 catch (  PatternSyntaxException ignore) {
  }
  return null;
}

Fixed version (ground truth):
/** 
 * return the required parameter value from the URL
 * @param url       URL as String
 * @param attribute name of the attribute
 * @return attribute value as String
 */
private String getURLParameter(String url,String attribute){
  try {
    Pattern p=Pattern.compile(attribute + "String_Node_Str");
    Matcher m=p.matcher(url);
    while (m.find()) {
      return m.group(1);
    }
  }
 catch (  PatternSyntaxException ignore) {
  }
  return null;
}
Program: 114861
Project: 114861
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testApplicationUpdateAndTestKeyGeneration() throws Exception {
  String keyType="String_Node_Str";
  String authorizedDomains="String_Node_Str";
  String retryAfterFailure=String.valueOf(false);
  String jsonParams="String_Node_Str" + "String_Node_Str";
  HttpResponse response=apiStore.updateClientApplication(CALLBACK_URL_UPDATE_APP_NAME_,keyType,authorizedDomains,retryAfterFailure,URLEncoder.encode(jsonParams,"String_Node_Str"),CALLBACK_URL);
  verifyResponse(response);
  testAuthCode();
  testImplicit();
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testApplicationUpdateAndTestKeyGeneration() throws Exception {
  String keyType="String_Node_Str";
  String authorizedDomains="String_Node_Str";
  String retryAfterFailure=String.valueOf(false);
  String jsonParams="String_Node_Str" + "String_Node_Str";
  HttpResponse response=apiStore.updateClientApplication(CALLBACK_URL_UPDATE_APP_NAME,keyType,authorizedDomains,retryAfterFailure,URLEncoder.encode(jsonParams,"String_Node_Str"),CALLBACK_URL);
  verifyResponse(response);
  testAuthCode();
  testImplicit();
}
Program: 114862
Project: 114862
Buggy source:
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  apiStore.removeApplication(APP_NAME);
  apiStore.removeApplication(CALLBACK_URL_UPDATE_APP_NAME_);
  apiPublisher.deleteAPI(API_NAME,API_VERSION,user.getUserName());
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  apiStore.removeApplication(APP_NAME);
  apiStore.removeApplication(CALLBACK_URL_UPDATE_APP_NAME);
  apiPublisher.deleteAPI(API_NAME,API_VERSION,user.getUserName());
}
Program: 114863
Project: 114863
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testApplicationCreationWithoutCallBackURL() throws Exception {
  HttpResponse serviceResponse=apiStore.addApplication(CALLBACK_URL_UPDATE_APP_NAME_,APIThrottlingTier.UNLIMITED.getState(),"String_Node_Str","String_Node_Str");
  verifyResponse(serviceResponse);
  SubscriptionRequest subscriptionRequest=new SubscriptionRequest(API_NAME,user.getUserName());
  subscriptionRequest.setApplicationName(CALLBACK_URL_UPDATE_APP_NAME_);
  subscriptionRequest.setTier(APIMIntegrationConstants.API_TIER.UNLIMITED);
  serviceResponse=apiStore.subscribe(subscriptionRequest);
  verifyResponse(serviceResponse);
  APPKeyRequestGenerator generateAppKeyRequest=new APPKeyRequestGenerator(CALLBACK_URL_UPDATE_APP_NAME_);
  serviceResponse=apiStore.generateApplicationKey(generateAppKeyRequest);
  verifyResponse(serviceResponse);
  JSONObject response=new JSONObject(serviceResponse.getData());
  consumerKey=response.getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").get("String_Node_Str").toString();
  consumerSecret=response.getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").get("String_Node_Str").toString();
  Assert.assertNotNull(consumerKey,"String_Node_Str");
  Assert.assertNotNull(consumerSecret,"String_Node_Str");
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testApplicationCreationWithoutCallBackURL() throws Exception {
  HttpResponse serviceResponse=apiStore.addApplication(CALLBACK_URL_UPDATE_APP_NAME,APIThrottlingTier.UNLIMITED.getState(),"String_Node_Str","String_Node_Str");
  verifyResponse(serviceResponse);
  SubscriptionRequest subscriptionRequest=new SubscriptionRequest(API_NAME,user.getUserName());
  subscriptionRequest.setApplicationName(CALLBACK_URL_UPDATE_APP_NAME);
  subscriptionRequest.setTier(APIMIntegrationConstants.API_TIER.UNLIMITED);
  serviceResponse=apiStore.subscribe(subscriptionRequest);
  verifyResponse(serviceResponse);
  APPKeyRequestGenerator generateAppKeyRequest=new APPKeyRequestGenerator(CALLBACK_URL_UPDATE_APP_NAME);
  serviceResponse=apiStore.generateApplicationKey(generateAppKeyRequest);
  verifyResponse(serviceResponse);
  JSONObject response=new JSONObject(serviceResponse.getData());
  consumerKey=response.getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").get("String_Node_Str").toString();
  consumerSecret=response.getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").get("String_Node_Str").toString();
  Assert.assertNotNull(consumerKey,"String_Node_Str");
  Assert.assertNotNull(consumerSecret,"String_Node_Str");
}
Program: 114869
Project: 114869
Buggy source:
@BeforeClass(alwaysRun=true) public void initialize() throws Exception {
  publisherURLHttp=publisherUrls.getWebAppURLHttp();
  storeURLHttp=getStoreURLHttp();
  endpointUrl=backEndServerUrl.getWebAppURLHttp() + "String_Node_Str";
  apiStore=new APIStoreRestClient(storeURLHttp);
  apiPublisher=new APIPublisherRestClient(publisherURLHttp);
  apiPublisher.login(user.getUserName(),user.getPassword());
  userManagementClient1=new UserManagementClient(keyManagerContext.getContextUrls().getBackEndUrl(),createSession(keyManagerContext));
  userManagementClient1.addRole(INTERNAL_ROLE_SUBSCRIBER,null,permissions);
  userManagementClient1.addRole(INTERNAL_ROLE_SUBSCRIBER_1,null,permissions);
  userManagementClient1.addUser(CARBON_SUPER_SUBSCRIBER_USERNAME,String.valueOf(CARBON_SUPER_SUBSCRIBER_PASSWORD),new String[]{INTERNAL_ROLE_SUBSCRIBER},null);
  userManagementClient1.addUser(CARBON_SUPER_SUBSCRIBER_1_USERNAME,String.valueOf(CARBON_SUPER_SUBSCRIBER_1_PASSWORD),new String[]{INTERNAL_ROLE_SUBSCRIBER_1},null);
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) public void initialize() throws Exception {
  super.init();
  publisherURLHttp=publisherUrls.getWebAppURLHttp();
  storeURLHttp=getStoreURLHttp();
  endpointUrl=backEndServerUrl.getWebAppURLHttp() + "String_Node_Str";
  apiStore=new APIStoreRestClient(storeURLHttp);
  apiPublisher=new APIPublisherRestClient(publisherURLHttp);
  apiPublisher.login(user.getUserName(),user.getPassword());
  userManagementClient1=new UserManagementClient(keyManagerContext.getContextUrls().getBackEndUrl(),createSession(keyManagerContext));
  userManagementClient1.addRole(INTERNAL_ROLE_SUBSCRIBER,null,permissions);
  userManagementClient1.addRole(INTERNAL_ROLE_SUBSCRIBER_1,null,permissions);
  userManagementClient1.addUser(CARBON_SUPER_SUBSCRIBER_USERNAME,String.valueOf(CARBON_SUPER_SUBSCRIBER_PASSWORD),new String[]{INTERNAL_ROLE_SUBSCRIBER},null);
  userManagementClient1.addUser(CARBON_SUPER_SUBSCRIBER_1_USERNAME,String.valueOf(CARBON_SUPER_SUBSCRIBER_1_PASSWORD),new String[]{INTERNAL_ROLE_SUBSCRIBER_1},null);
}
Program: 114875
Project: 114875
Buggy source:
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init(userMode);
  publisherURLHttp=getPublisherURLHttp();
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init(userMode);
  publisherURLHttp=getPublisherURLHttp();
  apiPublisher=new APIPublisherRestClient(publisherURLHttp);
  apiPublisher.login(user.getUserName(),user.getPassword());
}
Program: 114878
Project: 114878
Buggy source:
void setGovernanceRegistryResourcePermissions(String visibility,String[] roles,String resourcePath) throws APIManagementException ;

Fixed version (ground truth):
void setGovernanceRegistryResourcePermissions(String userName,String visibility,String[] roles,String resourcePath) throws APIManagementException ;
Program: 114879
Project: 114879
Buggy source:
@Override public void setGovernanceRegistryResourcePermissions(String visibility,String[] roles,String resourcePath) throws APIManagementException {
  initAPIProvider();
  APIUtil.setResourcePermissions(tenant.getAdminName(),visibility,roles,resourcePath);
}

Fixed version (ground truth):
@Override public void setGovernanceRegistryResourcePermissions(String userName,String visibility,String[] roles,String resourcePath) throws APIManagementException {
  initAPIProvider();
  APIUtil.setResourcePermissions(userName,visibility,roles,resourcePath);
}
Program: 114880
Project: 114880
Buggy source:
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  super.cleanUp();
  deleteAPI(apiIdentifier,apiPublisherClientUser1);
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  super.cleanUp();
}
Program: 114883
Project: 114883
Buggy source:
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  apiPublisher.deleteAPI(apiName,APIVersion,user.getUserName());
  String publisher=storeContext.getContextTenant().getContextUser().getUserName();
  apiPublisherClientAdminOtherDomain.deleteAPI(apiNameTenant,APIVersion,publisher);
  userManagementClient1.deleteUser(CARBON_SUPER_SUBSCRIBER_USERNAME);
  userManagementClient1.deleteUser(CARBON_SUPER_SUBSCRIBER_1_USERNAME);
  userManagementClient2.deleteUser(TENANT_SUBSCRIBER_USERNAME);
  userManagementClient2.deleteUser(TENANT_SUBSCRIBER_1_USERNAME);
  super.cleanUp();
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  apiPublisher.deleteAPI(apiName,APIVersion,SUPER_ADMIN_USERNAME);
  String publisher=storeContext.getContextTenant().getContextUser().getUserName();
  apiPublisherClientAdminOtherDomain.deleteAPI(apiNameTenant,APIVersion,publisher);
  userManagementClient1.deleteRole(INTERNAL_ROLE_SUBSCRIBER);
  userManagementClient1.deleteRole(INTERNAL_ROLE_SUBSCRIBER_1);
  userManagementClient1.deleteUser(CARBON_SUPER_SUBSCRIBER_USERNAME);
  userManagementClient1.deleteUser(CARBON_SUPER_SUBSCRIBER_1_USERNAME);
  userManagementClient2.deleteRole(INTERNAL_ROLE_SUBSCRIBER);
  userManagementClient2.deleteRole(INTERNAL_ROLE_SUBSCRIBER_1);
  userManagementClient2.deleteUser(TENANT_SUBSCRIBER_USERNAME);
  userManagementClient2.deleteUser(TENANT_SUBSCRIBER_1_USERNAME);
  super.cleanUp();
}
Program: 114884
Project: 114884
Buggy source:
@BeforeClass(alwaysRun=true) public void initialize() throws Exception {
  publisherURLHttp=getPublisherURLHttp();
  storeURLHttp=getStoreURLHttp();
  endpointUrl=backEndServerUrl.getWebAppURLHttp() + "String_Node_Str";
  apiStore=new APIStoreRestClient(storeURLHttp);
  apiPublisher=new APIPublisherRestClient(publisherURLHttp);
  apiPublisher.login(user.getUserName(),user.getPassword());
  userManagementClient1=new UserManagementClient(publisherContext.getContextUrls().getBackEndUrl(),createSession(publisherContext));
  userManagementClient1.addRole(INTERNAL_ROLE_SUBSCRIBER,null,permissions);
  userManagementClient1.addRole(INTERNAL_ROLE_SUBSCRIBER_1,null,permissions);
  userManagementClient1.addUser(CARBON_SUPER_SUBSCRIBER_USERNAME,String.valueOf(CARBON_SUPER_SUBSCRIBER_PASSWORD),new String[]{INTERNAL_ROLE_SUBSCRIBER},null);
  userManagementClient1.addUser(CARBON_SUPER_SUBSCRIBER_1_USERNAME,String.valueOf(CARBON_SUPER_SUBSCRIBER_1_PASSWORD),new String[]{INTERNAL_ROLE_SUBSCRIBER_1},null);
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) public void initialize() throws Exception {
  publisherURLHttp=getPublisherURLHttp();
  storeURLHttp=getStoreURLHttp();
  endpointUrl=backEndServerUrl.getWebAppURLHttp() + "String_Node_Str";
  apiStore=new APIStoreRestClient(storeURLHttp);
  apiPublisher=new APIPublisherRestClient(publisherURLHttp);
  apiPublisher.login(user.getUserName(),user.getPassword());
  userManagementClient1=new UserManagementClient(keyManagerContext.getContextUrls().getBackEndUrl(),createSession(keyManagerContext));
  userManagementClient1.addRole(INTERNAL_ROLE_SUBSCRIBER,null,permissions);
  userManagementClient1.addRole(INTERNAL_ROLE_SUBSCRIBER_1,null,permissions);
  userManagementClient1.addUser(CARBON_SUPER_SUBSCRIBER_USERNAME,String.valueOf(CARBON_SUPER_SUBSCRIBER_PASSWORD),new String[]{INTERNAL_ROLE_SUBSCRIBER},null);
  userManagementClient1.addUser(CARBON_SUPER_SUBSCRIBER_1_USERNAME,String.valueOf(CARBON_SUPER_SUBSCRIBER_1_PASSWORD),new String[]{INTERNAL_ROLE_SUBSCRIBER_1},null);
}
Program: 114885
Project: 114885
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testChangeAPILifecycleToRetired() throws APIManagerIntegrationTestException {
  APILifeCycleStateRequest blockUpdateRequest=new APILifeCycleStateRequest(API_NAME,providerName,APILifeCycleState.RETIRED);
  blockUpdateRequest.setVersion(API_VERSION_1_0_0);
  HttpResponse blockAPIActionResponse=apiPublisherRestClient.changeAPILifeCycleStatus(blockUpdateRequest);
  assertEquals(blockAPIActionResponse.getResponseCode(),HTTP_RESPONSE_CODE_OK,"String_Node_Str");
  assertTrue(verifyAPIStatusChange(blockAPIActionResponse,APILifeCycleState.DEPRECATED,APILifeCycleState.RETIRED),"String_Node_Str" + getAPIIdentifierString(apiIdentifier) + "String_Node_Str"+ blockAPIActionResponse.getData());
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testChangeAPILifecycleToRetired() throws APIManagerIntegrationTestException {
  APILifeCycleStateRequest retireUpdateRequest=new APILifeCycleStateRequest(API_NAME,providerName,APILifeCycleState.RETIRED);
  retireUpdateRequest.setVersion(API_VERSION_1_0_0);
  HttpResponse blockAPIActionResponse=apiPublisherRestClient.changeAPILifeCycleStatus(retireUpdateRequest);
  assertEquals(blockAPIActionResponse.getResponseCode(),HTTP_RESPONSE_CODE_OK,"String_Node_Str");
  assertTrue(verifyAPIStatusChange(blockAPIActionResponse,APILifeCycleState.DEPRECATED,APILifeCycleState.RETIRED),"String_Node_Str" + getAPIIdentifierString(apiIdentifier) + "String_Node_Str"+ blockAPIActionResponse.getData());
}
Program: 114886
Project: 114886
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str") public void testInvokeAPIBeforeChangeAPILifecycleToRetired() throws Exception {
  createPublishAndSubscribeToAPI(apiIdentifier,apiCreationRequestBean,apiPublisherRestClient,apiStoreRestClient,APPLICATION_NAME);
  String accessToken=generateApplicationKeys(apiStoreRestClient,APPLICATION_NAME).getAccessToken();
  requestHeaders=new HashMap<String,String>();
  requestHeaders.put("String_Node_Str","String_Node_Str");
  requestHeaders.put("String_Node_Str","String_Node_Str" + accessToken);
  waitForAPIDeploymentSync(user.getUserName(),API_NAME,API_VERSION_1_0_0,APIMIntegrationConstants.IS_API_EXISTS);
  HttpResponse oldVersionInvokeResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttp(API_CONTEXT,API_VERSION_1_0_0) + API_END_POINT_METHOD,requestHeaders);
  assertEquals(oldVersionInvokeResponse.getResponseCode(),HTTP_RESPONSE_CODE_OK,"String_Node_Str");
  assertTrue(oldVersionInvokeResponse.getData().contains(API_RESPONSE_DATA),"String_Node_Str" + "String_Node_Str" + oldVersionInvokeResponse.getData());
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str") public void testInvokeAPIBeforeChangeAPILifecycleToRetired() throws Exception {
  createPublishAndSubscribeToAPI(apiIdentifier,apiCreationRequestBean,apiPublisherRestClient,apiStoreRestClient,APPLICATION_NAME);
  String accessToken=generateApplicationKeys(apiStoreRestClient,APPLICATION_NAME).getAccessToken();
  requestHeaders=new HashMap<String,String>();
  requestHeaders.put("String_Node_Str","String_Node_Str");
  requestHeaders.put("String_Node_Str","String_Node_Str" + accessToken);
  waitForAPIDeploymentSync(user.getUserName(),API_NAME,API_VERSION_1_0_0,APIMIntegrationConstants.IS_API_EXISTS);
  HttpResponse oldVersionInvokeResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttp(API_CONTEXT,API_VERSION_1_0_0) + API_END_POINT_METHOD,requestHeaders);
  assertEquals(oldVersionInvokeResponse.getResponseCode(),HTTP_RESPONSE_CODE_OK,"String_Node_Str");
  assertTrue(oldVersionInvokeResponse.getData().contains(API_RESPONSE_DATA),"String_Node_Str" + "String_Node_Str" + oldVersionInvokeResponse.getData());
  Thread.sleep(1000);
}
Program: 114887
Project: 114887
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testAvailabilityOfRetiredAPIInStore() throws APIManagerIntegrationTestException {
  List<APIIdentifier> apiStoreAPIIdentifierList=APIMTestCaseUtils.getAPIIdentifierListFromHttpResponse(apiStoreRestClient.getAPI());
  assertFalse(APIMTestCaseUtils.isAPIAvailable(apiIdentifier,apiStoreAPIIdentifierList),"String_Node_Str" + getAPIIdentifierString(apiIdentifier));
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testAvailabilityOfRetiredAPIInStore() throws Exception {
  List<APIIdentifier> apiStoreAPIIdentifierList=APIMTestCaseUtils.getAPIIdentifierListFromHttpResponse(apiStoreRestClient.getAPI());
  assertFalse(APIMTestCaseUtils.isAPIAvailable(apiIdentifier,apiStoreAPIIdentifierList),"String_Node_Str" + getAPIIdentifierString(apiIdentifier));
}
Program: 114888
Project: 114888
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testChangeAPILifecycleToDepricated() throws APIManagerIntegrationTestException {
  APILifeCycleStateRequest blockUpdateRequest=new APILifeCycleStateRequest(API_NAME,providerName,APILifeCycleState.DEPRECATED);
  blockUpdateRequest.setVersion(API_VERSION_1_0_0);
  HttpResponse blockAPIActionResponse=apiPublisherRestClient.changeAPILifeCycleStatus(blockUpdateRequest);
  assertEquals(blockAPIActionResponse.getResponseCode(),HTTP_RESPONSE_CODE_OK,"String_Node_Str");
  assertTrue(verifyAPIStatusChange(blockAPIActionResponse,APILifeCycleState.PUBLISHED,APILifeCycleState.DEPRECATED),"String_Node_Str" + getAPIIdentifierString(apiIdentifier) + "String_Node_Str"+ blockAPIActionResponse.getData());
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testChangeAPILifecycleToDepricated() throws Exception {
  APILifeCycleStateRequest deprecateUpdateRequest=new APILifeCycleStateRequest(API_NAME,providerName,APILifeCycleState.DEPRECATED);
  deprecateUpdateRequest.setVersion(API_VERSION_1_0_0);
  HttpResponse blockAPIActionResponse=apiPublisherRestClient.changeAPILifeCycleStatus(deprecateUpdateRequest);
  assertEquals(blockAPIActionResponse.getResponseCode(),HTTP_RESPONSE_CODE_OK,"String_Node_Str");
  assertTrue(verifyAPIStatusChange(blockAPIActionResponse,APILifeCycleState.PUBLISHED,APILifeCycleState.DEPRECATED),"String_Node_Str" + getAPIIdentifierString(apiIdentifier) + "String_Node_Str"+ blockAPIActionResponse.getData());
  Thread.sleep(1000);
}
Program: 114889
Project: 114889
Buggy source:
@BeforeMethod public void init(){
  try {
    super.init();
    publisherURLHttp=publisherUrls.getWebAppURLHttp();
    storeURLHttp=storeUrls.getWebAppURLHttp();
    apiPublisher=new APIPublisherRestClient(publisherURLHttp);
    apiStoreRestClient=new APIStoreRestClient(storeURLHttp);
    contextUsername=publisherContext.getContextTenant().getContextUser().getUserName();
    contextUserPassword=publisherContext.getContextTenant().getContextUser().getPassword();
    userManagementClient=new UserManagementClient(publisherContext.getContextUrls().getBackEndUrl(),contextUsername,contextUserPassword);
    userManagementClient.addRole(FIRST_ROLE,new String[]{},new String[]{PERMISSION_LOGIN,PERMISSION_API_SUBSCRIBE});
    userManagementClient.addRole(SECOND_ROLE,new String[]{},new String[]{PERMISSION_LOGIN,PERMISSION_API_SUBSCRIBE});
    userManagementClient.addUser(FIRST_USER,USER_PASSWORD,new String[]{FIRST_ROLE},FIRST_USER);
  }
 catch (  APIManagerIntegrationTestException e) {
    assertTrue(false,"String_Node_Str");
  }
catch (  RemoteException e) {
    assertTrue(false,"String_Node_Str");
  }
catch (  UserAdminUserAdminException e) {
    assertTrue(false,"String_Node_Str");
  }
catch (  XPathExpressionException e) {
    assertTrue(false,"String_Node_Str");
  }
}

Fixed version (ground truth):
@BeforeMethod public void init(){
  try {
    super.init();
    publisherURLHttp=publisherUrls.getWebAppURLHttp();
    storeURLHttp=storeUrls.getWebAppURLHttp();
    apiPublisher=new APIPublisherRestClient(publisherURLHttp);
    apiStoreRestClient=new APIStoreRestClient(storeURLHttp);
    contextUsername=publisherContext.getContextTenant().getContextUser().getUserName();
    contextUserPassword=publisherContext.getContextTenant().getContextUser().getPassword();
    userManagementClient=new UserManagementClient(publisherContext.getContextUrls().getBackEndUrl(),contextUsername,contextUserPassword);
    userManagementClient.addRole(FIRST_ROLE,new String[]{},new String[]{PERMISSION_LOGIN,PERMISSION_API_SUBSCRIBE});
    userManagementClient.addRole(SECOND_ROLE,new String[]{},new String[]{PERMISSION_LOGIN,PERMISSION_API_SUBSCRIBE});
    userManagementClient.addUser(FIRST_USER,USER_PASSWORD,new String[]{FIRST_ROLE},FIRST_USER);
  }
 catch (  APIManagerIntegrationTestException e) {
    assertTrue(false,"String_Node_Str" + e.getMessage());
  }
catch (  RemoteException e) {
    assertTrue(false,"String_Node_Str" + e.getMessage());
  }
catch (  UserAdminUserAdminException e) {
    assertTrue(false,"String_Node_Str" + e.getMessage());
  }
catch (  XPathExpressionException e) {
    assertTrue(false,"String_Node_Str" + e.getMessage());
  }
}
Program: 114893
Project: 114893
Buggy source:
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  apiPublisher.deleteAPI(apiNamePublic,APIVersion,user.getUserName());
  apiPublisher.deleteAPI(apiNameRestricted,APIVersion,user.getUserName());
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  apiPublisher.deleteAPI(apiNamePublic,APIVersion,user.getUserName());
  apiPublisher.deleteAPI(apiNameRestricted,APIVersion,user.getUserName());
  userManagementClient1.deleteRole(role);
  userManagementClient1.deleteUser(allowedUser);
}
Program: 114894
Project: 114894
Buggy source:
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init(userMode);
  publisherURLHttp=getPublisherURLHttp();
  storeURLHttp=getStoreURLHttp();
  endpointUrl=backEndServerUrl.getWebAppURLHttp() + "String_Node_Str";
  apiStore=new APIStoreRestClient(storeURLHttp);
  apiPublisher=new APIPublisherRestClient(publisherURLHttp);
  apiPublisher.login(user.getUserName(),user.getPassword());
  userManagementClient=new UserManagementClient(publisherContext.getContextUrls().getBackEndUrl(),createSession(publisherContext));
  userManagementClient.addRole(role,null,permissions);
  userManagementClient.addUser(allowedUser,String.valueOf(allowedUserPass),new String[]{role},null);
  tagListUrl=new URL(getStoreURLHttp() + "String_Node_Str");
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init(userMode);
  publisherURLHttp=getPublisherURLHttp();
  storeURLHttp=getStoreURLHttp();
  endpointUrl=backEndServerUrl.getWebAppURLHttp() + "String_Node_Str";
  apiStore=new APIStoreRestClient(storeURLHttp);
  apiPublisher=new APIPublisherRestClient(publisherURLHttp);
  apiPublisher.login(user.getUserName(),user.getPassword());
  userManagementClient1=new UserManagementClient(keyManagerContext.getContextUrls().getBackEndUrl(),createSession(keyManagerContext));
  userManagementClient1.addRole(role,null,permissions);
  userManagementClient1.addUser(allowedUser,String.valueOf(allowedUserPass),new String[]{role},null);
  tagListUrl=new URL(getStoreURLHttp() + "String_Node_Str");
}
Program: 114896
Project: 114896
Buggy source:
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init();
  gatewaySessionCookie=createSession(gatewayContextMgt);
  TenantManagementServiceClient tenantManagementServiceClient=new TenantManagementServiceClient(keyManagerContext.getContextUrls().getBackEndUrl(),gatewaySessionCookie);
  tenantManagementServiceClient.addTenant("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  String file="String_Node_Str" + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str";
  OMElement synapseConfig=APIMTestCaseUtils.loadResource(file);
  AuthenticatorClient login=new AuthenticatorClient(gatewayContextWrk.getContextUrls().getBackEndUrl());
  String session=login.login("String_Node_Str","String_Node_Str","String_Node_Str");
  APIMTestCaseUtils.updateSynapseConfiguration(synapseConfig,gatewayContextWrk.getContextUrls().getBackEndUrl(),session);
  Thread.sleep(5000);
  wireServer=new WireMonitorServer(8991);
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init();
  gatewaySessionCookie=createSession(gatewayContextMgt);
  tenantManagementServiceClient.addTenant("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  String file="String_Node_Str" + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str";
  OMElement synapseConfig=APIMTestCaseUtils.loadResource(file);
  AuthenticatorClient login=new AuthenticatorClient(gatewayContextWrk.getContextUrls().getBackEndUrl());
  String session=login.login("String_Node_Str","String_Node_Str","String_Node_Str");
  APIMTestCaseUtils.updateSynapseConfiguration(synapseConfig,gatewayContextWrk.getContextUrls().getBackEndUrl(),session);
  Thread.sleep(5000);
  wireServer=new WireMonitorServer(8991);
}