forked from ory/hydra-oracle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
client_test.go
39 lines (30 loc) · 848 Bytes
/
client_test.go
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
29
30
31
32
33
34
35
36
37
38
39
package main
import (
"testing"
"log"
"os"
_ "github.com/lib/pq"
"github.com/ory/fosite"
"github.com/ory/hydra/client"
)
var clientManager *ClientManager
func init() {
db := connect(os.Getenv("ORACLE_DSN"))
clientManager = &ClientManager{
DB: db,
Hasher: &fosite.BCrypt{WorkFactor: 4},
Table: randomTableName("oauth2"),
}
if _, err := clientManager.CreateSchemas(); err != nil {
log.Fatalf("Could not create client schema table %s because %s", clientManager.GetTable(), err)
}
}
func TestClientAutoGenerateKey(t *testing.T) {
client.TestHelperClientAutoGenerateKey("ora", clientManager)(t)
}
func TestCreateGetDeleteClient(t *testing.T) {
client.TestHelperCreateGetDeleteClient("ora", clientManager)(t)
}
func TestAuthenticateClient(t *testing.T) {
client.TestHelperClientAuthenticate("ora", clientManager)(t)
}