Program: 114850
Project: 114850
Buggy source:
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init();
  apiProvider=publisherContext.getSuperTenant().getContextUser().getUserName();
  String carbonHome=System.getProperty(ServerConstants.CARBON_HOME);
  String artifactsLocation=TestConfigurationProvider.getResourceLocation() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator;
  String apimConfigArtifactLocation=artifactsLocation + APIM_CONFIG_XML;
  String identityConfigArtifactLocation=artifactsLocation + IDENTITY_CONFIG_XML;
  String apimRepositoryConfigLocation=carbonHome + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ APIM_CONFIG_XML;
  String identityRepositoryConfigLocation=carbonHome + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ IDENTITY_CONFIG_XML;
  File apimConfSourceFile=new File(apimConfigArtifactLocation);
  File apimConfTargetFile=new File(apimRepositoryConfigLocation);
  File identityConfSourceFile=new File(identityConfigArtifactLocation);
  File identityConfTargetFile=new File(identityRepositoryConfigLocation);
  serverManager=new ServerConfigurationManager(gatewayContextWrk);
  serverManager.applyConfigurationWithoutRestart(apimConfSourceFile,apimConfTargetFile,true);
  log.info("String_Node_Str" + apimConfigArtifactLocation + "String_Node_Str"+ apimRepositoryConfigLocation);
  serverManager.applyConfigurationWithoutRestart(identityConfSourceFile,identityConfTargetFile,true);
  log.info("String_Node_Str" + identityConfigArtifactLocation + "String_Node_Str"+ identityRepositoryConfigLocation);
  serverManager.restartGracefully();
  String publisherURLHttp=publisherUrls.getWebAppURLHttp();
  String storeURLHttp=storeUrls.getWebAppURLHttp();
  apiPublisher=new APIPublisherRestClient(publisherURLHttp);
  apiStore=new APIStoreRestClient(storeURLHttp);
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init();
  apiProvider=publisherContext.getSuperTenant().getContextUser().getUserName();
  String carbonHome=System.getProperty(ServerConstants.CARBON_HOME);
  String artifactsLocation=TestConfigurationProvider.getResourceLocation() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator;
  String apimConfigArtifactLocation=artifactsLocation + APIM_CONFIG_XML;
  String identityConfigArtifactLocation=artifactsLocation + IDENTITY_CONFIG_XML;
  String apimRepositoryConfigLocation=carbonHome + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ APIM_CONFIG_XML;
  String identityRepositoryConfigLocation=carbonHome + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ IDENTITY_CONFIG_XML;
  File apimConfSourceFile=new File(apimConfigArtifactLocation);
  File apimConfTargetFile=new File(apimRepositoryConfigLocation);
  File identityConfSourceFile=new File(identityConfigArtifactLocation);
  File identityConfTargetFile=new File(identityRepositoryConfigLocation);
  serverManager=new ServerConfigurationManager(gatewayContextWrk);
  serverManager.applyConfigurationWithoutRestart(apimConfSourceFile,apimConfTargetFile,true);
  log.info("String_Node_Str" + apimConfigArtifactLocation + "String_Node_Str"+ apimRepositoryConfigLocation);
  serverManager.applyConfigurationWithoutRestart(identityConfSourceFile,identityConfTargetFile,true);
  log.info("String_Node_Str" + identityConfigArtifactLocation + "String_Node_Str"+ identityRepositoryConfigLocation);
  serverManager.restartGracefully();
  super.init();
  String publisherURLHttp=publisherUrls.getWebAppURLHttp();
  String storeURLHttp=storeUrls.getWebAppURLHttp();
  apiPublisher=new APIPublisherRestClient(publisherURLHttp);
  apiStore=new APIStoreRestClient(storeURLHttp);
}