From 6aae5a0d73ace98190d5d78766d39bacc1462f3a Mon Sep 17 00:00:00 2001 From: Manaswini Ragamouni Date: Mon, 6 Apr 2026 20:20:27 +0000 Subject: [PATCH 1/2] Add isIndexNotFoundException utility to AlertingException Walks the exception cause chain to detect IndexNotFoundException. Needed for SDK migration where exceptions are wrapped. Signed-off-by: Manaswini Ragamouni --- .../commons/alerting/util/AlertingException.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/kotlin/org/opensearch/commons/alerting/util/AlertingException.kt b/src/main/kotlin/org/opensearch/commons/alerting/util/AlertingException.kt index 312758f0..01d4df90 100644 --- a/src/main/kotlin/org/opensearch/commons/alerting/util/AlertingException.kt +++ b/src/main/kotlin/org/opensearch/commons/alerting/util/AlertingException.kt @@ -70,6 +70,24 @@ class AlertingException(message: String, val status: RestStatus, val ex: Excepti return AlertingException(friendlyMsg, status, Exception("${ex.javaClass.name}: ${ex.message}")) } + /** + * Checks whether the given throwable (or any of its causes) is an IndexNotFoundException. + * The remote metadata SDK wraps IndexNotFoundException inside OpenSearchStatusException, + * so the original "no such index" message may be buried in the cause chain. + */ + @JvmStatic + fun isIndexNotFoundException(e: Throwable): Boolean { + var cause: Throwable? = e + while (cause != null) { + if (cause is IndexNotFoundException || cause.message?.contains("no such index") == true) { + log.debug("IndexNotFoundException found in cause chain: ${cause.message}") + return true + } + cause = cause.cause + } + return false + } + @JvmStatic fun merge(vararg ex: AlertingException): AlertingException { var friendlyMsg = "" From 49ada8d9a43749fd3ed6b3509d36edad860c8482 Mon Sep 17 00:00:00 2001 From: Manaswini Ragamouni Date: Thu, 9 Apr 2026 18:12:40 +0000 Subject: [PATCH 2/2] Fix Jackson exception class in notification tests Update test assertions from com.fasterxml.jackson.core.JsonParseException to org.opensearch.tools.jackson.core.JsonParseException to match the Jackson repackaging in OpenSearch core. Signed-off-by: Manaswini Ragamouni --- .../action/CreateNotificationConfigRequestTests.kt | 3 +-- .../action/CreateNotificationConfigResponseTests.kt | 3 +-- .../action/DeleteNotificationConfigRequestTests.kt | 3 +-- .../action/DeleteNotificationConfigResponseTests.kt | 3 +-- .../commons/notifications/action/GetChannelListRequestTests.kt | 3 +-- .../notifications/action/GetNotificationConfigRequestTests.kt | 3 +-- .../notifications/action/GetPluginFeaturesRequestTests.kt | 3 +-- .../notifications/action/SendNotificationRequestTests.kt | 3 +-- .../notifications/action/SendNotificationResponseTests.kt | 3 +-- .../action/UpdateNotificationConfigRequestTests.kt | 3 +-- .../action/UpdateNotificationConfigResponseTests.kt | 3 +-- .../org/opensearch/commons/notifications/model/ChimeTests.kt | 3 +-- .../commons/notifications/model/DeliveryStatusTests.kt | 3 +-- .../opensearch/commons/notifications/model/EmailGroupTests.kt | 3 +-- .../commons/notifications/model/EmailRecipientStatusTests.kt | 3 +-- .../commons/notifications/model/EmailRecipientTests.kt | 3 +-- .../org/opensearch/commons/notifications/model/EmailTests.kt | 3 +-- .../opensearch/commons/notifications/model/EventStatusTests.kt | 3 +-- .../commons/notifications/model/MicrosoftTeamsTests.kt | 3 +-- .../opensearch/commons/notifications/model/SesAccountTests.kt | 3 +-- .../org/opensearch/commons/notifications/model/SlackTests.kt | 3 +-- .../opensearch/commons/notifications/model/SmtpAccountTests.kt | 3 +-- .../org/opensearch/commons/notifications/model/SnsTests.kt | 3 +-- .../org/opensearch/commons/notifications/model/WebhookTests.kt | 3 +-- 24 files changed, 24 insertions(+), 48 deletions(-) diff --git a/src/test/kotlin/org/opensearch/commons/notifications/action/CreateNotificationConfigRequestTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/action/CreateNotificationConfigRequestTests.kt index 73c446ac..ce729b21 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/action/CreateNotificationConfigRequestTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/action/CreateNotificationConfigRequestTests.kt @@ -4,7 +4,6 @@ */ package org.opensearch.commons.notifications.action -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertNull import org.junit.jupiter.api.Test @@ -23,7 +22,7 @@ import org.opensearch.commons.notifications.model.Webhook import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject - +import org.opensearch.tools.jackson.core.JsonParseException internal class CreateNotificationConfigRequestTests { private fun createWebhookContentConfigObject(): NotificationConfig { diff --git a/src/test/kotlin/org/opensearch/commons/notifications/action/CreateNotificationConfigResponseTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/action/CreateNotificationConfigResponseTests.kt index 0f580fcd..5623210e 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/action/CreateNotificationConfigResponseTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/action/CreateNotificationConfigResponseTests.kt @@ -4,14 +4,13 @@ */ package org.opensearch.commons.notifications.action -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject - +import org.opensearch.tools.jackson.core.JsonParseException internal class CreateNotificationConfigResponseTests { @Test diff --git a/src/test/kotlin/org/opensearch/commons/notifications/action/DeleteNotificationConfigRequestTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/action/DeleteNotificationConfigRequestTests.kt index c44d1458..529c788c 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/action/DeleteNotificationConfigRequestTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/action/DeleteNotificationConfigRequestTests.kt @@ -4,14 +4,13 @@ */ package org.opensearch.commons.notifications.action -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject - +import org.opensearch.tools.jackson.core.JsonParseException internal class DeleteNotificationConfigRequestTests { @Test diff --git a/src/test/kotlin/org/opensearch/commons/notifications/action/DeleteNotificationConfigResponseTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/action/DeleteNotificationConfigResponseTests.kt index a05fbca5..dcc30a1c 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/action/DeleteNotificationConfigResponseTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/action/DeleteNotificationConfigResponseTests.kt @@ -4,7 +4,6 @@ */ package org.opensearch.commons.notifications.action -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows @@ -12,7 +11,7 @@ import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject import org.opensearch.core.rest.RestStatus - +import org.opensearch.tools.jackson.core.JsonParseException internal class DeleteNotificationConfigResponseTests { @Test diff --git a/src/test/kotlin/org/opensearch/commons/notifications/action/GetChannelListRequestTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/action/GetChannelListRequestTests.kt index aaa29e21..53880529 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/action/GetChannelListRequestTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/action/GetChannelListRequestTests.kt @@ -4,14 +4,13 @@ */ package org.opensearch.commons.notifications.action -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject - +import org.opensearch.tools.jackson.core.JsonParseException internal class GetChannelListRequestTests { private fun assertGetRequestEquals( diff --git a/src/test/kotlin/org/opensearch/commons/notifications/action/GetNotificationConfigRequestTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/action/GetNotificationConfigRequestTests.kt index 8873202d..9154b29e 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/action/GetNotificationConfigRequestTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/action/GetNotificationConfigRequestTests.kt @@ -4,7 +4,6 @@ */ package org.opensearch.commons.notifications.action -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows @@ -12,7 +11,7 @@ import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject import org.opensearch.search.sort.SortOrder - +import org.opensearch.tools.jackson.core.JsonParseException internal class GetNotificationConfigRequestTests { private fun assertGetRequestEquals( diff --git a/src/test/kotlin/org/opensearch/commons/notifications/action/GetPluginFeaturesRequestTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/action/GetPluginFeaturesRequestTests.kt index 1c85ed70..09892dad 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/action/GetPluginFeaturesRequestTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/action/GetPluginFeaturesRequestTests.kt @@ -4,14 +4,13 @@ */ package org.opensearch.commons.notifications.action -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject - +import org.opensearch.tools.jackson.core.JsonParseException internal class GetPluginFeaturesRequestTests { private fun assertGetRequestEquals( diff --git a/src/test/kotlin/org/opensearch/commons/notifications/action/SendNotificationRequestTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/action/SendNotificationRequestTests.kt index 70e0bd6c..e1ef51a9 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/action/SendNotificationRequestTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/action/SendNotificationRequestTests.kt @@ -4,7 +4,6 @@ */ package org.opensearch.commons.notifications.action -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertNotNull import org.junit.jupiter.api.Assertions.assertNull @@ -16,7 +15,7 @@ import org.opensearch.commons.notifications.model.SeverityType import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject - +import org.opensearch.tools.jackson.core.JsonParseException internal class SendNotificationRequestTests { private fun assertGetRequestEquals( diff --git a/src/test/kotlin/org/opensearch/commons/notifications/action/SendNotificationResponseTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/action/SendNotificationResponseTests.kt index 1de3c8fa..44f3f891 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/action/SendNotificationResponseTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/action/SendNotificationResponseTests.kt @@ -4,7 +4,6 @@ */ package org.opensearch.commons.notifications.action -import com.fasterxml.jackson.core.JsonParseException import org.junit.Test import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.assertThrows @@ -17,7 +16,7 @@ import org.opensearch.commons.notifications.model.SeverityType import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject - +import org.opensearch.tools.jackson.core.JsonParseException internal class SendNotificationResponseTests { @Test diff --git a/src/test/kotlin/org/opensearch/commons/notifications/action/UpdateNotificationConfigRequestTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/action/UpdateNotificationConfigRequestTests.kt index fecd7710..6cb5e2f5 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/action/UpdateNotificationConfigRequestTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/action/UpdateNotificationConfigRequestTests.kt @@ -4,7 +4,6 @@ */ package org.opensearch.commons.notifications.action -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertNull import org.junit.jupiter.api.Test @@ -23,7 +22,7 @@ import org.opensearch.commons.notifications.model.Webhook import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject - +import org.opensearch.tools.jackson.core.JsonParseException internal class UpdateNotificationConfigRequestTests { private fun createWebhookContentConfigObject(): NotificationConfig { diff --git a/src/test/kotlin/org/opensearch/commons/notifications/action/UpdateNotificationConfigResponseTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/action/UpdateNotificationConfigResponseTests.kt index ca0b18cc..c007012e 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/action/UpdateNotificationConfigResponseTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/action/UpdateNotificationConfigResponseTests.kt @@ -4,14 +4,13 @@ */ package org.opensearch.commons.notifications.action -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject - +import org.opensearch.tools.jackson.core.JsonParseException internal class UpdateNotificationConfigResponseTests { @Test diff --git a/src/test/kotlin/org/opensearch/commons/notifications/model/ChimeTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/model/ChimeTests.kt index 8e7f434e..22cf4146 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/model/ChimeTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/model/ChimeTests.kt @@ -4,15 +4,14 @@ */ package org.opensearch.commons.notifications.model -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject +import org.opensearch.tools.jackson.core.JsonParseException import java.net.MalformedURLException - internal class ChimeTests { @Test diff --git a/src/test/kotlin/org/opensearch/commons/notifications/model/DeliveryStatusTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/model/DeliveryStatusTests.kt index 33c42e99..156da699 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/model/DeliveryStatusTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/model/DeliveryStatusTests.kt @@ -5,14 +5,13 @@ package org.opensearch.commons.notifications.model -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject - +import org.opensearch.tools.jackson.core.JsonParseException internal class DeliveryStatusTests { @Test fun `DeliveryStatus serialize and deserialize should be equal`() { diff --git a/src/test/kotlin/org/opensearch/commons/notifications/model/EmailGroupTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/model/EmailGroupTests.kt index 15ab3ade..e4697788 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/model/EmailGroupTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/model/EmailGroupTests.kt @@ -4,14 +4,13 @@ */ package org.opensearch.commons.notifications.model -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject - +import org.opensearch.tools.jackson.core.JsonParseException internal class EmailGroupTests { @Test diff --git a/src/test/kotlin/org/opensearch/commons/notifications/model/EmailRecipientStatusTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/model/EmailRecipientStatusTests.kt index c9bd89af..53904334 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/model/EmailRecipientStatusTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/model/EmailRecipientStatusTests.kt @@ -5,14 +5,13 @@ package org.opensearch.commons.notifications.model -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject - +import org.opensearch.tools.jackson.core.JsonParseException internal class EmailRecipientStatusTests { @Test fun `EmailRecipientStatus serialize and deserialize should be equal`() { diff --git a/src/test/kotlin/org/opensearch/commons/notifications/model/EmailRecipientTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/model/EmailRecipientTests.kt index 56a5f752..8a2ed7c2 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/model/EmailRecipientTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/model/EmailRecipientTests.kt @@ -4,7 +4,6 @@ */ package org.opensearch.commons.notifications.model -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow @@ -12,7 +11,7 @@ import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject - +import org.opensearch.tools.jackson.core.JsonParseException internal class EmailRecipientTests { private fun checkValidEmailAddress(emailAddress: String) { diff --git a/src/test/kotlin/org/opensearch/commons/notifications/model/EmailTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/model/EmailTests.kt index 8624b138..b18b0130 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/model/EmailTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/model/EmailTests.kt @@ -4,14 +4,13 @@ */ package org.opensearch.commons.notifications.model -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject - +import org.opensearch.tools.jackson.core.JsonParseException internal class EmailTests { @Test diff --git a/src/test/kotlin/org/opensearch/commons/notifications/model/EventStatusTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/model/EventStatusTests.kt index 94b48e64..3773019f 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/model/EventStatusTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/model/EventStatusTests.kt @@ -4,7 +4,6 @@ */ package org.opensearch.commons.notifications.model -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test @@ -12,7 +11,7 @@ import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject - +import org.opensearch.tools.jackson.core.JsonParseException internal class EventStatusTests { @Test diff --git a/src/test/kotlin/org/opensearch/commons/notifications/model/MicrosoftTeamsTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/model/MicrosoftTeamsTests.kt index 4543c06b..910a5f8e 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/model/MicrosoftTeamsTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/model/MicrosoftTeamsTests.kt @@ -4,15 +4,14 @@ */ package org.opensearch.commons.notifications.model -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject +import org.opensearch.tools.jackson.core.JsonParseException import java.net.MalformedURLException - internal class MicrosoftTeamsTests { @Test diff --git a/src/test/kotlin/org/opensearch/commons/notifications/model/SesAccountTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/model/SesAccountTests.kt index e5a52837..65b50208 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/model/SesAccountTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/model/SesAccountTests.kt @@ -5,14 +5,13 @@ package org.opensearch.commons.notifications.model -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject - +import org.opensearch.tools.jackson.core.JsonParseException internal class SesAccountTests { @Test diff --git a/src/test/kotlin/org/opensearch/commons/notifications/model/SlackTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/model/SlackTests.kt index 5c64c6ae..e66de5a5 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/model/SlackTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/model/SlackTests.kt @@ -4,15 +4,14 @@ */ package org.opensearch.commons.notifications.model -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject +import org.opensearch.tools.jackson.core.JsonParseException import java.net.MalformedURLException - internal class SlackTests { @Test diff --git a/src/test/kotlin/org/opensearch/commons/notifications/model/SmtpAccountTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/model/SmtpAccountTests.kt index 6617d1f6..d415a6a1 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/model/SmtpAccountTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/model/SmtpAccountTests.kt @@ -4,14 +4,13 @@ */ package org.opensearch.commons.notifications.model -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject - +import org.opensearch.tools.jackson.core.JsonParseException internal class SmtpAccountTests { @Test diff --git a/src/test/kotlin/org/opensearch/commons/notifications/model/SnsTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/model/SnsTests.kt index f81e8d3f..6d994830 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/model/SnsTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/model/SnsTests.kt @@ -5,7 +5,6 @@ package org.opensearch.commons.notifications.model -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Assertions.assertThrows import org.junit.jupiter.api.Assertions.fail @@ -13,7 +12,7 @@ import org.junit.jupiter.api.Test import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject - +import org.opensearch.tools.jackson.core.JsonParseException internal class SnsTests { @Test diff --git a/src/test/kotlin/org/opensearch/commons/notifications/model/WebhookTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/model/WebhookTests.kt index 3272203d..455f7ca4 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/model/WebhookTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/model/WebhookTests.kt @@ -4,15 +4,14 @@ */ package org.opensearch.commons.notifications.model -import com.fasterxml.jackson.core.JsonParseException import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.opensearch.commons.utils.createObjectFromJsonString import org.opensearch.commons.utils.getJsonString import org.opensearch.commons.utils.recreateObject +import org.opensearch.tools.jackson.core.JsonParseException import java.net.MalformedURLException - internal class WebhookTests { @Test