Skip to content

Commit

Permalink
test(encode): remove unneeded UID
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen committed Jun 28, 2024
1 parent c4c413a commit 9afe959
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions pkg/sbom/io/encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"testing"

"github.com/package-url/packageurl-go"
"github.com/samber/lo"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand Down Expand Up @@ -599,7 +598,6 @@ func TestEncoder_Encode(t *testing.T) {
Name: "org.apache.logging.log4j:log4j-core",
Version: "2.23.1",
Identifier: ftypes.PkgIdentifier{
UID: "6C0AE96901617503",
PURL: &packageurl.PackageURL{
Type: packageurl.TypeMaven,
Namespace: "org.apache.logging.log4j",
Expand All @@ -616,7 +614,7 @@ func TestEncoder_Encode(t *testing.T) {
},
wantComponents: map[uuid.UUID]*core.Component{
uuid.MustParse("3ff14136-e09f-4df9-80ea-000000000001"): fsComponent,
uuid.MustParse("3ff14136-e09f-4df9-80ea-000000000002"): libComponentWithUID(),
uuid.MustParse("3ff14136-e09f-4df9-80ea-000000000002"): libComponent,
},
wantRels: map[uuid.UUID][]core.Relationship{
uuid.MustParse("3ff14136-e09f-4df9-80ea-000000000001"): {
Expand Down Expand Up @@ -776,12 +774,6 @@ var (
}
)

func libComponentWithUID() *core.Component {
component := lo.FromPtr(libComponent)
component.PkgIdentifier.UID = "6C0AE96901617503"
return lo.ToPtr(component)
}

func newTestBOM(t *testing.T) *core.BOM {
uuid.SetFakeUUID(t, "2ff14136-e09f-4df9-80ea-%012d")
bom := core.NewBOM(core.Options{})
Expand Down

0 comments on commit 9afe959

Please sign in to comment.