all repos

onasty @ 4850d623a769de42500c7839a42d4e01b88d1056

a one-time notes service

onasty/e2e/oauth_provider_mock_test.go (view raw)

Olexandr Smirnov Olexandr Smirnov
ss2316544@gmail.com
refactor(e2e): name stubs as stubs (#163), 11 months ago
1
package e2e_test
2
3
import (
4
	"context"
5
6
	"github.com/olexsmir/onasty/internal/oauth"
7
)
8
9
var _ oauth.Provider = (*oauthProviderStub)(nil)
10
11
type oauthProviderStub struct{}
12
13
func newOauthProviderStub() *oauthProviderStub {
14
	return &oauthProviderStub{}
15
}
16
17
func (o *oauthProviderStub) GetAuthURL(_ string) string {
18
	return "https://example.com/oauth/authorize"
19
}
20
21
func (o *oauthProviderStub) ExchangeCode(_ context.Context, _ string) (oauth.UserInfo, error) {
22
	return oauth.UserInfo{
23
		Provider:      "google",
24
		ProviderID:    "1234567890",
25
		Email:         "testing@mail.org",
26
		EmailVerified: false,
27
	}, nil
28
}