File tree 1 file changed +9
-4
lines changed
src/test/kotlin/com/vonage/client/kt 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ abstract class AbstractTest {
51
51
}
52
52
53
53
protected enum class AuthType {
54
- JWT , API_KEY_SECRET
54
+ JWT , API_KEY_SECRET_HEADER , API_KEY_SECRET_QUERY_PARAMS
55
55
}
56
56
57
57
protected fun baseMockRequest (
@@ -65,9 +65,14 @@ abstract class AbstractTest {
65
65
url equalTo expectedUrl
66
66
headers contains " User-Agent" like " vonage-java-sdk\\ /.+ java\\ /.+"
67
67
if (authType != null ) {
68
- headers contains " Authorization" like when (authType) {
69
- AuthType .JWT -> " Bearer eyJ0eXBlIjoiSldUIiwiYWxnIjoiUlMyNTYifQ(\\ ..+){2}"
70
- AuthType .API_KEY_SECRET -> " Basic $apiKeySecretEncoded "
68
+ val headerContainsAuth = headers contains " Authorization"
69
+ when (authType) {
70
+ AuthType .JWT -> headerContainsAuth like " Bearer eyJ0eXBlIjoiSldUIiwiYWxnIjoiUlMyNTYifQ(\\ ..+){2}"
71
+ AuthType .API_KEY_SECRET_HEADER -> headerContainsAuth equalTo " Basic $apiKeySecretEncoded "
72
+ AuthType .API_KEY_SECRET_QUERY_PARAMS -> {
73
+ headers contains " api_key" equalTo apiKey
74
+ headers contains " api_secret" equalTo apiSecret
75
+ }
71
76
}
72
77
}
73
78
if (contentType != null ) {
You can’t perform that action at this time.
0 commit comments