onasty/e2e/oauth_provider_mock_test.go(view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
package e2e_test
import (
"context"
"github.com/olexsmir/onasty/internal/oauth"
)
var _ oauth.Provider = (*oauthProviderMock)(nil)
type oauthProviderMock struct{}
func newOauthProviderMock() *oauthProviderMock {
return &oauthProviderMock{}
}
func (o *oauthProviderMock) GetAuthURL(_ string) string {
return "https://example.com/oauth/authorize"
}
func (o *oauthProviderMock) ExchangeCode(_ context.Context, _ string) (oauth.UserInfo, error) {
return oauth.UserInfo{
Provider: "google",
ProviderID: "1234567890",
Email: "testing@mail.org",
EmailVerified: false,
}, nil
}
|