fix tests
This commit is contained in:
parent
bdcccc3303
commit
88209ac11d
4 changed files with 8 additions and 8 deletions
|
@ -1072,7 +1072,7 @@ func TestAuthResponseCode(t *testing.T) {
|
||||||
authorizer: func(t *testing.T) op.Authorizer {
|
authorizer: func(t *testing.T) op.Authorizer {
|
||||||
ctrl := gomock.NewController(t)
|
ctrl := gomock.NewController(t)
|
||||||
storage := mock.NewMockStorage(ctrl)
|
storage := mock.NewMockStorage(ctrl)
|
||||||
storage.EXPECT().SaveAuthCode(context.Background(), "id1", "id1")
|
storage.EXPECT().SaveAuthCode(gomock.Any(), "id1", "id1")
|
||||||
|
|
||||||
authorizer := mock.NewMockAuthorizer(ctrl)
|
authorizer := mock.NewMockAuthorizer(ctrl)
|
||||||
authorizer.EXPECT().Storage().Return(storage)
|
authorizer.EXPECT().Storage().Return(storage)
|
||||||
|
@ -1097,7 +1097,7 @@ func TestAuthResponseCode(t *testing.T) {
|
||||||
authorizer: func(t *testing.T) op.Authorizer {
|
authorizer: func(t *testing.T) op.Authorizer {
|
||||||
ctrl := gomock.NewController(t)
|
ctrl := gomock.NewController(t)
|
||||||
storage := mock.NewMockStorage(ctrl)
|
storage := mock.NewMockStorage(ctrl)
|
||||||
storage.EXPECT().SaveAuthCode(context.Background(), "id1", "id1")
|
storage.EXPECT().SaveAuthCode(gomock.Any(), "id1", "id1")
|
||||||
|
|
||||||
authorizer := mock.NewMockAuthorizer(ctrl)
|
authorizer := mock.NewMockAuthorizer(ctrl)
|
||||||
authorizer.EXPECT().Storage().Return(storage)
|
authorizer.EXPECT().Storage().Return(storage)
|
||||||
|
@ -1124,7 +1124,7 @@ func TestAuthResponseCode(t *testing.T) {
|
||||||
authorizer: func(t *testing.T) op.Authorizer {
|
authorizer: func(t *testing.T) op.Authorizer {
|
||||||
ctrl := gomock.NewController(t)
|
ctrl := gomock.NewController(t)
|
||||||
storage := mock.NewMockStorage(ctrl)
|
storage := mock.NewMockStorage(ctrl)
|
||||||
storage.EXPECT().SaveAuthCode(context.Background(), "id1", "id1")
|
storage.EXPECT().SaveAuthCode(gomock.Any(), "id1", "id1")
|
||||||
|
|
||||||
authorizer := mock.NewMockAuthorizer(ctrl)
|
authorizer := mock.NewMockAuthorizer(ctrl)
|
||||||
authorizer.EXPECT().Storage().Return(storage)
|
authorizer.EXPECT().Storage().Return(storage)
|
||||||
|
|
|
@ -108,7 +108,7 @@ func TestClientBasicAuth(t *testing.T) {
|
||||||
},
|
},
|
||||||
storage: func() op.Storage {
|
storage: func() op.Storage {
|
||||||
s := mock.NewMockStorage(gomock.NewController(t))
|
s := mock.NewMockStorage(gomock.NewController(t))
|
||||||
s.EXPECT().AuthorizeClientIDSecret(context.Background(), "foo", "wrong").Return(errWrong)
|
s.EXPECT().AuthorizeClientIDSecret(gomock.Any(), "foo", "wrong").Return(errWrong)
|
||||||
return s
|
return s
|
||||||
}(),
|
}(),
|
||||||
wantErr: errWrong,
|
wantErr: errWrong,
|
||||||
|
@ -121,7 +121,7 @@ func TestClientBasicAuth(t *testing.T) {
|
||||||
},
|
},
|
||||||
storage: func() op.Storage {
|
storage: func() op.Storage {
|
||||||
s := mock.NewMockStorage(gomock.NewController(t))
|
s := mock.NewMockStorage(gomock.NewController(t))
|
||||||
s.EXPECT().AuthorizeClientIDSecret(context.Background(), "foo", "bar").Return(nil)
|
s.EXPECT().AuthorizeClientIDSecret(gomock.Any(), "foo", "bar").Return(nil)
|
||||||
return s
|
return s
|
||||||
}(),
|
}(),
|
||||||
wantClientID: "foo",
|
wantClientID: "foo",
|
||||||
|
@ -207,7 +207,7 @@ func TestClientIDFromRequest(t *testing.T) {
|
||||||
p: testClientProvider{
|
p: testClientProvider{
|
||||||
storage: func() op.Storage {
|
storage: func() op.Storage {
|
||||||
s := mock.NewMockStorage(gomock.NewController(t))
|
s := mock.NewMockStorage(gomock.NewController(t))
|
||||||
s.EXPECT().AuthorizeClientIDSecret(context.Background(), "foo", "bar").Return(nil)
|
s.EXPECT().AuthorizeClientIDSecret(gomock.Any(), "foo", "bar").Return(nil)
|
||||||
return s
|
return s
|
||||||
}(),
|
}(),
|
||||||
},
|
},
|
||||||
|
|
|
@ -235,7 +235,7 @@ func TestRoutes(t *testing.T) {
|
||||||
contains: []string{`{"access_token":"`, `","token_type":"Bearer","expires_in":299}`},
|
contains: []string{`{"access_token":"`, `","token_type":"Bearer","expires_in":299}`},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// This call will fail. A successfull test is already
|
// This call will fail. A successful test is already
|
||||||
// part of device_test.go
|
// part of device_test.go
|
||||||
name: "device token",
|
name: "device token",
|
||||||
method: http.MethodPost,
|
method: http.MethodPost,
|
||||||
|
|
|
@ -177,7 +177,7 @@ func TestServerRoutes(t *testing.T) {
|
||||||
contains: []string{`{"access_token":"`, `","token_type":"Bearer","expires_in":299}`},
|
contains: []string{`{"access_token":"`, `","token_type":"Bearer","expires_in":299}`},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// This call will fail. A successfull test is already
|
// This call will fail. A successful test is already
|
||||||
// part of device_test.go
|
// part of device_test.go
|
||||||
name: "device token",
|
name: "device token",
|
||||||
method: http.MethodPost,
|
method: http.MethodPost,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue