From c26bdeca1db01c6a6705a633b3cc8a8b4988e938 Mon Sep 17 00:00:00 2001 From: Sina Madani Date: Mon, 24 Jun 2024 11:13:54 +0100 Subject: [PATCH] Version 0.1.0 --- pom.xml | 4 ++-- src/test/kotlin/com/vonage/client/kt/AbstractTest.kt | 8 +++++--- src/test/kotlin/com/vonage/client/kt/MessagesTest.kt | 7 +------ 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 66ae72c..5744ce3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.vonage kotlin-server-sdk - 0.0.1-SNAPSHOT + 0.1.0 jar Vonage Kotlin Server SDK @@ -75,7 +75,7 @@ org.wiremock wiremock-standalone - 3.6.0 + 3.7.0 test diff --git a/src/test/kotlin/com/vonage/client/kt/AbstractTest.kt b/src/test/kotlin/com/vonage/client/kt/AbstractTest.kt index 7d4f957..8465823 100644 --- a/src/test/kotlin/com/vonage/client/kt/AbstractTest.kt +++ b/src/test/kotlin/com/vonage/client/kt/AbstractTest.kt @@ -65,10 +65,12 @@ abstract class AbstractTest { url equalTo expectedUrl headers contains "User-Agent" like "vonage-java-sdk\\/.+ java\\/.+" if (authType != null) { - val headerContainsAuth = headers contains "Authorization" + val authHeaderName = "Authorization" when (authType) { - AuthType.JWT -> headerContainsAuth like "Bearer eyJ0eXBlIjoiSldUIiwiYWxnIjoiUlMyNTYifQ(\\..+){2}" - AuthType.API_KEY_SECRET_HEADER -> headerContainsAuth equalTo "Basic $apiKeySecretEncoded" + AuthType.JWT -> headers contains authHeaderName like + "Bearer eyJ0eXBlIjoiSldUIiwiYWxnIjoiUlMyNTYifQ(\\..+){2}" + AuthType.API_KEY_SECRET_HEADER -> + headers contains authHeaderName equalTo "Basic $apiKeySecretEncoded" AuthType.API_KEY_SECRET_QUERY_PARAMS -> { headers contains "api_key" equalTo apiKey headers contains "api_secret" equalTo apiSecret diff --git a/src/test/kotlin/com/vonage/client/kt/MessagesTest.kt b/src/test/kotlin/com/vonage/client/kt/MessagesTest.kt index 7e6f34e..fff43f4 100644 --- a/src/test/kotlin/com/vonage/client/kt/MessagesTest.kt +++ b/src/test/kotlin/com/vonage/client/kt/MessagesTest.kt @@ -1,13 +1,8 @@ package com.vonage.client.kt -import com.fasterxml.jackson.databind.ObjectMapper import com.marcinziolo.kotlin.wiremock.* import com.vonage.client.common.HttpMethod -import com.vonage.client.messages.Channel -import com.vonage.client.messages.MessageRequest -import com.vonage.client.messages.MessageResponseException -import com.vonage.client.messages.MessageType -import com.vonage.client.messages.MessagesVersion +import com.vonage.client.messages.* import com.vonage.client.messages.viber.Category import com.vonage.client.messages.whatsapp.Locale import com.vonage.client.messages.whatsapp.Policy