-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
dsl/jpql/src/test/kotlin/com/linecorp/kotlinjdsl/dsl/jpql/expression/LowerDslTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.linecorp.kotlinjdsl.dsl.jpql.expression | ||
|
||
import com.linecorp.kotlinjdsl.dsl.jpql.queryPart | ||
import com.linecorp.kotlinjdsl.querymodel.jpql.expression.Expression | ||
import com.linecorp.kotlinjdsl.querymodel.jpql.expression.Expressions | ||
import org.assertj.core.api.WithAssertions | ||
import org.junit.jupiter.api.Test | ||
|
||
class LowerDslTest : WithAssertions { | ||
private val string1 = "string1" | ||
|
||
private val stringExpression1 = Expressions.value("string1") | ||
|
||
@Test | ||
fun `lower() with a string`() { | ||
// when | ||
val expression = queryPart { | ||
lower(string1) | ||
}.toExpression() | ||
|
||
val actual: Expression<String> = expression // for type check | ||
|
||
// then | ||
val expected = Expressions.lower( | ||
Expressions.value(string1), | ||
) | ||
|
||
assertThat(actual).isEqualTo(expected) | ||
} | ||
|
||
@Test | ||
fun `lower() with a string expression`() { | ||
// when | ||
val expression = queryPart { | ||
lower(stringExpression1) | ||
}.toExpression() | ||
|
||
val actual: Expression<String> = expression // for type check | ||
|
||
// then | ||
val expected = Expressions.lower( | ||
stringExpression1, | ||
) | ||
|
||
assertThat(actual).isEqualTo(expected) | ||
} | ||
} |