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 312758f02..01d4df903 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 = "" 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 73c446ac5..ce729b21a 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 0f580fcd9..5623210e1 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 c44d1458c..529c788c2 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 a05fbca59..dcc30a1cd 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 aaa29e217..538805298 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 8873202d1..9154b29ea 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 1c85ed704..09892dadd 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 70e0bd6c4..e1ef51a96 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 1de3c8fa9..44f3f8910 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 fecd77103..6cb5e2f52 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 ca0b18cca..c007012ee 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 8e7f434e6..22cf4146f 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 33c42e997..156da699d 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 15ab3aded..e46977886 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 c9bd89aff..539043349 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 56a5f7524..8a2ed7c24 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 8624b138a..b18b0130f 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 94b48e649..3773019f6 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 4543c06be..910a5f8ec 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 e5a528376..65b502084 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 5c64c6aef..e66de5a50 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 6617d1f6d..d415a6a13 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 f81e8d3fc..6d9948306 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 3272203d8..455f7ca43 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