test_class.declarator: tfModules
test_class.modifier: private
test_class.original_string: private Path tfModules;
test_class.type: Path
test_class.var_name: tfModules
test_class.file: tf-build-tools/tf-maven-plugin/src/test/java/com/deliveredtechnologies/maven/terraform/TerraformGetTest.java
test_class.identifier: TerraformGetTest
test_case.body: @Test
    public void expandArtifactsUnzipsAllArtifactsInaDirectory() throws IOException, TerraformException {
      Log log = Mockito.mock(Log.class);
      TerraformGet terraformGet = new TerraformGet(log, tfModules);
      terraformGet.expandMavenArtifacts(tfModules);
  
      List<Path> directories = Files.walk(tfModules, 1)
          .filter(path -> !tfModules.equals(path))
          .collect(Collectors.toList());
  
      Assert.assertEquals(directories.size(), 3);
      Assert.assertTrue(directories.stream().anyMatch(path -> path.getFileName().toString().equals("my.module2")));
      Assert.assertTrue(directories.stream().anyMatch(path -> path.getFileName().toString().equals("my-module1")));
      Assert.assertTrue(directories.stream().anyMatch(path -> path.getFileName().toString().equals("my-module3")));
    }
test_case.class_method_signature: TerraformGetTest.expandArtifactsUnzipsAllArtifactsInaDirectory()
test_case.full_signature: @Test public void expandArtifactsUnzipsAllArtifactsInaDirectory()
test_case.identifier: expandArtifactsUnzipsAllArtifactsInaDirectory
test_case.invocations: mock expandMavenArtifacts collect filter walk equals toList assertEquals size assertTrue anyMatch stream equals toString getFileName assertTrue anyMatch stream equals toString getFileName assertTrue anyMatch stream equals toString getFileName
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void expandArtifactsUnzipsAllArtifactsInaDirectory()
focal_class.declarator: PACKAGING = "zip"
focal_class.modifier: private static final
focal_class.original_string: private static final String PACKAGING = "zip";
focal_class.type: String
focal_class.var_name: PACKAGING
focal_class.declarator: tfModules
focal_class.modifier: private
focal_class.original_string: private Path tfModules;
focal_class.type: Path
focal_class.var_name: tfModules
focal_class.declarator: log
focal_class.modifier: private
focal_class.original_string: private Log log;
focal_class.type: Log
focal_class.var_name: log
focal_class.file: tf-build-tools/tf-maven-plugin/src/main/java/com/deliveredtechnologies/maven/terraform/TerraformGet.java
focal_class.identifier: TerraformGet
focal_class.interfaces: implements TerraformOperation<List<Path>>
focal_class.class_method_signature: TerraformGet.TerraformGet(Log log, String tfModules)
focal_class.full_signature: public  TerraformGet(Log log, String tfModules)
focal_class.identifier: TerraformGet
focal_class.modifiers: public
focal_class.parameters: (Log log, String tfModules)
focal_class.signature:  TerraformGet(Log log, String tfModules)
focal_class.class_method_signature: TerraformGet.TerraformGet(Log log, Path tfModules)
focal_class.full_signature: protected  TerraformGet(Log log, Path tfModules)
focal_class.identifier: TerraformGet
focal_class.modifiers: protected
focal_class.parameters: (Log log, Path tfModules)
focal_class.signature:  TerraformGet(Log log, Path tfModules)
focal_class.class_method_signature: TerraformGet.TerraformGet(Log log)
focal_class.full_signature: public  TerraformGet(Log log)
focal_class.identifier: TerraformGet
focal_class.modifiers: public
focal_class.parameters: (Log log)
focal_class.signature:  TerraformGet(Log log)
focal_class.class_method_signature: TerraformGet.TerraformGet()
focal_class.full_signature: public  TerraformGet()
focal_class.identifier: TerraformGet
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  TerraformGet()
focal_class.class_method_signature: TerraformGet.execute(Properties properties)
focal_class.full_signature: @Override public List<Path> execute(Properties properties)
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: (Properties properties)
focal_class.return: List<Path>
focal_class.signature: List<Path> execute(Properties properties)
focal_class.class_method_signature: TerraformGet.getDependenciesFromMavenRepo(Invoker invoker, InvocationRequest request)
focal_class.full_signature: final void getDependenciesFromMavenRepo(Invoker invoker, InvocationRequest request)
focal_class.identifier: getDependenciesFromMavenRepo
focal_class.modifiers: final
focal_class.parameters: (Invoker invoker, InvocationRequest request)
focal_class.return: void
focal_class.signature: void getDependenciesFromMavenRepo(Invoker invoker, InvocationRequest request)
focal_class.class_method_signature: TerraformGet.expandMavenArtifacts(Path directory)
focal_class.full_signature: final List<Path> expandMavenArtifacts(Path directory)
focal_class.identifier: expandMavenArtifacts
focal_class.modifiers: final
focal_class.parameters: (Path directory)
focal_class.return: List<Path>
focal_class.signature: List<Path> expandMavenArtifacts(Path directory)
focal_method.body: final List<Path> expandMavenArtifacts(Path directory) throws TerraformException {
      log.info("Expanding artifacts from " + directory.toAbsolutePath());
  
      try {
        List<Path> result = new ArrayList<>();
        List<Path> zipFiles = Files.walk(directory, 1)
            .filter(path -> path.getFileName().toString().endsWith(".zip"))
            .collect(Collectors.toList());
  
        for (Path zipFile : zipFiles) {
          result.add((new ExpandableZippedArtifact(zipFile, log)).expand()
              .orElseThrow(() -> new TerraformException("unable to extract " + zipFile.getFileName())));
        }
        return result;
      } catch (IOException e) {
        throw new TerraformException("Unable to extract maven artifacts");
      }
    }
focal_method.class_method_signature: TerraformGet.expandMavenArtifacts(Path directory)
focal_method.full_signature: final List<Path> expandMavenArtifacts(Path directory)
focal_method.identifier: expandMavenArtifacts
focal_method.invocations: info toAbsolutePath collect filter walk endsWith toString getFileName toList add orElseThrow expand getFileName
focal_method.modifiers: final
focal_method.parameters: (Path directory)
focal_method.return: List<Path>
focal_method.signature: List<Path> expandMavenArtifacts(Path directory)