Skip to content
This repository was archived by the owner on Mar 16, 2025. It is now read-only.

Commit 232d70f

Browse files
committed
update kotest
1 parent 222ef55 commit 232d70f

4 files changed

Lines changed: 28 additions & 24 deletions

File tree

build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,10 @@ dependencies {
132132
testImplementation ("org.junit.jupiter:junit-jupiter-api")
133133
testImplementation ("org.junit.jupiter:junit-jupiter-params")
134134
testRuntimeOnly ("org.junit.jupiter:junit-jupiter-engine")
135-
testImplementation("io.mockk:mockk:1.12.0")
136-
testImplementation("io.kotest:kotest-runner-junit5:4.6.1")
137-
testImplementation ('ch.qos.logback:logback-classic:1.2.6')
135+
testImplementation("io.mockk:mockk:1.12.1")
136+
testImplementation("io.kotest:kotest-runner-junit5:5.0.3")
137+
testImplementation("io.kotest:kotest-framework-datatest:5.0.3")
138+
testImplementation ('ch.qos.logback:logback-classic:1.2.10')
138139
testImplementation("com.google.jimfs:jimfs:1.2")
139140
}
140141

src/test/kotlin/io/openapiprocessor/core/ProjectConfig.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
package io.openapiprocessor.core
77

88
import io.kotest.core.Tag
9-
import io.kotest.core.Tags
9+
import io.kotest.core.TagExpression
1010
import io.kotest.core.TestConfiguration
1111
import io.kotest.core.config.AbstractProjectConfig
1212
import io.kotest.core.extensions.TagExtension
@@ -19,12 +19,12 @@ object NotWindows: Tag()
1919

2020
object SystemTagExtension: TagExtension {
2121

22-
override fun tags(): Tags {
22+
override fun tags(): TagExpression {
2323

2424
return if(isWindows()) {
25-
Tags.exclude(NotWindows)
25+
TagExpression.exclude(NotWindows)
2626
} else {
27-
Tags.exclude(Windows)
27+
TagExpression.exclude(Windows)
2828
}
2929
}
3030

src/test/kotlin/io/openapiprocessor/core/parser/openapi4j/ParserSpec.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,7 @@ import io.openapiprocessor.test.stream.Memory
1212

1313
class ParserSpec : StringSpec({
1414

15-
"catch parser resource exception" {
16-
val parser = Parser()
1715

18-
shouldThrow<ParserException> {
19-
parser.parse("memory:openapi.yaml")
20-
}
21-
}
2216

2317
"catch parser validation exception" {
2418
Memory.add("openapi.yaml", """
@@ -36,6 +30,14 @@ class ParserSpec : StringSpec({
3630
}
3731
}
3832

33+
"catch parser resource exception" {
34+
val parser = Parser()
35+
36+
shouldThrow<ParserException> {
37+
parser.parse("memory:openapi.yaml")
38+
}
39+
}
40+
3941
afterEach {
4042
Memory.clear()
4143
}

src/test/kotlin/io/openapiprocessor/core/writer/java/JavaDocWriterSpec.kt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55

66
package io.openapiprocessor.core.writer.java
77

8-
import io.kotest.core.datatest.forAll
98
import io.kotest.core.spec.style.StringSpec
10-
import io.kotest.data.row
9+
import io.kotest.datatest.withData
1110
import io.kotest.matchers.shouldBe
1211
import io.kotest.matchers.string.shouldBeEmpty
1312
import io.mockk.every
@@ -239,17 +238,19 @@ class JavaDocWriterSpec: StringSpec({
239238
}
240239

241240
"converts property schema description to javadoc comment" {
241+
data class Type(val dt: DataType)
242+
242243
val description = "*markdown* description with **text**"
243244

244-
forAll(
245-
row(IntegerDataType(documentation = Documentation(description = description))),
246-
row(LongDataType(documentation = Documentation(description = description))),
247-
row(FloatDataType(documentation = Documentation(description = description))),
248-
row(DoubleDataType(documentation = Documentation(description = description))),
249-
row(BooleanDataType(documentation = Documentation(description = description))),
250-
row(StringDataType(documentation = Documentation(description = description))),
251-
row(LocalDateDataType(documentation = Documentation(description = description))),
252-
row(OffsetDateTimeDataType(documentation = Documentation(description = description)))
245+
withData(
246+
Type(IntegerDataType(documentation = Documentation(description = description))),
247+
Type(LongDataType(documentation = Documentation(description = description))),
248+
Type(FloatDataType(documentation = Documentation(description = description))),
249+
Type(DoubleDataType(documentation = Documentation(description = description))),
250+
Type(BooleanDataType(documentation = Documentation(description = description))),
251+
Type(StringDataType(documentation = Documentation(description = description))),
252+
Type(LocalDateDataType(documentation = Documentation(description = description))),
253+
Type(OffsetDateTimeDataType(documentation = Documentation(description = description)))
253254
) { (type: DataType) ->
254255

255256
val html = writer.convert(type)

0 commit comments

Comments
 (0)