@Test public void backendS3operationsWhenPlanPropertySpecified() throws IOException { TerraformPlanFileUtils planFileUtils = new TerraformPlanFileUtils(executable, logger); String planFileName = "test.json"; properties.put("plan", planFileName); Assert.assertNull(planFileUtils.executePlanFileOperation(properties)); }
public String executePlanFileOperation(Properties properties) throws IOException { boolean isPlanFile = properties.containsKey("planOutputFile") || properties.containsKey("plan"); if (isPlanFile) { String planFile = properties.getProperty("planOutputFile") == null ? properties.getProperty("plan") : properties.getProperty("planOutputFile"); String planFileName = planFile.split("/")[planFile.split("/").length - 1]; String backendAction = properties.getProperty("planOutputFile") == null ? "GET" : "PUT"; if (!planFile.equals(planFileName)) { String backendType = planFile.split(":")[0].toLowerCase(); switch (backendType) { case "s3": backendS3operations(backendAction, planFile, properties); break; default: break; } } } return null; }
TerraformPlanFileUtils { public String executePlanFileOperation(Properties properties) throws IOException { boolean isPlanFile = properties.containsKey("planOutputFile") || properties.containsKey("plan"); if (isPlanFile) { String planFile = properties.getProperty("planOutputFile") == null ? properties.getProperty("plan") : properties.getProperty("planOutputFile"); String planFileName = planFile.split("/")[planFile.split("/").length - 1]; String backendAction = properties.getProperty("planOutputFile") == null ? "GET" : "PUT"; if (!planFile.equals(planFileName)) { String backendType = planFile.split(":")[0].toLowerCase(); switch (backendType) { case "s3": backendS3operations(backendAction, planFile, properties); break; default: break; } } } return null; } }
TerraformPlanFileUtils { public String executePlanFileOperation(Properties properties) throws IOException { boolean isPlanFile = properties.containsKey("planOutputFile") || properties.containsKey("plan"); if (isPlanFile) { String planFile = properties.getProperty("planOutputFile") == null ? properties.getProperty("plan") : properties.getProperty("planOutputFile"); String planFileName = planFile.split("/")[planFile.split("/").length - 1]; String backendAction = properties.getProperty("planOutputFile") == null ? "GET" : "PUT"; if (!planFile.equals(planFileName)) { String backendType = planFile.split(":")[0].toLowerCase(); switch (backendType) { case "s3": backendS3operations(backendAction, planFile, properties); break; default: break; } } } return null; } TerraformPlanFileUtils(String tfRootDir, Logger logger);  TerraformPlanFileUtils(Executable executable, Logger logger); }
TerraformPlanFileUtils { public String executePlanFileOperation(Properties properties) throws IOException { boolean isPlanFile = properties.containsKey("planOutputFile") || properties.containsKey("plan"); if (isPlanFile) { String planFile = properties.getProperty("planOutputFile") == null ? properties.getProperty("plan") : properties.getProperty("planOutputFile"); String planFileName = planFile.split("/")[planFile.split("/").length - 1]; String backendAction = properties.getProperty("planOutputFile") == null ? "GET" : "PUT"; if (!planFile.equals(planFileName)) { String backendType = planFile.split(":")[0].toLowerCase(); switch (backendType) { case "s3": backendS3operations(backendAction, planFile, properties); break; default: break; } } } return null; } TerraformPlanFileUtils(String tfRootDir, Logger logger);  TerraformPlanFileUtils(Executable executable, Logger logger); String executePlanFileOperation(Properties properties); }
TerraformPlanFileUtils { public String executePlanFileOperation(Properties properties) throws IOException { boolean isPlanFile = properties.containsKey("planOutputFile") || properties.containsKey("plan"); if (isPlanFile) { String planFile = properties.getProperty("planOutputFile") == null ? properties.getProperty("plan") : properties.getProperty("planOutputFile"); String planFileName = planFile.split("/")[planFile.split("/").length - 1]; String backendAction = properties.getProperty("planOutputFile") == null ? "GET" : "PUT"; if (!planFile.equals(planFileName)) { String backendType = planFile.split(":")[0].toLowerCase(); switch (backendType) { case "s3": backendS3operations(backendAction, planFile, properties); break; default: break; } } } return null; } TerraformPlanFileUtils(String tfRootDir, Logger logger);  TerraformPlanFileUtils(Executable executable, Logger logger); String executePlanFileOperation(Properties properties);  }