diff --git a/bard/logger.go b/bard/logger.go index 0a037d8..fa35bd4 100644 --- a/bard/logger.go +++ b/bard/logger.go @@ -21,7 +21,7 @@ import ( "io" "strings" - "github.com/buildpacks/libcnb/log" + "github.com/buildpacks/libcnb/v2/log" "github.com/heroku/color" ) diff --git a/bindings/resolve.go b/bindings/resolve.go index 7e4b212..cfafa1c 100644 --- a/bindings/resolve.go +++ b/bindings/resolve.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "github.com/buildpacks/libcnb" + "github.com/buildpacks/libcnb/v2" ) // Predicate should return true if it matches a given binding. diff --git a/bindings/resolve_test.go b/bindings/resolve_test.go index 7708276..e6677a5 100644 --- a/bindings/resolve_test.go +++ b/bindings/resolve_test.go @@ -19,7 +19,7 @@ package bindings_test import ( "testing" - "github.com/buildpacks/libcnb" + "github.com/buildpacks/libcnb/v2" . "github.com/onsi/gomega" "github.com/sclevine/spec" diff --git a/build.go b/build.go index fd7e80d..d7f451e 100644 --- a/build.go +++ b/build.go @@ -17,7 +17,7 @@ package libpak import ( - "github.com/buildpacks/libcnb" + "github.com/buildpacks/libcnb/v2" "github.com/paketo-buildpacks/libpak/bard" "github.com/paketo-buildpacks/libpak/internal" diff --git a/build_test.go b/build_test.go index 9e8b6c8..d9007b6 100644 --- a/build_test.go +++ b/build_test.go @@ -22,8 +22,8 @@ import ( "path/filepath" "testing" - "github.com/buildpacks/libcnb" - "github.com/buildpacks/libcnb/mocks" + "github.com/buildpacks/libcnb/v2" + "github.com/buildpacks/libcnb/v2/mocks" . "github.com/onsi/gomega" "github.com/sclevine/spec" "github.com/stretchr/testify/mock" diff --git a/buildpack_plan.go b/buildpack_plan.go index 1e57e63..48a0905 100644 --- a/buildpack_plan.go +++ b/buildpack_plan.go @@ -20,7 +20,7 @@ import ( "fmt" "reflect" - "github.com/buildpacks/libcnb" + "github.com/buildpacks/libcnb/v2" "github.com/imdario/mergo" ) diff --git a/buildpack_plan_test.go b/buildpack_plan_test.go index d74d5a1..44b7037 100644 --- a/buildpack_plan_test.go +++ b/buildpack_plan_test.go @@ -19,7 +19,7 @@ package libpak_test import ( "testing" - "github.com/buildpacks/libcnb" + "github.com/buildpacks/libcnb/v2" . "github.com/onsi/gomega" "github.com/sclevine/spec" diff --git a/carton/build_image_dependency_test.go b/carton/build_image_dependency_test.go index 809dea0..5c72814 100644 --- a/carton/build_image_dependency_test.go +++ b/carton/build_image_dependency_test.go @@ -20,7 +20,7 @@ import ( "os" "testing" - "github.com/buildpacks/libcnb/mocks" + "github.com/buildpacks/libcnb/v2/mocks" . "github.com/onsi/gomega" "github.com/sclevine/spec" "github.com/stretchr/testify/mock" diff --git a/carton/buildmodule_dependency_test.go b/carton/buildmodule_dependency_test.go index bf656bf..c14d5f6 100644 --- a/carton/buildmodule_dependency_test.go +++ b/carton/buildmodule_dependency_test.go @@ -20,7 +20,7 @@ import ( "os" "testing" - "github.com/buildpacks/libcnb/mocks" + "github.com/buildpacks/libcnb/v2/mocks" . "github.com/onsi/gomega" "github.com/sclevine/spec" "github.com/stretchr/testify/mock" diff --git a/carton/config.go b/carton/config.go index 6e7b8e6..5803ec4 100644 --- a/carton/config.go +++ b/carton/config.go @@ -17,12 +17,12 @@ package carton import ( - "github.com/buildpacks/libcnb" + "github.com/buildpacks/libcnb/v2" "github.com/paketo-buildpacks/libpak/effect" ) -//go:generate mockery -name EntryWriter -case=underscore +//go:generate mockery --name EntryWriter --case=underscore // EntryWriter is the interface implemented by a type that wants to write an entry. type EntryWriter interface { diff --git a/carton/lifecycle_dependency_test.go b/carton/lifecycle_dependency_test.go index 5d86011..e881d14 100644 --- a/carton/lifecycle_dependency_test.go +++ b/carton/lifecycle_dependency_test.go @@ -20,7 +20,7 @@ import ( "os" "testing" - "github.com/buildpacks/libcnb/mocks" + "github.com/buildpacks/libcnb/v2/mocks" . "github.com/onsi/gomega" "github.com/sclevine/spec" "github.com/stretchr/testify/mock" diff --git a/carton/mocks/entry_writer.go b/carton/mocks/entry_writer.go index f5943bd..d4cd4cb 100644 --- a/carton/mocks/entry_writer.go +++ b/carton/mocks/entry_writer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.1. DO NOT EDIT. package mocks @@ -22,3 +22,17 @@ func (_m *EntryWriter) Write(source string, destination string) error { return r0 } + +// NewEntryWriter creates a new instance of EntryWriter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewEntryWriter(t interface { + mock.TestingT + Cleanup(func()) +}) *EntryWriter { + mock := &EntryWriter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/carton/package.go b/carton/package.go index 64aa6ab..06d17b3 100644 --- a/carton/package.go +++ b/carton/package.go @@ -25,7 +25,7 @@ import ( "text/template" "github.com/BurntSushi/toml" - "github.com/buildpacks/libcnb" + "github.com/buildpacks/libcnb/v2" "github.com/heroku/color" "github.com/paketo-buildpacks/libpak" diff --git a/carton/package_dependency_test.go b/carton/package_dependency_test.go index 42cde8c..99e265d 100644 --- a/carton/package_dependency_test.go +++ b/carton/package_dependency_test.go @@ -20,7 +20,7 @@ import ( "os" "testing" - "github.com/buildpacks/libcnb/mocks" + "github.com/buildpacks/libcnb/v2/mocks" . "github.com/onsi/gomega" "github.com/sclevine/spec" "github.com/stretchr/testify/mock" diff --git a/carton/package_test.go b/carton/package_test.go index 029d5b2..0079882 100644 --- a/carton/package_test.go +++ b/carton/package_test.go @@ -21,7 +21,7 @@ import ( "path/filepath" "testing" - "github.com/buildpacks/libcnb/mocks" + "github.com/buildpacks/libcnb/v2/mocks" . "github.com/onsi/gomega" "github.com/sclevine/spec" "github.com/stretchr/testify/mock" diff --git a/dependency_cache.go b/dependency_cache.go index 8ed791e..650b805 100644 --- a/dependency_cache.go +++ b/dependency_cache.go @@ -31,7 +31,7 @@ import ( "time" "github.com/BurntSushi/toml" - "github.com/buildpacks/libcnb" + "github.com/buildpacks/libcnb/v2" "github.com/heroku/color" "github.com/paketo-buildpacks/libpak/bard" diff --git a/dependency_cache_test.go b/dependency_cache_test.go index 4d2f114..c88a8f9 100644 --- a/dependency_cache_test.go +++ b/dependency_cache_test.go @@ -26,7 +26,7 @@ import ( "time" "github.com/BurntSushi/toml" - "github.com/buildpacks/libcnb" + "github.com/buildpacks/libcnb/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/ghttp" "github.com/sclevine/spec" diff --git a/detect.go b/detect.go index 14006fa..aefd0df 100644 --- a/detect.go +++ b/detect.go @@ -17,7 +17,7 @@ package libpak import ( - "github.com/buildpacks/libcnb" + "github.com/buildpacks/libcnb/v2" "github.com/paketo-buildpacks/libpak/bard" "github.com/paketo-buildpacks/libpak/internal" diff --git a/detect_test.go b/detect_test.go index 1b5aa0b..f0e3583 100644 --- a/detect_test.go +++ b/detect_test.go @@ -22,8 +22,8 @@ import ( "path/filepath" "testing" - "github.com/buildpacks/libcnb" - "github.com/buildpacks/libcnb/mocks" + "github.com/buildpacks/libcnb/v2" + "github.com/buildpacks/libcnb/v2/mocks" . "github.com/onsi/gomega" "github.com/sclevine/spec" "github.com/stretchr/testify/mock" diff --git a/effect/executor.go b/effect/executor.go index 759c451..f6d620c 100644 --- a/effect/executor.go +++ b/effect/executor.go @@ -46,7 +46,7 @@ type Execution struct { Stderr io.Writer } -//go:generate mockery -name Executor -case=underscore +//go:generate mockery --name Executor --case=underscore // Executor is the interface for types that can execute an Execution. type Executor interface { diff --git a/effect/mocks/executor.go b/effect/mocks/executor.go index 28743bd..b65a8ad 100644 --- a/effect/mocks/executor.go +++ b/effect/mocks/executor.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.1. DO NOT EDIT. package mocks @@ -25,3 +25,17 @@ func (_m *Executor) Execute(execution effect.Execution) error { return r0 } + +// NewExecutor creates a new instance of Executor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewExecutor(t interface { + mock.TestingT + Cleanup(func()) +}) *Executor { + mock := &Executor{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/formatter_test.go b/formatter_test.go index 9ef32c7..f0f83f0 100644 --- a/formatter_test.go +++ b/formatter_test.go @@ -20,9 +20,8 @@ import ( "testing" . "github.com/onsi/gomega" - "github.com/sclevine/spec" - "github.com/paketo-buildpacks/libpak" + "github.com/sclevine/spec" ) func testFormatter(t *testing.T, context spec.G, it spec.S) { diff --git a/generate.go b/generate.go index 9ef9af0..0003f2e 100644 --- a/generate.go +++ b/generate.go @@ -17,7 +17,7 @@ package libpak import ( - "github.com/buildpacks/libcnb" + "github.com/buildpacks/libcnb/v2" "github.com/paketo-buildpacks/libpak/bard" "github.com/paketo-buildpacks/libpak/internal" diff --git a/generate_test.go b/generate_test.go index 41bbbb9..8701f51 100644 --- a/generate_test.go +++ b/generate_test.go @@ -22,8 +22,8 @@ import ( "path/filepath" "testing" - "github.com/buildpacks/libcnb" - "github.com/buildpacks/libcnb/mocks" + "github.com/buildpacks/libcnb/v2" + "github.com/buildpacks/libcnb/v2/mocks" . "github.com/onsi/gomega" "github.com/sclevine/spec" "github.com/stretchr/testify/mock" diff --git a/go.mod b/go.mod index d25f165..4995161 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/BurntSushi/toml v1.3.2 github.com/Masterminds/semver/v3 v3.2.1 - github.com/buildpacks/libcnb v1.24.1-0.20230724194433-19d88148ffa1 + github.com/buildpacks/libcnb/v2 v2.0.0-alpha.1 github.com/creack/pty v1.1.18 github.com/h2non/filetype v1.1.3 github.com/heroku/color v0.0.6 @@ -28,9 +28,9 @@ require ( github.com/mattn/go-isatty v0.0.19 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stretchr/objx v0.5.0 // indirect - golang.org/x/net v0.12.0 // indirect - golang.org/x/sys v0.10.0 // indirect - golang.org/x/text v0.11.0 // indirect + golang.org/x/net v0.14.0 // indirect + golang.org/x/sys v0.11.0 // indirect + golang.org/x/text v0.12.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 093c03e..e5c7777 100644 --- a/go.sum +++ b/go.sum @@ -5,10 +5,8 @@ github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3Q github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -github.com/buildpacks/libcnb v1.24.1-0.20230627130937-5d3d3f6e6d16 h1:rx4pWmx2K/BnT0K41xX0BCGCvnQFLMGza7MTD474EwE= -github.com/buildpacks/libcnb v1.24.1-0.20230627130937-5d3d3f6e6d16/go.mod h1:SALIsTZ/aKTjVImBl20gf4QaZV6UQNV4WX2I4a6Am4A= -github.com/buildpacks/libcnb v1.24.1-0.20230724194433-19d88148ffa1 h1:1PiXtoBeUfsfcf3jD9O5n2FNKER9Ild7uvGig9eN8U0= -github.com/buildpacks/libcnb v1.24.1-0.20230724194433-19d88148ffa1/go.mod h1:Q7dE9sksaUWe0gjQdMLkxpSmopYXVisVOGYVBXWuwrY= +github.com/buildpacks/libcnb/v2 v2.0.0-alpha.1 h1:Re6ij+R/7CkWsOJUpQU76v5Ki7MTjUpLn0XEzsDbbZE= +github.com/buildpacks/libcnb/v2 v2.0.0-alpha.1/go.mod h1:kqJbwxQrjebmQJQsB6zdR56nM/5vwvQAKwe9/HZgVB0= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= @@ -43,12 +41,7 @@ github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APP github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= -github.com/onsi/ginkgo/v2 v2.9.7 h1:06xGQy5www2oN160RtEZoTvnP2sPhEfePYmCDc2szss= github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= -github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc= -github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ= -github.com/onsi/gomega v1.27.9 h1:qIyVWbOsvQEye2QCqLsNSeH/5L1RS9vS382erEWfT3o= -github.com/onsi/gomega v1.27.9/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -70,22 +63,15 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= -golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= -golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= -golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= diff --git a/internal/toml_writer.go b/internal/toml_writer.go index 74d1eac..d20a87e 100644 --- a/internal/toml_writer.go +++ b/internal/toml_writer.go @@ -24,7 +24,7 @@ import ( "strings" "github.com/BurntSushi/toml" - "github.com/buildpacks/libcnb" + "github.com/buildpacks/libcnb/v2" "github.com/heroku/color" "github.com/paketo-buildpacks/libpak/bard" diff --git a/internal/toml_writer_test.go b/internal/toml_writer_test.go index 5b65a16..c6e694e 100644 --- a/internal/toml_writer_test.go +++ b/internal/toml_writer_test.go @@ -23,7 +23,7 @@ import ( "path/filepath" "testing" - "github.com/buildpacks/libcnb" + "github.com/buildpacks/libcnb/v2" "github.com/heroku/color" . "github.com/onsi/gomega" "github.com/sclevine/spec" diff --git a/layer.go b/layer.go index e2b3b49..e3c48d7 100644 --- a/layer.go +++ b/layer.go @@ -26,7 +26,7 @@ import ( "github.com/BurntSushi/toml" "github.com/heroku/color" - "github.com/buildpacks/libcnb" + "github.com/buildpacks/libcnb/v2" "github.com/paketo-buildpacks/libpak/internal" "github.com/paketo-buildpacks/libpak/sbom" diff --git a/layer_test.go b/layer_test.go index afb0c0b..a21730b 100644 --- a/layer_test.go +++ b/layer_test.go @@ -25,7 +25,7 @@ import ( "testing" "time" - "github.com/buildpacks/libcnb" + "github.com/buildpacks/libcnb/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/ghttp" "github.com/sclevine/spec" diff --git a/main.go b/main.go index edd49e8..e2c9846 100644 --- a/main.go +++ b/main.go @@ -17,8 +17,7 @@ package libpak import ( - "github.com/buildpacks/libcnb" - + "github.com/buildpacks/libcnb/v2" "github.com/paketo-buildpacks/libpak/internal" ) diff --git a/main_test.go b/main_test.go index 0e50cc6..cd574b2 100644 --- a/main_test.go +++ b/main_test.go @@ -21,8 +21,8 @@ import ( "path/filepath" "testing" - "github.com/buildpacks/libcnb" - "github.com/buildpacks/libcnb/mocks" + "github.com/buildpacks/libcnb/v2" + "github.com/buildpacks/libcnb/v2/mocks" . "github.com/onsi/gomega" "github.com/sclevine/spec" "github.com/stretchr/testify/mock" diff --git a/sbom/mocks/sbom_scanner.go b/sbom/mocks/sbom_scanner.go index 6b7db63..fc06291 100644 --- a/sbom/mocks/sbom_scanner.go +++ b/sbom/mocks/sbom_scanner.go @@ -1,9 +1,9 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.1. DO NOT EDIT. package mocks import ( - libcnb "github.com/buildpacks/libcnb" + libcnb "github.com/buildpacks/libcnb/v2" mock "github.com/stretchr/testify/mock" ) @@ -74,3 +74,17 @@ func (_m *SBOMScanner) ScanLayer(layer libcnb.Layer, scanDir string, formats ... return r0 } + +// NewSBOMScanner creates a new instance of SBOMScanner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewSBOMScanner(t interface { + mock.TestingT + Cleanup(func()) +}) *SBOMScanner { + mock := &SBOMScanner{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/sbom/sbom.go b/sbom/sbom.go index 62d3c15..be46e31 100644 --- a/sbom/sbom.go +++ b/sbom/sbom.go @@ -5,13 +5,13 @@ import ( "fmt" "os" - "github.com/buildpacks/libcnb" + "github.com/buildpacks/libcnb/v2" "github.com/mitchellh/hashstructure/v2" "github.com/paketo-buildpacks/libpak/bard" "github.com/paketo-buildpacks/libpak/effect" ) -//go:generate mockery -name SBOMScanner -case=underscore +//go:generate mockery --name SBOMScanner --case=underscore type SBOMScanner interface { ScanLayer(layer libcnb.Layer, scanDir string, formats ...libcnb.SBOMFormat) error diff --git a/sbom/sbom_test.go b/sbom/sbom_test.go index 7f1cb0c..86df994 100644 --- a/sbom/sbom_test.go +++ b/sbom/sbom_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/buildpacks/libcnb" + "github.com/buildpacks/libcnb/v2" . "github.com/onsi/gomega" "github.com/paketo-buildpacks/libpak/bard" "github.com/paketo-buildpacks/libpak/effect" diff --git a/sherpa/config.go b/sherpa/config.go index a301f85..e924e49 100644 --- a/sherpa/config.go +++ b/sherpa/config.go @@ -19,7 +19,7 @@ package sherpa import ( "io" - "github.com/buildpacks/libcnb" + "github.com/buildpacks/libcnb/v2" ) // Config is an object that contains configurable properties for execution. diff --git a/sherpa/mocks/exec_d.go b/sherpa/mocks/exec_d.go index dcc5368..12ed4cc 100644 --- a/sherpa/mocks/exec_d.go +++ b/sherpa/mocks/exec_d.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.1. DO NOT EDIT. package mocks @@ -14,6 +14,10 @@ func (_m *ExecD) Execute() (map[string]string, error) { ret := _m.Called() var r0 map[string]string + var r1 error + if rf, ok := ret.Get(0).(func() (map[string]string, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() map[string]string); ok { r0 = rf() } else { @@ -22,7 +26,6 @@ func (_m *ExecD) Execute() (map[string]string, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -31,3 +34,17 @@ func (_m *ExecD) Execute() (map[string]string, error) { return r0, r1 } + +// NewExecD creates a new instance of ExecD. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewExecD(t interface { + mock.TestingT + Cleanup(func()) +}) *ExecD { + mock := &ExecD{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/sherpa/mocks/sbom_scanner.go b/sherpa/mocks/sbom_scanner.go index a6a5546..12691b0 100644 --- a/sherpa/mocks/sbom_scanner.go +++ b/sherpa/mocks/sbom_scanner.go @@ -3,7 +3,7 @@ package mocks import ( - libcnb "github.com/buildpacks/libcnb" + libcnb "github.com/buildpacks/libcnb/v2" mock "github.com/stretchr/testify/mock" ) diff --git a/sherpa/sherpa.go b/sherpa/sherpa.go index 7d63946..f285aff 100644 --- a/sherpa/sherpa.go +++ b/sherpa/sherpa.go @@ -44,7 +44,7 @@ func Execute(f ExecuteFunc, options ...Option) { } } -//go:generate mockery -name ExecD -case=underscore +//go:generate mockery --name ExecD --case=underscore // ExecD describes an interface for types that Exec.d specification. type ExecD interface { diff --git a/sherpa/sherpa_test.go b/sherpa/sherpa_test.go index 432c7df..4b98094 100644 --- a/sherpa/sherpa_test.go +++ b/sherpa/sherpa_test.go @@ -21,7 +21,7 @@ import ( "fmt" "testing" - mocks1 "github.com/buildpacks/libcnb/mocks" + mocks1 "github.com/buildpacks/libcnb/v2/mocks" . "github.com/onsi/gomega" "github.com/sclevine/spec" "github.com/stretchr/testify/mock"