@@ -28,6 +28,7 @@ import org.junit.jupiter.api.Test
2828import org.mybatis.dynamic.sql.exception.InvalidSqlException
2929import org.mybatis.dynamic.sql.util.Messages
3030import org.mybatis.dynamic.sql.util.kotlin.KInvalidSQLException
31+ import org.mybatis.dynamic.sql.util.kotlin.elements.`as`
3132import org.mybatis.dynamic.sql.util.kotlin.elements.case
3233import org.mybatis.dynamic.sql.util.kotlin.elements.cast
3334import org.mybatis.dynamic.sql.util.kotlin.elements.isEqualTo
@@ -63,7 +64,7 @@ class KCaseExpressionTest {
6364 then(" Bat" )
6465 }
6566 `else `(" Not a Fox or a bat" )
66- }. `as `( " AnimalType" )
67+ } `as ` " AnimalType"
6768 ) {
6869 from(animalData, " a" )
6970 where { id.isIn(2 , 3 , 31 , 32 , 38 , 39 ) }
@@ -140,7 +141,7 @@ class KCaseExpressionTest {
140141 then(2 )
141142 }
142143 `else `(3 )
143- }. `as `( " AnimalType" )
144+ } `as ` " AnimalType"
144145 ) {
145146 from(animalData, " a" )
146147 where { id.isIn(2 , 3 , 31 , 32 , 38 , 39 ) }
@@ -217,7 +218,7 @@ class KCaseExpressionTest {
217218 then(value(" Bat" ))
218219 }
219220 `else `(cast { value(" Not a Fox or a bat" ) `as ` " VARCHAR(30)" })
220- }. `as `( " AnimalType" )
221+ } `as ` " AnimalType"
221222 ) {
222223 from(animalData, " a" )
223224 where { id.isIn(2 , 3 , 31 , 32 , 38 , 39 ) }
@@ -297,7 +298,7 @@ class KCaseExpressionTest {
297298 or { animalName isEqualTo " Big brown bat" }
298299 then(" Bat" )
299300 }
300- }. `as `( " AnimalType" )
301+ } `as ` " AnimalType"
301302 ) {
302303 from(animalData, " a" )
303304 where { id.isIn(2 , 3 , 31 , 32 , 38 , 39 ) }
@@ -379,7 +380,7 @@ class KCaseExpressionTest {
379380 then(" Fred" )
380381 }
381382 `else `(" Not a Fox or a bat" )
382- }. `as `( " AnimalType" )
383+ } `as ` " AnimalType"
383384 ) {
384385 from(animalData, " a" )
385386 where { id.isIn(2 , 3 , 4 , 31 , 32 , 38 , 39 ) }
@@ -458,7 +459,7 @@ class KCaseExpressionTest {
458459 case(animalName) {
459460 `when ` (isEqualTo(" Artic fox" ), isEqualTo(" Red fox" )) { then(" yes" ) }
460461 `else `(" no" )
461- }. `as `( " IsAFox" )
462+ } `as ` " IsAFox"
462463 ) {
463464 from(animalData)
464465 where { id.isIn(31 , 32 , 38 , 39 ) }
@@ -512,7 +513,7 @@ class KCaseExpressionTest {
512513 case(animalName) {
513514 `when ` (" Artic fox" , " Red fox" ) { then(" yes" ) }
514515 `else `(" no" )
515- }. `as `( " IsAFox" )
516+ } `as ` " IsAFox"
516517 ) {
517518 from(animalData)
518519 where { id.isIn(31 , 32 , 38 , 39 ) }
@@ -566,7 +567,7 @@ class KCaseExpressionTest {
566567 case(animalName) {
567568 `when ` (isEqualTo(" Artic fox" ), isEqualTo(" Red fox" )) { then(true ) }
568569 `else `(false )
569- }. `as `( " IsAFox" )
570+ } `as ` " IsAFox"
570571 ) {
571572 from(animalData)
572573 where { id.isIn(31 , 32 , 38 , 39 ) }
@@ -620,7 +621,7 @@ class KCaseExpressionTest {
620621 case(animalName) {
621622 `when ` (" Artic fox" , " Red fox" ) { then(true ) }
622623 `else `(false )
623- }. `as `( " IsAFox" )
624+ } `as ` " IsAFox"
624625 ) {
625626 from(animalData)
626627 where { id.isIn(31 , 32 , 38 , 39 ) }
@@ -673,7 +674,7 @@ class KCaseExpressionTest {
673674 animalName,
674675 case(animalName) {
675676 `when `(isEqualTo(" Artic fox" ), isEqualTo(" Red fox" )) { then(" yes" ) }
676- }. `as `( " IsAFox" )
677+ } `as ` " IsAFox"
677678 ) {
678679 from(animalData)
679680 where { id.isIn(31 , 32 , 38 , 39 ) }
@@ -721,7 +722,7 @@ class KCaseExpressionTest {
721722 case(animalName) {
722723 `when `(isEqualTo(" Artic fox" ), isEqualTo(" Red fox" )) { then(cast { " It's a fox" `as ` " VARCHAR(30)" })}
723724 `else `(" It's not a fox" )
724- }. `as `( " IsAFox" )
725+ } `as ` " IsAFox"
725726 ) {
726727 from(animalData)
727728 where { id.isIn(31 , 32 , 38 , 39 ) }
@@ -764,7 +765,7 @@ class KCaseExpressionTest {
764765 case(animalName) {
765766 `when `(isEqualTo(" Artic fox" ), isEqualTo(" Red fox" )) { then( 1L ) }
766767 `else `(2L )
767- }. `as `( " IsAFox" )
768+ } `as ` " IsAFox"
768769 ) {
769770 from(animalData)
770771 where { id.isIn(31 , 32 , 38 , 39 ) }
@@ -807,7 +808,7 @@ class KCaseExpressionTest {
807808 case(animalName) {
808809 `when `(isEqualTo(" Artic fox" ), isEqualTo(" Red fox" )) { then( 1.1 ) }
809810 `else `(2.2 )
810- }. `as `( " IsAFox" )
811+ } `as ` " IsAFox"
811812 ) {
812813 from(animalData)
813814 where { id.isIn(31 , 32 , 38 , 39 ) }
@@ -850,7 +851,7 @@ class KCaseExpressionTest {
850851 case(animalName) {
851852 `when `(isEqualTo(" Artic fox" ), isEqualTo(" Red fox" )) { then( 1.1 ) }
852853 `else `(cast { 2.2 `as ` " DOUBLE" })
853- }. `as `( " IsAFox" )
854+ } `as ` " IsAFox"
854855 ) {
855856 from(animalData)
856857 where { id.isIn(31 , 32 , 38 , 39 ) }
0 commit comments