Skip to content

Commit

Permalink
bump dependencies to Spring Framewok 5.3.0 and kotlinx-coroutines 1.4.0.
Browse files Browse the repository at this point in the history
Disable all testcontainers tests on kotysa-spring-jdbc until spring-projects-experimental/spring-fu#322 is fixed

fixes #24
  • Loading branch information
pull-vert committed Oct 30, 2020
1 parent 3ce2129 commit dcb9303
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 deletions.
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ configure(subprojects.findAll { it.name != "kotysa-platform" }) {
}

test {
useJUnitPlatform()
useJUnitPlatform {
// TODO remove this exclusion when https://github.com/spring-projects-experimental/spring-fu/issues/322 is fixed
excludeTags("spring-jdbc-testcontainers")
}
testLogging {
events 'passed', 'failed', 'skipped'
showStandardStreams = true
Expand Down Expand Up @@ -148,6 +151,6 @@ task build {
// when version changes :
// -> execute ./gradlew wrapper, then delete .gradle directory, then execute ./gradlew wrapper again
wrapper {
gradleVersion = '6.6.1'
gradleVersion = '6.7'
distributionType = Wrapper.DistributionType.ALL
}
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ version=0.1.8
# plugins
kotlin_plugin_version=1.4.10
# https://github.com/Kotlin/dokka/releases
dokka_plugin_version=1.4.10
dokka_plugin_version=1.4.10.2
# https://github.com/researchgate/gradle-release/releases
release_plugin_version=2.8.1

# main
# https://github.com/ufoss-org/kolog/releases
kolog_version=0.3
# https://github.com/Kotlin/kotlinx.coroutines/releases
kotlinx_coroutines_bom_version=1.3.9
kotlinx_coroutines_bom_version=1.4.0
# https://github.com/Kotlin/kotlinx-datetime/releases
kotlinx_datetime_version=0.1.0
# https://github.com/reactor/reactor-kotlin-extensions/releases
reactor_kotlin_extension_version=1.1.0-RC1
reactor_kotlin_extension_version=1.1.0
# https://github.com/spring-projects/spring-framework/releases
spring_core_version=5.3.0-RC1
spring_core_version=5.3.0

# tests
# https://mvnrepository.com/artifact/org.assertj/assertj-core
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package org.ufoss.kotysa.spring.jdbc.mysql

import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.Tag
import org.springframework.beans.factory.getBean
import org.springframework.boot.context.event.ApplicationReadyEvent
import org.springframework.context.ConfigurableApplicationContext
Expand All @@ -15,8 +16,8 @@ import org.ufoss.kotysa.test.Repository

class KMySQLContainer : MySQLContainer<KMySQLContainer>("mysql:8.0.22")


abstract class AbstractSpringJdbcMysqlTest<T : Repository> {
@Tag("spring-jdbc-testcontainers")
abstract class AbstractSpringJdbcMysqlTest<T : Repository> {

protected abstract val repository: T

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package org.ufoss.kotysa.spring.jdbc.postgresql

import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.Tag
import org.springframework.beans.factory.getBean
import org.springframework.boot.context.event.ApplicationReadyEvent
import org.springframework.context.ConfigurableApplicationContext
Expand All @@ -15,7 +16,7 @@ import org.ufoss.kotysa.test.Repository

class KPostgreSQLContainer : PostgreSQLContainer<KPostgreSQLContainer>("postgres:13.0-alpine")


@Tag("spring-jdbc-testcontainers")
abstract class AbstractSpringJdbcPostgresqlTest<T : Repository> {

protected abstract val repository: T
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal class CoroutinesSqlClientSelectR2dbc private constructor() : AbstractSq
Joinable(client, properties, joinClass, alias, type)
}

private class Joinable<T : Any, U : Any> internal constructor(
private class Joinable<T : Any, U : Any>(
private val client: DatabaseClient,
private val properties: Properties<T>,
private val joinClass: KClass<U>,
Expand All @@ -44,7 +44,7 @@ internal class CoroutinesSqlClientSelectR2dbc private constructor() : AbstractSq
}
}

private class Join<T : Any> internal constructor(
private class Join<T : Any>(
override val client: DatabaseClient,
override val properties: Properties<T>
) : DefaultSqlClientSelect.Join<T>, CoroutinesSqlClientSelect.Join<T>, Whereable<T>, Return<T>
Expand All @@ -59,7 +59,7 @@ internal class CoroutinesSqlClientSelectR2dbc private constructor() : AbstractSq
}
}

private class Where<T : Any> internal constructor(
private class Where<T : Any>(
override val client: DatabaseClient,
override val properties: Properties<T>
) : DefaultSqlClientSelect.Where<T>, CoroutinesSqlClientSelect.Where<T>, Return<T> {
Expand Down Expand Up @@ -95,12 +95,12 @@ internal class CoroutinesSqlClientSelectR2dbc private constructor() : AbstractSq

override suspend fun fetchFirst(): T =
try {
fetch().awaitFirst()
fetch().awaitSingle()
} catch (_: EmptyResultDataAccessException) {
throw NoResultException()
}

override suspend fun fetchFirstOrNull(): T? = fetch().awaitFirstOrNull()
override suspend fun fetchFirstOrNull(): T? = fetch().awaitSingleOrNull()

override fun fetchAll(): Flow<T> = fetch().flow()
}
Expand Down

0 comments on commit dcb9303

Please sign in to comment.