#342 - Polishing.
Remove Kotlin extension for Criteria as it should live in Spring Data Relational. Add author tags. Reformat code.
This commit is contained in:
@@ -22,6 +22,7 @@ import static org.springframework.data.domain.Sort.Order.*;
|
||||
import java.util.Collections;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.r2dbc.convert.MappingR2dbcConverter;
|
||||
import org.springframework.data.r2dbc.convert.R2dbcConverter;
|
||||
@@ -31,10 +32,10 @@ import org.springframework.data.r2dbc.dialect.PostgresDialect;
|
||||
import org.springframework.data.r2dbc.mapping.R2dbcMappingContext;
|
||||
import org.springframework.data.r2dbc.mapping.SettableValue;
|
||||
import org.springframework.data.relational.core.mapping.Column;
|
||||
import org.springframework.data.relational.core.query.Criteria;
|
||||
import org.springframework.data.relational.core.sql.Expression;
|
||||
import org.springframework.data.relational.core.sql.Functions;
|
||||
import org.springframework.data.relational.core.sql.Table;
|
||||
import org.springframework.data.relational.core.query.Criteria;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link QueryMapper}.
|
||||
|
||||
@@ -26,7 +26,6 @@ import org.springframework.data.r2dbc.query.Criteria
|
||||
* Unit tests for [Criteria.CriteriaStep] extensions.
|
||||
*
|
||||
* @author Jonas Bark
|
||||
* @author Mingyuan Wu
|
||||
*/
|
||||
class CriteriaStepExtensionsTests {
|
||||
|
||||
@@ -74,49 +73,4 @@ class CriteriaStepExtensionsTests {
|
||||
spec.`in`(listOf("test"))
|
||||
}
|
||||
}
|
||||
|
||||
@Test // gh-122
|
||||
fun eqIsCriteriaStepForSpringData2() {
|
||||
|
||||
val spec = mockk<org.springframework.data.relational.core.query.Criteria.CriteriaStep>()
|
||||
val criteria = mockk<org.springframework.data.relational.core.query.Criteria>()
|
||||
|
||||
every { spec.`is`("test") } returns criteria
|
||||
|
||||
assertThat(spec isEquals "test").isEqualTo(criteria)
|
||||
|
||||
verify {
|
||||
spec.`is`("test")
|
||||
}
|
||||
}
|
||||
|
||||
@Test // gh-122
|
||||
fun inVarargCriteriaStepForSpringData2() {
|
||||
|
||||
val spec = mockk<org.springframework.data.relational.core.query.Criteria.CriteriaStep>()
|
||||
val criteria = mockk<org.springframework.data.relational.core.query.Criteria>()
|
||||
|
||||
every { spec.`in`(any() as Array<Any>) } returns criteria
|
||||
|
||||
assertThat(spec.isIn("test")).isEqualTo(criteria)
|
||||
|
||||
verify {
|
||||
spec.`in`(arrayOf("test"))
|
||||
}
|
||||
}
|
||||
|
||||
@Test // gh-122
|
||||
fun inListCriteriaStepForSpringData2() {
|
||||
|
||||
val spec = mockk<org.springframework.data.relational.core.query.Criteria.CriteriaStep>()
|
||||
val criteria = mockk<org.springframework.data.relational.core.query.Criteria>()
|
||||
|
||||
every { spec.`in`(listOf("test")) } returns criteria
|
||||
|
||||
assertThat(spec.isIn(listOf("test"))).isEqualTo(criteria)
|
||||
|
||||
verify {
|
||||
spec.`in`(listOf("test"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user