mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 11:06:49 +00:00
Accept true / false without quotes in Dynamic Entity field values. Allow tests to run
This commit is contained in:
parent
7dd62a89b4
commit
bd20986670
@ -568,7 +568,7 @@
|
||||
<forkMode>once</forkMode>
|
||||
<junitxml>.</junitxml>
|
||||
<filereports>WDF TestSuite.txt</filereports>
|
||||
<argLine>-Drun.mode=test -XX:MaxMetaspaceSize=512m -Xms512m -Xmx512m</argLine>
|
||||
<argLine>-Drun.mode=test -XX:MaxMetaspaceSize=512m -Xms512m -Xmx512m --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED</argLine>
|
||||
<tagsToExclude>code.external</tagsToExclude>
|
||||
</configuration>
|
||||
<executions>
|
||||
|
||||
@ -195,15 +195,17 @@ object DynamicEntityFieldType extends OBPEnumeration[DynamicEntityFieldType]{
|
||||
object number extends Value{val jValueType = classOf[JDouble]}
|
||||
object integer extends Value{val jValueType = classOf[JInt]}
|
||||
object boolean extends Value {
|
||||
val jValueType = classOf[JString]
|
||||
val jValueType = classOf[JValue]
|
||||
override def isJValueValid(jValue: JValue): Boolean = {
|
||||
super.isJValueValid(jValue) && {
|
||||
val value = jValue.asInstanceOf[JString].s
|
||||
val lowerValue = value.toLowerCase
|
||||
lowerValue == "true" || lowerValue == "false"
|
||||
jValue match {
|
||||
case JBool(_) => true
|
||||
case JString(s) =>
|
||||
val lowerValue = s.toLowerCase
|
||||
lowerValue == "true" || lowerValue == "false"
|
||||
case _ => false
|
||||
}
|
||||
}
|
||||
override def wrongTypeMsg: String = s"""the value's type should be string "true" or "false"."""
|
||||
override def wrongTypeMsg: String = s"""the value's type should be boolean (true/false) or string ("true"/"false")."""
|
||||
}
|
||||
object string extends Value{
|
||||
val jValueType = classOf[JString]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user