test_class.file: tf-build-tools/tf-cmd-api/src/test/java/com/deliveredtechnologies/terraform/TerraformUtilsTest.java
test_class.identifier: TerraformUtilsTest
test_case.body: @Test
    public void getTerraformRootModuleDirReturnsTheRootModuleDirRelativeToTheSourceDir() throws IOException, TerraformException {
      Path testModule = Paths.get("src", "main", "tf", "test");
      try {
        FileUtils.copyDirectory(
            Paths.get("src", "test", "resources", "tf_initialized", "root").toFile(),
            testModule.toFile()
        );
        Path tfRootModulePath = TerraformUtils.getTerraformRootModuleDir("test");
        Assert.assertEquals(Paths.get("src", "main", "tf", "test"), tfRootModulePath);
      } finally {
        List<Path> paths = Files.walk(testModule).sorted(Comparator.reverseOrder()).collect(Collectors.toList());
        paths.forEach(path -> path.toFile().delete());
      }
    }
test_case.class_method_signature: TerraformUtilsTest.getTerraformRootModuleDirReturnsTheRootModuleDirRelativeToTheSourceDir()
test_case.full_signature: @Test public void getTerraformRootModuleDirReturnsTheRootModuleDirRelativeToTheSourceDir()
test_case.identifier: getTerraformRootModuleDirReturnsTheRootModuleDirRelativeToTheSourceDir
test_case.invocations: get copyDirectory toFile get toFile getTerraformRootModuleDir assertEquals get collect sorted walk reverseOrder toList forEach delete toFile
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getTerraformRootModuleDirReturnsTheRootModuleDirRelativeToTheSourceDir()
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.file: tf-build-tools/tf-cmd-api/src/main/java/com/deliveredtechnologies/terraform/TerraformUtils.java
focal_class.identifier: TerraformUtils
focal_class.class_method_signature: TerraformUtils.TerraformUtils()
focal_class.full_signature: private  TerraformUtils()
focal_class.identifier: TerraformUtils
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  TerraformUtils()
focal_class.class_method_signature: TerraformUtils.getDefaultTerraformRootModuleDir()
focal_class.full_signature: public static Path getDefaultTerraformRootModuleDir()
focal_class.identifier: getDefaultTerraformRootModuleDir
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: Path
focal_class.signature: Path getDefaultTerraformRootModuleDir()
focal_class.class_method_signature: TerraformUtils.getTerraformRootModuleDir(String tfmodule)
focal_class.full_signature: public static Path getTerraformRootModuleDir(String tfmodule)
focal_class.identifier: getTerraformRootModuleDir
focal_class.modifiers: public static
focal_class.parameters: (String tfmodule)
focal_class.return: Path
focal_class.signature: Path getTerraformRootModuleDir(String tfmodule)
focal_class.class_method_signature: TerraformUtils.getDefaultTfModulesDir()
focal_class.full_signature: public static Path getDefaultTfModulesDir()
focal_class.identifier: getDefaultTfModulesDir
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: Path
focal_class.signature: Path getDefaultTfModulesDir()
focal_method.body: public static Path getTerraformRootModuleDir(String tfmodule) throws IOException, TerraformException {
      Path path;
      if (tfmodule.startsWith("tf-examples")) {
        path = Paths.get("src", "main", tfmodule);
      } else if (tfmodule.contains(File.separator)) { //relative or absolute path
        path = Paths.get(tfmodule);
      } else {
        path = Paths.get("src", "main", "tf", tfmodule);
      }
      if (!path.toFile().exists()) {
        throw new TerraformException(String.format("%1$s does not exist", tfmodule));
      }
  
      return path;
    }
focal_method.class_method_signature: TerraformUtils.getTerraformRootModuleDir(String tfmodule)
focal_method.full_signature: public static Path getTerraformRootModuleDir(String tfmodule)
focal_method.identifier: getTerraformRootModuleDir
focal_method.invocations: startsWith get contains get get exists toFile format
focal_method.modifiers: public static
focal_method.parameters: (String tfmodule)
focal_method.return: Path
focal_method.signature: Path getTerraformRootModuleDir(String tfmodule)