diff --git a/testApi/src/main/scala/africa/absa/testing/scapi/rest/response/action/types/AssertResponseActionType.scala b/testApi/src/main/scala/africa/absa/testing/scapi/rest/response/action/types/AssertResponseActionType.scala index 7c70d7d..a0b07b3 100644 --- a/testApi/src/main/scala/africa/absa/testing/scapi/rest/response/action/types/AssertResponseActionType.scala +++ b/testApi/src/main/scala/africa/absa/testing/scapi/rest/response/action/types/AssertResponseActionType.scala @@ -52,7 +52,4 @@ object AssertResponseActionType extends Enumeration { private val stringToValueMap = values.map(v => v.toString -> v).toMap def fromString(s: String): Option[AssertResponseActionType] = stringToValueMap.get(s) - - // Implicit conversion from AssertResponseActionType to String - implicit def enumValueToString(value: AssertResponseActionType): String = value.toString } diff --git a/testApi/src/main/scala/africa/absa/testing/scapi/rest/response/action/types/ExtractJsonResponseActionType.scala b/testApi/src/main/scala/africa/absa/testing/scapi/rest/response/action/types/ExtractJsonResponseActionType.scala index b438e84..7b362a2 100644 --- a/testApi/src/main/scala/africa/absa/testing/scapi/rest/response/action/types/ExtractJsonResponseActionType.scala +++ b/testApi/src/main/scala/africa/absa/testing/scapi/rest/response/action/types/ExtractJsonResponseActionType.scala @@ -26,9 +26,6 @@ object ExtractJsonResponseActionType extends Enumeration { private val stringToValueMap = values.map(v => v.toString -> v).toMap def fromString(s: String): Option[ExtractJsonResponseActionType] = stringToValueMap.get(s) - - // Implicit conversion from AssertResponseActionType to String - implicit def enumValueToString(value: ExtractJsonResponseActionType): String = value.toString } diff --git a/testApi/src/main/scala/africa/absa/testing/scapi/rest/response/action/types/LogResponseActionType.scala b/testApi/src/main/scala/africa/absa/testing/scapi/rest/response/action/types/LogResponseActionType.scala index e385057..3cd29c3 100644 --- a/testApi/src/main/scala/africa/absa/testing/scapi/rest/response/action/types/LogResponseActionType.scala +++ b/testApi/src/main/scala/africa/absa/testing/scapi/rest/response/action/types/LogResponseActionType.scala @@ -29,7 +29,4 @@ object LogResponseActionType extends Enumeration { private val stringToValueMap = values.map(v => v.toString -> v).toMap def fromString(s: String): Option[LogResponseActionType] = stringToValueMap.get(s) - - // Implicit conversion from AssertResponseActionType to String - implicit def enumValueToString(value: LogResponseActionType): String = value.toString } diff --git a/testApi/src/test/scala/africa/absa/testing/scapi/rest/response/ResponseAssertionsTest.scala b/testApi/src/test/scala/africa/absa/testing/scapi/rest/response/ResponseAssertionsTest.scala index 04c8e45..948e0a5 100644 --- a/testApi/src/test/scala/africa/absa/testing/scapi/rest/response/ResponseAssertionsTest.scala +++ b/testApi/src/test/scala/africa/absa/testing/scapi/rest/response/ResponseAssertionsTest.scala @@ -19,12 +19,17 @@ package africa.absa.testing.scapi.rest.response import africa.absa.testing.scapi.json.ResponseAction import africa.absa.testing.scapi.rest.model.CookieValue import africa.absa.testing.scapi.rest.response.action.AssertionResponseAction +import africa.absa.testing.scapi.rest.response.action.types.AssertResponseActionType.AssertResponseActionType import africa.absa.testing.scapi.rest.response.action.types.{AssertResponseActionType, ResponseActionGroupType} import africa.absa.testing.scapi.{ContentValidationFailedException, UndefinedResponseActionTypeException} import munit.FunSuite +import scala.language.implicitConversions + class ResponseAssertionsTest extends FunSuite { + implicit def assertResponseActionType2String(value: AssertResponseActionType): String = value.toString + /* validateContent */ diff --git a/testApi/src/test/scala/africa/absa/testing/scapi/rest/response/ResponseExtractTest.scala b/testApi/src/test/scala/africa/absa/testing/scapi/rest/response/ResponseExtractTest.scala index 49d163a..df18095 100644 --- a/testApi/src/test/scala/africa/absa/testing/scapi/rest/response/ResponseExtractTest.scala +++ b/testApi/src/test/scala/africa/absa/testing/scapi/rest/response/ResponseExtractTest.scala @@ -19,14 +19,18 @@ package africa.absa.testing.scapi.rest.response import africa.absa.testing.scapi.{AssertionException, ContentValidationFailedException, UndefinedResponseActionTypeException} import africa.absa.testing.scapi.json.ResponseAction import africa.absa.testing.scapi.rest.response.action.ExtractJsonResponseAction +import africa.absa.testing.scapi.rest.response.action.types.ExtractJsonResponseActionType.ExtractJsonResponseActionType import africa.absa.testing.scapi.rest.response.action.types.{ExtractJsonResponseActionType, ResponseActionGroupType} import africa.absa.testing.scapi.utils.cache.RuntimeCache import munit.FunSuite +import scala.language.implicitConversions import scala.util.{Failure, Try} class ResponseExtractTest extends FunSuite { + implicit def extractJsonResponseActionType2String(value: ExtractJsonResponseActionType): String = value.toString + val assertionStringFromList: ResponseAction = ResponseAction(group = ResponseActionGroupType.EXTRACT_JSON, name = ExtractJsonResponseActionType.STRING_FROM_LIST, Map("cacheKey" -> "question_id", "listIndex" -> "1", "jsonKey" -> "id", "cacheLevel" -> "suite")) val assertionUnsupported: ResponseAction = ResponseAction(group = ResponseActionGroupType.EXTRACT_JSON, name = "Unsupported", Map("cacheKey" -> "key", "listIndex" -> "200", "jsonKey" -> "jsonKey", "cacheLevel" -> "Test")) diff --git a/testApi/src/test/scala/africa/absa/testing/scapi/rest/response/ResponseLogTest.scala b/testApi/src/test/scala/africa/absa/testing/scapi/rest/response/ResponseLogTest.scala index 359dd96..d4d754f 100644 --- a/testApi/src/test/scala/africa/absa/testing/scapi/rest/response/ResponseLogTest.scala +++ b/testApi/src/test/scala/africa/absa/testing/scapi/rest/response/ResponseLogTest.scala @@ -18,12 +18,17 @@ package africa.absa.testing.scapi.rest.response import africa.absa.testing.scapi.json.ResponseAction import africa.absa.testing.scapi.rest.response.action.LogResponseAction +import africa.absa.testing.scapi.rest.response.action.types.LogResponseActionType.LogResponseActionType import africa.absa.testing.scapi.rest.response.action.types.{ResponseActionGroupType, LogResponseActionType => LogType} import munit.FunSuite +import scala.language.implicitConversions + class ResponseLogTest extends FunSuite { + implicit def logResponseActionType2String(value: LogResponseActionType): String = value.toString + /* validateContent */