Update kotlin libs
This commit is contained in:
@@ -11,7 +11,7 @@ import javax.sql.DataSource
|
||||
@ResourceLock("h2")
|
||||
abstract class DbTest {
|
||||
|
||||
val beanContext = ApplicationContext.build().deduceEnvironment(false).environments("test").start()
|
||||
val beanContext = ApplicationContext.builder().deduceEnvironment(false).environments("test").start()
|
||||
|
||||
inline fun <reified T> BeanContext.getBean(): T = getBean(T::class.java)
|
||||
|
||||
@@ -22,6 +22,8 @@ abstract class DbTest {
|
||||
|
||||
Flyway.configure()
|
||||
.dataSource(dataSource)
|
||||
.loggers("slf4j")
|
||||
.cleanDisabled(false)
|
||||
.load()
|
||||
.clean()
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ import org.junit.jupiter.api.BeforeEach
|
||||
import org.junit.jupiter.api.DisplayName
|
||||
import org.junit.jupiter.api.Nested
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.parallel.ResourceLock
|
||||
import org.ktorm.database.Database
|
||||
import org.ktorm.dsl.eq
|
||||
import org.ktorm.entity.filter
|
||||
@@ -22,7 +21,6 @@ import org.ktorm.entity.mapColumns
|
||||
import org.ktorm.entity.toList
|
||||
import java.sql.SQLIntegrityConstraintViolationException
|
||||
|
||||
|
||||
internal class NoteRepositoryImplTest : DbTest() {
|
||||
|
||||
private lateinit var noteRepo: NoteRepository
|
||||
@@ -86,14 +84,14 @@ internal class NoteRepositoryImplTest : DbTest() {
|
||||
.hasSize(3)
|
||||
.usingElementComparatorIgnoringFields("updatedAt")
|
||||
.containsExactlyInAnyOrderElementsOf(
|
||||
notes1.map { it.toPersistedMeta() }
|
||||
notes1.map { it.toPersistedMeta() },
|
||||
)
|
||||
|
||||
assertThat(noteRepo.findAll(user2.id))
|
||||
.hasSize(1)
|
||||
.usingElementComparatorIgnoringFields("updatedAt")
|
||||
.containsExactlyInAnyOrderElementsOf(
|
||||
notes2.map { it.toPersistedMeta() }
|
||||
notes2.map { it.toPersistedMeta() },
|
||||
)
|
||||
|
||||
assertThat(noteRepo.findAll(1000)).isEmpty()
|
||||
@@ -131,7 +129,9 @@ internal class NoteRepositoryImplTest : DbTest() {
|
||||
|
||||
val note = db.notes.find { Notes.title eq fakeNote.title }!!
|
||||
.let { entity ->
|
||||
val tags = db.tags.filter { be.simplenotes.persistence.Tags.noteUuid eq entity.uuid }.mapColumns { be.simplenotes.persistence.Tags.name } as List<String>
|
||||
val tags = db.tags.filter {
|
||||
be.simplenotes.persistence.Tags.noteUuid eq entity.uuid
|
||||
}.mapColumns { be.simplenotes.persistence.Tags.name } as List<String>
|
||||
PersistedNote(
|
||||
uuid = entity.uuid,
|
||||
title = entity.title,
|
||||
|
||||
Reference in New Issue
Block a user