test_class.declarator: properties
test_class.modifier: private
test_class.original_string: private Properties properties;
test_class.type: Properties
test_class.var_name: properties
test_class.declarator: executable
test_class.modifier: private
test_class.original_string: private Executable executable;
test_class.type: Executable
test_class.var_name: executable
test_class.declarator: logger
test_class.modifier: private
test_class.original_string: private Logger logger;
test_class.type: Logger
test_class.var_name: logger
test_class.file: tf-build-tools/tf-cmd-api/src/test/java/com/deliveredtechnologies/terraform/TerraformPlanFileUtilsTest.java
test_class.identifier: TerraformPlanFileUtilsTest
test_case.body: @Test
    public void backendS3operationsWhenGetActionSpecified() throws IOException, InterruptedException {
      TerraformPlanFileUtils planFileUtils = new TerraformPlanFileUtils(executable, logger);
  
      String s3BucketKey = "s3://terraform-maven-state/planfiles/test.json";
      properties.put("planOutputFile", s3BucketKey);
      planFileUtils.backendS3operations("GET", s3BucketKey, properties);
      Mockito.verify(executable, Mockito.times(1)).execute("aws s3api get-object --bucket terraform-maven-state --key test.json test.json");
    }
test_case.class_method_signature: TerraformPlanFileUtilsTest.backendS3operationsWhenGetActionSpecified()
test_case.full_signature: @Test public void backendS3operationsWhenGetActionSpecified()
test_case.identifier: backendS3operationsWhenGetActionSpecified
test_case.invocations: put backendS3operations execute verify times
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void backendS3operationsWhenGetActionSpecified()
focal_class.declarator: logger
focal_class.modifier: private
focal_class.original_string: private Logger logger;
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: LOGGER = LoggerFactory.getLogger(TerraformUtils.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(TerraformUtils.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: executable
focal_class.modifier: private
focal_class.original_string: private Executable executable;
focal_class.type: Executable
focal_class.var_name: executable
focal_class.file: tf-build-tools/tf-cmd-api/src/main/java/com/deliveredtechnologies/terraform/TerraformPlanFileUtils.java
focal_class.identifier: TerraformPlanFileUtils
focal_class.class_method_signature: TerraformPlanFileUtils.TerraformPlanFileUtils(String tfRootDir, Logger logger)
focal_class.full_signature: public  TerraformPlanFileUtils(String tfRootDir, Logger logger)
focal_class.identifier: TerraformPlanFileUtils
focal_class.modifiers: public
focal_class.parameters: (String tfRootDir, Logger logger)
focal_class.signature:  TerraformPlanFileUtils(String tfRootDir, Logger logger)
focal_class.class_method_signature: TerraformPlanFileUtils.TerraformPlanFileUtils(Executable executable, Logger logger)
focal_class.full_signature: public  TerraformPlanFileUtils(Executable executable, Logger logger)
focal_class.identifier: TerraformPlanFileUtils
focal_class.modifiers: public
focal_class.parameters: (Executable executable, Logger logger)
focal_class.signature:  TerraformPlanFileUtils(Executable executable, Logger logger)
focal_class.class_method_signature: TerraformPlanFileUtils.executePlanFileOperation(Properties properties)
focal_class.full_signature: public String executePlanFileOperation(Properties properties)
focal_class.identifier: executePlanFileOperation
focal_class.modifiers: public
focal_class.parameters: (Properties properties)
focal_class.return: String
focal_class.signature: String executePlanFileOperation(Properties properties)
focal_class.class_method_signature: TerraformPlanFileUtils.backendS3operations(String action, String s3Key, Properties properties )
focal_class.full_signature: protected void backendS3operations(String action, String s3Key, Properties properties )
focal_class.identifier: backendS3operations
focal_class.modifiers: protected
focal_class.parameters: (String action, String s3Key, Properties properties )
focal_class.return: void
focal_class.signature: void backendS3operations(String action, String s3Key, Properties properties )
focal_method.body: protected void backendS3operations(String action, String s3Key, Properties properties ) throws IOException {
      try {
        String bucketName = s3Key.split("/")[2];
        String fileName = s3Key.substring(s3Key.lastIndexOf("/")).replaceAll("/", "");
        if (action.equals("GET")) {
          executable.execute(String.format("aws s3api get-object --bucket %1$s --key %2$s %3$s", bucketName, fileName, fileName));
        } else if (action.equals("PUT")) {
          if (properties.containsKey("kmsKeyId")) {
            LOGGER.debug("uploading plan files to Amazon S3 with kms encryption");
            executable.execute(String.format("aws s3 cp %1$s %2$s --sse aws:kms --sse-kms-key-id %3$s", fileName, s3Key, properties.getProperty("kmsKeyId")));
          } else {
            LOGGER.debug("uploading plan files to Amazon S3 with default encryption (SSE:256)");
            executable.execute(String.format("aws s3 cp %1$s %2$s", fileName, s3Key));
          }
        }
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
    }
focal_method.class_method_signature: TerraformPlanFileUtils.backendS3operations(String action, String s3Key, Properties properties )
focal_method.full_signature: protected void backendS3operations(String action, String s3Key, Properties properties )
focal_method.identifier: backendS3operations
focal_method.invocations: split replaceAll substring lastIndexOf equals execute format equals containsKey debug execute format getProperty debug execute format printStackTrace
focal_method.modifiers: protected
focal_method.parameters: (String action, String s3Key, Properties properties )
focal_method.return: void
focal_method.signature: void backendS3operations(String action, String s3Key, Properties properties )