diff --git a/CHANGELOG.md b/CHANGELOG.md index bb74b5ba7..0fe1d075d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,9 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). -# [8.11.0] - 2024-09-?? +# [8.11.0] - 2024-09-2? - Added RCS channel to Messages API +- Added `ackInboundMessage` and `revokeOutboundMessage` methods to `MessagesClient` - Fixed `viber_service` deserialization in `com.vonage.client.messages.Channel` - Added `thumbnail_url`, `video_url`, `image_url`, `ctwa_clid` and `media_type` to WhatsApp `Referral` - Added `_self.href` property to `com.vonage.client.messages.InboundMessage` diff --git a/src/main/java/com/vonage/client/ApiRegion.java b/src/main/java/com/vonage/client/ApiRegion.java index f7ca22772..4ba236fdc 100644 --- a/src/main/java/com/vonage/client/ApiRegion.java +++ b/src/main/java/com/vonage/client/ApiRegion.java @@ -45,6 +45,12 @@ public String toString() { return name().toLowerCase().replace("_", "-"); } + /** + * Converts a string representation of a region to the corresponding enum value. + * + * @param region The region as a string. + * @return The region enum, or {@code null} if the input is {@code null}. + */ @JsonCreator public static ApiRegion fromString(String region) { if (region == null) return null; diff --git a/src/test/java/com/vonage/client/HttpConfigTest.java b/src/test/java/com/vonage/client/HttpConfigTest.java index 0ebf71518..d18b804dd 100644 --- a/src/test/java/com/vonage/client/HttpConfigTest.java +++ b/src/test/java/com/vonage/client/HttpConfigTest.java @@ -39,6 +39,7 @@ static void assertDefaults(HttpConfig config) { assertEquals(EXPECTED_DEFAULT_REST_BASE_URI, config.getRestBaseUri()); assertEquals(EXPECTED_DEFAULT_API_EU_BASE_URI, config.getApiEuBaseUri()); assertEquals(EXPECTED_DEFAULT_VIDEO_BASE_URI, config.getVideoBaseUri()); + assertEquals(URI.create(EXPECTED_DEFAULT_API_EU_BASE_URI), config.getRegionalBaseUri(ApiRegion.API_EU)); } @Test diff --git a/src/test/java/com/vonage/client/messages/MessagesClientTest.java b/src/test/java/com/vonage/client/messages/MessagesClientTest.java index c0d2d5574..4858bf926 100644 --- a/src/test/java/com/vonage/client/messages/MessagesClientTest.java +++ b/src/test/java/com/vonage/client/messages/MessagesClientTest.java @@ -24,6 +24,7 @@ import com.vonage.client.messages.mms.MmsAudioRequest; import com.vonage.client.messages.mms.MmsImageRequest; import com.vonage.client.messages.mms.MmsVcardRequest; +import com.vonage.client.messages.mms.MmsVideoRequest; import com.vonage.client.messages.rcs.*; import com.vonage.client.messages.sms.SmsTextRequest; import com.vonage.client.messages.viber.ViberFileRequest; @@ -119,7 +120,7 @@ public void testSendMmsSuccess() throws Exception { assertResponse(MmsVcardRequest.builder().url(VCARD)); assertResponse(MmsImageRequest.builder().url(IMAGE)); assertResponse(MmsAudioRequest.builder().url(AUDIO)); - assertResponse(MmsAudioRequest.builder().url(VIDEO)); + assertResponse(MmsVideoRequest.builder().url(VIDEO)); } @Test