Skip to content

Commit

Permalink
more build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cstroe committed Jun 15, 2021
1 parent 6871234 commit f50c9b7
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 22 deletions.
10 changes: 5 additions & 5 deletions subprojects/dto/dto.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ repositories {
mavenCentral()
}

val test by tasks.getting(Test::class) {
useJUnitPlatform { }
tasks.withType<Test> {
useJUnitPlatform()
}

dependencies {
Expand All @@ -23,7 +23,7 @@ dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.1")

// KoTest: https://github.com/kotest/kotest
testImplementation("io.kotest:kotest-runner-junit5-jvm:4.1.1")
testImplementation("io.kotest:kotest-assertions-core-jvm:4.1.1")
testImplementation("io.kotest:kotest-runner-console-jvm:4.1.1")
testImplementation("io.kotest:kotest-runner-junit5-jvm:4.6.0")
testImplementation("io.kotest:kotest-assertions-core-jvm:4.6.0")
//testImplementation("io.kotest:kotest-runner-console-jvm:4.6.0")
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ package cloud.cosmin.checklister.lib.dto.internal
import io.kotest.core.spec.style.WordSpec
import io.kotest.matchers.comparables.shouldBeEqualComparingTo
import io.kotest.matchers.shouldBe
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonConfiguration
import java.time.OffsetDateTime

@ExperimentalSerializationApi
class OffsetDateTimeSerializerTest : WordSpec({
"OffsetDateTimeSerializer" should {
"should read back its own serialization" {
val json = Json(JsonConfiguration.Stable)
val json = Json.Default
val offsetDateTime = OffsetDateTime.parse("2020-07-10T01:00:00+05:00")
val jsonData = json.stringify(OffsetDateTimeSerializer, offsetDateTime)
val jsonData = json.encodeToString(OffsetDateTimeSerializer, offsetDateTime)
jsonData.shouldBe("\"2020-07-10T01:00:00+05:00\"")
val newOffsetDateTime = json.parse(OffsetDateTimeSerializer, jsonData)
val newOffsetDateTime = json.decodeFromString(OffsetDateTimeSerializer, jsonData)
offsetDateTime.shouldBeEqualComparingTo(newOffsetDateTime)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import java.util.*
class UUIDSerializerTest : WordSpec({
"UUIDSerializer" should {
"should read back its own serialization" {
val json = Json(JsonConfiguration.Stable)
val json = Json.Default
val uuid = UUID.fromString("fb54a699-8d73-4b41-87bb-32b20ec15618")
val jsonData = json.stringify(UUIDSerializer, uuid)
val jsonData = json.encodeToString(UUIDSerializer, uuid)
jsonData.shouldBe("\"fb54a699-8d73-4b41-87bb-32b20ec15618\"")
val newUUID = json.parse(UUIDSerializer, jsonData)
val newUUID = json.decodeFromString(UUIDSerializer, jsonData)
uuid.shouldBeEqualComparingTo(newUUID)
}
}
Expand Down
7 changes: 3 additions & 4 deletions subprojects/integrationTest/integrationTest.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
// https://github.com/avast/gradle-docker-compose-plugin
id("com.avast.gradle.docker-compose") version "0.14.3"
// https://github.com/kotest/kotest-gradle-plugin
id("io.kotlintest") version "1.1.1"
id("io.kotest") version "0.3.8"
}

repositories {
Expand All @@ -31,9 +31,8 @@ dependencies {
implementation(kotlin("stdlib-jdk8"))

// KoTest: https://github.com/kotest/kotest
testImplementation("io.kotest:kotest-runner-junit5-jvm:4.1.1")
testImplementation("io.kotest:kotest-assertions-core-jvm:4.1.1")
testImplementation("io.kotest:kotest-runner-console-jvm:4.1.1")
testImplementation("io.kotest:kotest-runner-junit5-jvm:4.6.0")
testImplementation("io.kotest:kotest-assertions-core-jvm:4.6.0")

// Fuel HTTP library: https://github.com/kittinunf/fuel
testImplementation("com.github.kittinunf.fuel:fuel:2.0.1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import cloud.cosmin.checklister.it.TestHelper.post
import cloud.cosmin.checklister.it.TestHelper.put
import cloud.cosmin.checklister.lib.dto.ItemPostDto
import cloud.cosmin.checklister.lib.dto.ListPostDto
import io.kotlintest.shouldBe
import io.kotlintest.specs.WordSpec
import io.kotest.core.spec.style.WordSpec
import io.kotest.matchers.shouldBe

class ItemMoveSpec: WordSpec({
"Checklister" should {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import com.fasterxml.jackson.module.paramnames.ParameterNamesModule
import com.github.kittinunf.fuel.Fuel
import com.github.kittinunf.fuel.core.extensions.jsonBody
import com.github.kittinunf.fuel.jackson.responseObject
import io.kotlintest.shouldBe
import java.util.UUID

object TestHelper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ package cloud.cosmin.checklister.it
import cloud.cosmin.checklister.lib.dto.ItemGetDto
import com.github.kittinunf.fuel.Fuel
import com.github.kittinunf.fuel.jackson.responseObject
import io.kotlintest.matchers.boolean.shouldBeTrue
import io.kotlintest.matchers.string.shouldMatch
import io.kotlintest.shouldBe
import io.kotlintest.specs.WordSpec
import cloud.cosmin.checklister.it.TestHelper.baseUrl
import cloud.cosmin.checklister.it.TestHelper.mapper
import cloud.cosmin.checklister.it.TestHelper.toJson
import cloud.cosmin.checklister.it.TestHelper.post
import cloud.cosmin.checklister.lib.dto.ItemPostDto
import cloud.cosmin.checklister.lib.dto.ListPostDto
import com.github.kittinunf.fuel.core.extensions.jsonBody
import io.kotest.core.spec.style.WordSpec
import io.kotest.matchers.booleans.shouldBeTrue
import io.kotest.matchers.shouldBe
import io.kotest.matchers.string.shouldMatch

class TimestampSpec : WordSpec({
val timestampRegex = Regex("[1-9][0-9]{3}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{6}Z")
Expand Down

0 comments on commit f50c9b7

Please sign in to comment.