@Test public void getArtifactZipGetsMavenZipArtifactNameWithoutGroupId() { String artifact = "groupId:artifactId:0.1"; Assert.assertEquals(TerraformGetMavenRootArtifact.getArtifactZip(artifact), "artifactId-0.1.zip"); Assert.assertEquals(TerraformGetMavenRootArtifact.getArtifactZip(String.format("%1$s.zip", artifact)), "artifactId-0.1.zip"); Assert.assertEquals("artifactId-0.1.zip", "artifactId-0.1.zip"); }
static String getArtifactZip(String artifact) { String artifactZip = artifact.indexOf(':') > 0 ? artifact.substring(artifact.indexOf(':') + 1).replace(":", "-") : artifact; return artifactZip.endsWith(".zip") ? artifactZip : String.format("%1$s.zip", artifactZip); }
TerraformGetMavenRootArtifact implements TerraformOperation<String> { static String getArtifactZip(String artifact) { String artifactZip = artifact.indexOf(':') > 0 ? artifact.substring(artifact.indexOf(':') + 1).replace(":", "-") : artifact; return artifactZip.endsWith(".zip") ? artifactZip : String.format("%1$s.zip", artifactZip); } }
TerraformGetMavenRootArtifact implements TerraformOperation<String> { static String getArtifactZip(String artifact) { String artifactZip = artifact.indexOf(':') > 0 ? artifact.substring(artifact.indexOf(':') + 1).replace(":", "-") : artifact; return artifactZip.endsWith(".zip") ? artifactZip : String.format("%1$s.zip", artifactZip); } TerraformGetMavenRootArtifact(String artifact, Log log);  TerraformGetMavenRootArtifact(String artifact, String tfRootDir, Log log); }
TerraformGetMavenRootArtifact implements TerraformOperation<String> { static String getArtifactZip(String artifact) { String artifactZip = artifact.indexOf(':') > 0 ? artifact.substring(artifact.indexOf(':') + 1).replace(":", "-") : artifact; return artifactZip.endsWith(".zip") ? artifactZip : String.format("%1$s.zip", artifactZip); } TerraformGetMavenRootArtifact(String artifact, Log log);  TerraformGetMavenRootArtifact(String artifact, String tfRootDir, Log log); @Override String execute(Properties properties); }
TerraformGetMavenRootArtifact implements TerraformOperation<String> { static String getArtifactZip(String artifact) { String artifactZip = artifact.indexOf(':') > 0 ? artifact.substring(artifact.indexOf(':') + 1).replace(":", "-") : artifact; return artifactZip.endsWith(".zip") ? artifactZip : String.format("%1$s.zip", artifactZip); } TerraformGetMavenRootArtifact(String artifact, Log log);  TerraformGetMavenRootArtifact(String artifact, String tfRootDir, Log log); @Override String execute(Properties properties);  }