|
| 1 | +package storage |
| 2 | + |
| 3 | +import ( |
| 4 | + // Standard Library Imports |
| 5 | + "testing" |
| 6 | + |
| 7 | + // External Imports |
| 8 | + "github.com/ory/fosite" |
| 9 | + "github.com/ory/fosite/handler/oauth2" |
| 10 | + "github.com/ory/fosite/handler/openid" |
| 11 | + "github.com/ory/fosite/handler/pkce" |
| 12 | +) |
| 13 | + |
| 14 | +func TestStore_ImplementsFositeStorage(t *testing.T) { |
| 15 | + c := &Store{} |
| 16 | + |
| 17 | + var i interface{} = c |
| 18 | + if _, ok := i.(fosite.Storage); !ok { |
| 19 | + t.Error("Store does not implement interface fosite.Storage") |
| 20 | + } |
| 21 | +} |
| 22 | + |
| 23 | +func TestStore_ImplementsFositeClientManager(t *testing.T) { |
| 24 | + c := &Store{} |
| 25 | + |
| 26 | + var i interface{} = c |
| 27 | + if _, ok := i.(fosite.ClientManager); !ok { |
| 28 | + t.Error("Store does not implement interface fosite.ClientManager") |
| 29 | + } |
| 30 | +} |
| 31 | + |
| 32 | +func TestStore_ImplementsFositeAccessTokenStorageInterface(t *testing.T) { |
| 33 | + r := &Store{} |
| 34 | + |
| 35 | + var i interface{} = r |
| 36 | + if _, ok := i.(oauth2.AccessTokenStorage); !ok { |
| 37 | + t.Error("Store does not implement interface oauth2.AccessTokenStorage") |
| 38 | + } |
| 39 | +} |
| 40 | + |
| 41 | +func TestStore_ImplementsFositeAuthorizeCodeStorageInterface(t *testing.T) { |
| 42 | + r := &Store{} |
| 43 | + |
| 44 | + var i interface{} = r |
| 45 | + if _, ok := i.(oauth2.AuthorizeCodeStorage); !ok { |
| 46 | + t.Error("Store does not implement interface oauth2.AuthorizeCodeStorage") |
| 47 | + } |
| 48 | +} |
| 49 | + |
| 50 | +func TestStore_ImplementsFositeClientCredentialsGrantStorageInterface(t *testing.T) { |
| 51 | + r := &Store{} |
| 52 | + |
| 53 | + var i interface{} = r |
| 54 | + if _, ok := i.(oauth2.ClientCredentialsGrantStorage); !ok { |
| 55 | + t.Error("Store does not implement interface oauth2.ClientCredentialsGrantStorage") |
| 56 | + } |
| 57 | +} |
| 58 | + |
| 59 | +func TestStore_ImplementsFositeRefreshTokenStorageInterface(t *testing.T) { |
| 60 | + r := &Store{} |
| 61 | + |
| 62 | + var i interface{} = r |
| 63 | + if _, ok := i.(oauth2.RefreshTokenStorage); !ok { |
| 64 | + t.Error("Store does not implement interface oauth2.RefreshTokenStorage") |
| 65 | + } |
| 66 | +} |
| 67 | + |
| 68 | +func TestStore_ImplementsFositeResourceOwnerPasswordCredentialsGrantStorageInterface(t *testing.T) { |
| 69 | + r := &Store{} |
| 70 | + |
| 71 | + var i interface{} = r |
| 72 | + if _, ok := i.(oauth2.ResourceOwnerPasswordCredentialsGrantStorage); !ok { |
| 73 | + t.Error("Store does not implement interface oauth2.ResourceOwnerPasswordCredentialsGrantStorage") |
| 74 | + } |
| 75 | +} |
| 76 | + |
| 77 | +func TestStore_ImplementsFositeOpenidOpenIDConnectRequestStorageInterface(t *testing.T) { |
| 78 | + r := &Store{} |
| 79 | + |
| 80 | + var i interface{} = r |
| 81 | + if _, ok := i.(openid.OpenIDConnectRequestStorage); !ok { |
| 82 | + t.Error("Store does not implement interface openid.OpenIDConnectRequestStorage") |
| 83 | + } |
| 84 | +} |
| 85 | + |
| 86 | +func TestStore_ImplementsFositePkcePKCERequestStorageInterface(t *testing.T) { |
| 87 | + r := &Store{} |
| 88 | + |
| 89 | + var i interface{} = r |
| 90 | + if _, ok := i.(pkce.PKCERequestStorage); !ok { |
| 91 | + t.Error("Store does not implement interface pkce.PKCERequestStorage") |
| 92 | + } |
| 93 | +} |
0 commit comments