@@ -7,6 +7,7 @@ package io.openapiprocessor.core.writer.java
77
88import io.kotest.core.spec.IsolationMode
99import io.kotest.core.spec.style.StringSpec
10+ import io.kotest.matchers.collections.shouldBeEmpty
1011import io.kotest.matchers.shouldBe
1112import io.openapiprocessor.core.model.datatypes.*
1213import io.openapiprocessor.core.support.datatypes.ListDataType
@@ -35,7 +36,7 @@ class BeanValidationFactorySpec: StringSpec({
3536 val io = info.inout
3637 io.dataTypeValue shouldBe " @Valid Foo[]"
3738 io.imports shouldBe setOf(BeanValidation .VALID .import)
38- io.annotations shouldBe emptySet ()
39+ io.annotations.shouldBeEmpty ()
3940 }
4041
4142 " does not apply @Valid to 'array' with simple items" {
@@ -46,13 +47,13 @@ class BeanValidationFactorySpec: StringSpec({
4647
4748 val prop = info.prop
4849 prop.dataTypeValue shouldBe " String[]"
49- prop.imports shouldBe emptySet ()
50- prop.annotations shouldBe emptySet ()
50+ prop.imports.shouldBeEmpty ()
51+ prop.annotations.shouldBeEmpty ()
5152
5253 val io = info.inout
5354 io.dataTypeValue shouldBe " String[]"
54- io.imports shouldBe emptySet ()
55- io.annotations shouldBe emptySet ()
55+ io.imports.shouldBeEmpty ()
56+ io.annotations.shouldBeEmpty ()
5657 }
5758
5859 " applies @Valid to mapped collection with object items" {
@@ -66,12 +67,12 @@ class BeanValidationFactorySpec: StringSpec({
6667 val prop = info.prop
6768 prop.dataTypeValue shouldBe " List<@Valid Foo>"
6869 prop.imports shouldBe setOf(BeanValidation .VALID .import)
69- prop.annotations shouldBe emptySet ()
70+ prop.annotations.shouldBeEmpty ()
7071
7172 val io = info.inout
7273 io.dataTypeValue shouldBe " List<@Valid Foo>"
7374 io.imports shouldBe setOf(BeanValidation .VALID .import)
74- io.annotations shouldBe emptySet ()
75+ io.annotations.shouldBeEmpty ()
7576 }
7677
7778 " does not apply @Valid to mapped collection with simple items" {
@@ -82,13 +83,13 @@ class BeanValidationFactorySpec: StringSpec({
8283
8384 val prop = info.prop
8485 prop.dataTypeValue shouldBe " List<String>"
85- prop.imports shouldBe emptySet ()
86- prop.annotations shouldBe emptySet ()
86+ prop.imports.shouldBeEmpty ()
87+ prop.annotations.shouldBeEmpty ()
8788
8889 val io = info.inout
8990 io.dataTypeValue shouldBe " List<String>"
90- io.imports shouldBe emptySet ()
91- io.annotations shouldBe emptySet ()
91+ io.imports.shouldBeEmpty ()
92+ io.annotations.shouldBeEmpty ()
9293 }
9394
9495 " applies @Pattern to String" {
@@ -105,7 +106,7 @@ class BeanValidationFactorySpec: StringSpec({
105106 val io = info.inout
106107 io.dataTypeValue shouldBe """ ${BeanValidation .PATTERN .annotation} (regexp = "regex") String"""
107108 io.imports shouldBe setOf(BeanValidation .PATTERN .import)
108- io.annotations shouldBe emptySet ()
109+ io.annotations.shouldBeEmpty ()
109110 }
110111
111112 " applies @Pattern to String with escaping" {
@@ -122,7 +123,7 @@ class BeanValidationFactorySpec: StringSpec({
122123 val io = info.inout
123124 io.dataTypeValue shouldBe """ ${BeanValidation .PATTERN .annotation} (regexp = "\\.\\\\") String"""
124125 io.imports shouldBe setOf(BeanValidation .PATTERN .import)
125- io.annotations shouldBe emptySet ()
126+ io.annotations.shouldBeEmpty ()
126127 }
127128
128129 " does apply validation annotations to 'collection' item" {
@@ -146,7 +147,7 @@ class BeanValidationFactorySpec: StringSpec({
146147 io.imports shouldBe setOf(
147148 BeanValidation .NOT_NULL .import,
148149 BeanValidation .SIZE .import)
149- io.annotations shouldBe emptySet ()
150+ io.annotations.shouldBeEmpty ()
150151 }
151152
152153 " does apply validation annotations to 'collection' model items" {
@@ -172,7 +173,7 @@ class BeanValidationFactorySpec: StringSpec({
172173 io.imports shouldBe setOf(
173174 BeanValidation .NOT_NULL .import,
174175 BeanValidation .VALID .import)
175- io.annotations shouldBe emptySet ()
176+ io.annotations.shouldBeEmpty ()
176177 }
177178
178179 " does apply validation annotations to 'array' item" {
@@ -194,7 +195,7 @@ class BeanValidationFactorySpec: StringSpec({
194195 io.dataTypeValue shouldBe " @NotNull String[]"
195196 io.imports shouldBe setOf(
196197 BeanValidation .NOT_NULL .import)
197- io.annotations shouldBe emptySet ()
198+ io.annotations.shouldBeEmpty ()
198199 }
199200
200201 " does apply validation annotations to 'array' model items" {
@@ -221,7 +222,7 @@ class BeanValidationFactorySpec: StringSpec({
221222 io.imports shouldBe setOf(
222223 BeanValidation .NOT_NULL .import,
223224 BeanValidation .VALID .import)
224- io.annotations shouldBe emptySet ()
225+ io.annotations.shouldBeEmpty ()
225226 }
226227
227228 " applies @Email to String" {
@@ -238,6 +239,6 @@ class BeanValidationFactorySpec: StringSpec({
238239 val io = info.inout
239240 io.dataTypeValue shouldBe """ ${BeanValidation .EMAIL .annotation} String"""
240241 io.imports shouldBe setOf(BeanValidation .EMAIL .import)
241- io.annotations shouldBe emptySet ()
242+ io.annotations.shouldBeEmpty ()
242243 }
243244})
0 commit comments