-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Philip Germanov
committed
Oct 29, 2024
1 parent
8faf232
commit f1df2c1
Showing
1 changed file
with
2 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,6 @@ import ( | |
var cpe mavenBuildCommonPipelineEnvironment | ||
|
||
func TestMavenBuild(t *testing.T) { | ||
|
||
t.Run("mavenBuild should install the artifact", func(t *testing.T) { | ||
mockedUtils := newMavenMockUtils() | ||
|
||
|
@@ -123,7 +122,6 @@ func TestMavenBuild(t *testing.T) { | |
assert.Equal(t, mockedUtils.Calls[0].Exec, "mvn") | ||
assert.Empty(t, cpe.custom.mavenBuildArtifacts) | ||
}) | ||
|
||
} | ||
|
||
func createTempFile(t *testing.T, dir string, filename string, content string) string { | ||
|
@@ -136,7 +134,6 @@ func createTempFile(t *testing.T, dir string, filename string, content string) s | |
} | ||
|
||
func TestGetPurlForThePomAndDeleteIndividualBom(t *testing.T) { | ||
|
||
t.Run("valid BOM file, aggregated BOM", func(t *testing.T) { | ||
tempDir, err := piperutils.Files{}.TempDir("", "test") | ||
if err != nil { | ||
|
@@ -160,7 +157,7 @@ func TestGetPurlForThePomAndDeleteIndividualBom(t *testing.T) { | |
} | ||
bomFilePath := createTempFile(t, bomDir, mvnSimpleBomFilename+".xml", bomContent) | ||
|
||
purl := getPurlForThePom(pomFilePath) | ||
purl := piperutils.GetPurl(pomFilePath, mvnSimpleBomFilename+".xml") | ||
assert.Equal(t, "pkg:maven/com.example/[email protected]", purl) | ||
_, err = os.Stat(bomFilePath) | ||
assert.False(t, os.IsNotExist(err)) // File should not be deleted | ||
|
@@ -170,7 +167,7 @@ func TestGetPurlForThePomAndDeleteIndividualBom(t *testing.T) { | |
tempDir := t.TempDir() | ||
pomFilePath := createTempFile(t, tempDir, "pom.xml", "") // Create a temp pom file | ||
|
||
purl := getPurlForThePom(pomFilePath) | ||
purl := piperutils.GetPurl(pomFilePath, mvnSimpleBomFilename+".xml") | ||
assert.Equal(t, "", purl) | ||
}) | ||
} |