Skip to content

Commit a5fc2c6

Browse files
authored
Update identity test to not rely on comparing pointers to zero-sized objects (#574)
1 parent a8203ac commit a5fc2c6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

transport/http/identity_test.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ package http
33
import (
44
"context"
55
"testing"
6-
smithy "github.com/aws/smithy-go"
6+
7+
"github.com/aws/smithy-go"
78
"github.com/aws/smithy-go/auth"
89
)
910

1011
func TestIdentity(t *testing.T) {
11-
var expected auth.Identity = &auth.AnonymousIdentity{}
12-
1312
resolver := auth.AnonymousIdentityResolver{}
14-
actual, _ := resolver.GetIdentity(context.TODO(), smithy.Properties{})
15-
if expected != actual {
16-
t.Errorf("Anonymous identity resolver does not produce correct identity")
13+
identity, _ := resolver.GetIdentity(context.TODO(), smithy.Properties{})
14+
if _, ok := identity.(*auth.AnonymousIdentity); !ok {
15+
t.Errorf("Anonymous identity resolver does not produce correct identity, expected it to be of type auth.AnonymousIdentity")
1716
}
1817
}

0 commit comments

Comments
 (0)