initial commit
This commit is contained in:
commit
6d0890e280
68 changed files with 5986 additions and 0 deletions
29
pkg/op/mock/client.go
Normal file
29
pkg/op/mock/client.go
Normal file
|
@ -0,0 +1,29 @@
|
|||
package mock
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
|
||||
op "github.com/caos/oidc/pkg/op"
|
||||
)
|
||||
|
||||
func NewClient(t *testing.T) op.Client {
|
||||
return NewMockClient(gomock.NewController(t))
|
||||
}
|
||||
|
||||
func NewClientExpectAny(t *testing.T, appType op.ApplicationType) op.Client {
|
||||
c := NewClient(t)
|
||||
m := c.(*MockClient)
|
||||
m.EXPECT().RedirectURIs().AnyTimes().Return([]string{
|
||||
"https://registered.com/callback",
|
||||
"http://registered.com/callback",
|
||||
"http://localhost:9999/callback",
|
||||
"custom://callback"})
|
||||
m.EXPECT().ApplicationType().AnyTimes().Return(appType)
|
||||
m.EXPECT().LoginURL(gomock.Any()).AnyTimes().DoAndReturn(
|
||||
func(id string) string {
|
||||
return "login?id=" + id
|
||||
})
|
||||
return c
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue