diff --git a/transport/http/auth_schemes_test.go b/transport/http/auth_schemes_test.go new file mode 100644 index 000000000..4c785dbfc --- /dev/null +++ b/transport/http/auth_schemes_test.go @@ -0,0 +1,22 @@ +package http + +import ( + "testing" + "github.com/aws/smithy-go/auth" +) + +func TestAnonymousScheme(t *testing.T) { + expectedID := auth.SchemeIDAnonymous + scheme := NewAnonymousScheme() + actualID := scheme.SchemeID() + if expectedID != actualID { + t.Errorf("AnonymousScheme constructor is not producing the correct scheme ID") + } + + var expectedSigner Signer = &nopSigner{} + actualSigner := scheme.Signer() + if expectedSigner != actualSigner { + t.Errorf("AnonymousScheme constructor is not producing the correct signer") + } +} + diff --git a/transport/http/identity_test.go b/transport/http/identity_test.go new file mode 100644 index 000000000..2727ce14b --- /dev/null +++ b/transport/http/identity_test.go @@ -0,0 +1,18 @@ +package http + +import ( + "context" + "testing" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/auth" +) + +func TestIdentity(t *testing.T) { + var expected auth.Identity = &auth.AnonymousIdentity{} + + resolver := auth.AnonymousIdentityResolver{} + actual, _ := resolver.GetIdentity(context.TODO(), smithy.Properties{}) + if expected != actual { + t.Errorf("Anonymous identity resolver does not produce correct identity") + } +} \ No newline at end of file