trufflehog/pkg/detectors/endpoint_customizer_test.go
Kashif Khan 4b6957df66
Endpoint customizer refresh (#3308)
* Refresh EndpointCustomizer for more explicit configuration

Also add CloudProvider interface.

* WIP: Update EndpointSetter

* Updated detectors with new endpoint customizer

* Fixed linter

* Added check for appending cloud endpoints

---------

Co-authored-by: Miccah Castorina <m.castorina93@gmail.com>
2024-09-24 11:41:05 -05:00

16 lines
404 B
Go

package detectors
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestEmbeddedEndpointSetter(t *testing.T) {
type Scanner struct{ EndpointSetter }
var s Scanner
assert.Equal(t, []string{"baz"}, s.Endpoints("baz"))
assert.NoError(t, s.SetConfiguredEndpoints("foo", "bar"))
assert.Error(t, s.SetConfiguredEndpoints())
assert.Equal(t, []string{"foo", "bar"}, s.Endpoints("baz"))
}