update integration test to reference new format options

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman 2021-10-10 18:57:44 -07:00
parent c00afc7fa9
commit 50408b52d1
No known key found for this signature in database
GPG Key ID: 5CB45AE22BAB7EA7

View File

@ -3,10 +3,13 @@ package integration
import ( import (
"bytes" "bytes"
"encoding/json" "encoding/json"
exportedPackages "github.com/anchore/syft/syft/presenter/packages"
"testing" "testing"
internalPackages "github.com/anchore/syft/internal/presenter/packages" "github.com/anchore/syft/internal/formats/syftjson/model"
"github.com/anchore/syft/syft/format"
exportedPackages "github.com/anchore/syft/syft/presenter/packages"
) )
func TestPackageOwnershipRelationships(t *testing.T) { func TestPackageOwnershipRelationships(t *testing.T) {
@ -24,7 +27,7 @@ func TestPackageOwnershipRelationships(t *testing.T) {
t.Run(test.fixture, func(t *testing.T) { t.Run(test.fixture, func(t *testing.T) {
catalog, d, src := catalogFixtureImage(t, test.fixture) catalog, d, src := catalogFixtureImage(t, test.fixture)
p := exportedPackages.Presenter(exportedPackages.JSONPresenterOption, exportedPackages.PresenterConfig{ p := exportedPackages.Presenter(format.JSONOption, exportedPackages.Config{
SourceMetadata: src.Metadata, SourceMetadata: src.Metadata,
Catalog: catalog, Catalog: catalog,
Distro: d, Distro: d,
@ -39,7 +42,7 @@ func TestPackageOwnershipRelationships(t *testing.T) {
t.Fatalf("unable to present: %+v", err) t.Fatalf("unable to present: %+v", err)
} }
var doc internalPackages.JSONDocument var doc model.Document
decoder := json.NewDecoder(output) decoder := json.NewDecoder(output)
if err := decoder.Decode(&doc); err != nil { if err := decoder.Decode(&doc); err != nil {
t.Fatalf("unable to decode json doc: %+v", err) t.Fatalf("unable to decode json doc: %+v", err)