@@ -14,10 +14,13 @@ class AuthorizationRequestSpec extends AnyFlatSpec {
14
14
),
15
15
Map ()
16
16
)
17
- val Some (c) = request.parseClientCredential
18
- .fold[Option [ClientCredential ]](None )(_.fold(_ => None , c => Some (c)))
19
- c.clientId should be(" client_id_value" )
20
- c.clientSecret should be(Some (" client_secret_value" ))
17
+
18
+ request.parseClientCredential
19
+ .fold[Option [ClientCredential ]](None )(
20
+ _.fold(_ => None , c => Some (c))
21
+ ) should contain(
22
+ ClientCredential (" client_id_value" , Some (" client_secret_value" ))
23
+ )
21
24
}
22
25
23
26
it should " fetch Basic64 by case insensitive" in {
@@ -29,10 +32,13 @@ class AuthorizationRequestSpec extends AnyFlatSpec {
29
32
),
30
33
Map ()
31
34
)
32
- val Some (c) = request.parseClientCredential
33
- .fold[Option [ClientCredential ]](None )(_.fold(_ => None , c => Some (c)))
34
- c.clientId should be(" client_id_value" )
35
- c.clientSecret should be(Some (" client_secret_value" ))
35
+
36
+ request.parseClientCredential
37
+ .fold[Option [ClientCredential ]](None )(
38
+ _.fold(_ => None , c => Some (c))
39
+ ) should contain(
40
+ ClientCredential (" client_id_value" , Some (" client_secret_value" ))
41
+ )
36
42
}
37
43
38
44
it should " fetch authorization header without colon" in {
@@ -50,10 +56,10 @@ class AuthorizationRequestSpec extends AnyFlatSpec {
50
56
Map (" Authorization" -> Seq (" Basic Y2xpZW50X2lkX3ZhbHVlOg==" )),
51
57
Map ()
52
58
)
53
- val Some (c) = request.parseClientCredential
54
- .fold[Option [ClientCredential ]](None )(_.fold(_ => None , c => Some (c)))
55
- c.clientId should be( " client_id_value " )
56
- c.clientSecret should be( None )
59
+ request.parseClientCredential
60
+ .fold[Option [ClientCredential ]](None )(
61
+ _.fold(_ => None , c => Some (c) )
62
+ ) should contain( ClientCredential ( " client_id_value " , None ) )
57
63
}
58
64
59
65
it should " not fetch not Authorization key in header" in {
@@ -86,21 +92,25 @@ class AuthorizationRequestSpec extends AnyFlatSpec {
86
92
" client_secret" -> Seq (" client_secret_value" )
87
93
)
88
94
)
89
- val Some (c) = request.parseClientCredential
90
- .fold[Option [ClientCredential ]](None )(_.fold(_ => None , c => Some (c)))
91
- c.clientId should be(" client_id_value" )
92
- c.clientSecret should be(Some (" client_secret_value" ))
95
+
96
+ request.parseClientCredential
97
+ .fold[Option [ClientCredential ]](None )(
98
+ _.fold(_ => None , c => Some (c))
99
+ ) should contain(
100
+ ClientCredential (" client_id_value" , Some (" client_secret_value" ))
101
+ )
93
102
}
94
103
95
104
it should " omit client_secret" in {
96
105
val request = new AuthorizationRequest (
97
106
Map (),
98
107
Map (" client_id" -> Seq (" client_id_value" ))
99
108
)
100
- val Some (c) = request.parseClientCredential
101
- .fold[Option [ClientCredential ]](None )(_.fold(_ => None , c => Some (c)))
102
- c.clientId should be(" client_id_value" )
103
- c.clientSecret should be(None )
109
+
110
+ request.parseClientCredential
111
+ .fold[Option [ClientCredential ]](None )(
112
+ _.fold(_ => None , c => Some (c))
113
+ ) should contain(ClientCredential (" client_id_value" , None ))
104
114
}
105
115
106
116
it should " not fetch missing parameter" in {
0 commit comments