@@ -15,7 +15,6 @@ import io.kotest.matchers.shouldBe
1515import io.mockk.mockk
1616import io.openapiprocessor.core.converter.MappingFinderQuery
1717import io.openapiprocessor.core.converter.mapping.AmbiguousTypeMappingException
18- import io.openapiprocessor.core.converter.mapping.steps.EndpointsStep
1918import io.openapiprocessor.core.converter.mapping.steps.GlobalsStep
2019import io.openapiprocessor.core.converter.mapping.steps.ParametersStep
2120import io.openapiprocessor.core.parser.HttpMethod
@@ -102,7 +101,8 @@ class MappingConverterParameterSpec: StringSpec({
102101 val mappings = MappingConverter (mapping).convert().globalMappings
103102
104103 // then:
105- val nameTypeMapping = mappings.findParameterNameTypeMapping(parameterNameMatcher(name = "foo"), ParametersStep ())!!
104+ val nameTypeMapping = mappings.findParameterNameTypeMapping(
105+ parameterNameMatcher(name = "foo"), ParametersStep ("type"))!!
106106
107107 nameTypeMapping.parameterName shouldBe " foo"
108108 nameTypeMapping.mapping.sourceTypeName.shouldBeNull()
@@ -125,7 +125,8 @@ class MappingConverterParameterSpec: StringSpec({
125125 val mappings = MappingConverter (mapping).convert().globalMappings
126126
127127 // then:
128- val nameTypeMapping = mappings.findParameterNameTypeMapping(parameterNameMatcher(name = "foo"), ParametersStep ())
128+ val nameTypeMapping = mappings.findParameterNameTypeMapping(
129+ parameterNameMatcher(name = "foo"), ParametersStep ("type"))
129130
130131 nameTypeMapping.shouldBeNull()
131132 }
@@ -147,7 +148,7 @@ class MappingConverterParameterSpec: StringSpec({
147148 val mappings = MappingConverter (mapping).convert().globalMappings
148149
149150 shouldThrow<AmbiguousTypeMappingException > {
150- mappings.findParameterNameTypeMapping(parameterNameMatcher(name = "foo"), ParametersStep ())
151+ mappings.findParameterNameTypeMapping(parameterNameMatcher(name = "foo"), ParametersStep ("type" ))
151152 }
152153 }
153154
@@ -165,7 +166,7 @@ class MappingConverterParameterSpec: StringSpec({
165166 val mappings = MappingConverter (mapping).convert().globalMappings
166167
167168 // then:
168- val addMappings = mappings.findAddParameterTypeMappings(addParameterTypeMatcher(), ParametersStep ())
169+ val addMappings = mappings.findAddParameterTypeMappings(addParameterTypeMatcher(), ParametersStep ("type" ))
169170
170171 addMappings.shouldBeEmpty()
171172 }
@@ -183,7 +184,7 @@ class MappingConverterParameterSpec: StringSpec({
183184 val mappings = MappingConverter (mapping).convert().globalMappings
184185
185186 // then:
186- val addMappings = mappings.findAddParameterTypeMappings(addParameterTypeMatcher(), ParametersStep ())
187+ val addMappings = mappings.findAddParameterTypeMappings(addParameterTypeMatcher(), ParametersStep ("type" ))
187188
188189 addMappings.size.shouldBe(1)
189190 val add = addMappings.first()
@@ -209,7 +210,7 @@ class MappingConverterParameterSpec: StringSpec({
209210 val mappings = MappingConverter (mapping).convert().globalMappings
210211
211212 // then:
212- val addMappings = mappings.findAddParameterTypeMappings(addParameterTypeMatcher(), ParametersStep ())
213+ val addMappings = mappings.findAddParameterTypeMappings(addParameterTypeMatcher(), ParametersStep ("type" ))
213214
214215 addMappings.size.shouldBe(2)
215216 addMappings[0 ].parameterName shouldBe " foo"
@@ -232,7 +233,7 @@ class MappingConverterParameterSpec: StringSpec({
232233 val mappings = MappingConverter (mapping).convert().globalMappings
233234
234235 val annotationMappings = mappings.findAnnotationParameterTypeMapping(
235- annotationTypeMatcher(type = "Foo "), ParametersStep ())
236+ annotationTypeMatcher(type = "Foo "), ParametersStep ("type" ))
236237
237238 annotationMappings shouldHaveSize 1
238239 val annotationMapping = annotationMappings.first()
@@ -259,7 +260,7 @@ class MappingConverterParameterSpec: StringSpec({
259260 val mappings = MappingConverter (mapping).convert().globalMappings
260261
261262 val annotationMappings = mappings.findAnnotationParameterTypeMapping(
262- annotationTypeMatcher(type = "Foo "), ParametersStep ())
263+ annotationTypeMatcher(type = "Foo "), ParametersStep ("type" ))
263264
264265 annotationMappings shouldHaveSize 2
265266 }
@@ -279,7 +280,7 @@ class MappingConverterParameterSpec: StringSpec({
279280
280281 // then:
281282 val annotationMappings = mappings.findAnnotationParameterTypeMapping(
282- annotationTypeMatcher(name = "Foo "), ParametersStep ())
283+ annotationTypeMatcher(name = "Foo "), ParametersStep ("type" ))
283284
284285 annotationMappings.shouldBeEmpty()
285286 }
@@ -300,7 +301,7 @@ class MappingConverterParameterSpec: StringSpec({
300301 val mappings = MappingConverter (mapping).convert().globalMappings
301302
302303 val annotationMappings = mappings.findAnnotationParameterNameTypeMapping(
303- annotationParameterNameTypeMatcher(name = "foo"), ParametersStep ())
304+ annotationParameterNameTypeMatcher(name = "foo"), ParametersStep ("name" ))
304305
305306 annotationMappings shouldHaveSize 1
306307 val annotationMapping = annotationMappings.first()
@@ -326,7 +327,7 @@ class MappingConverterParameterSpec: StringSpec({
326327 val mappings = MappingConverter (mapping).convert().globalMappings
327328
328329 val annotationMappings = mappings.findAnnotationParameterNameTypeMapping(
329- annotationParameterNameTypeMatcher(name = "foo"), ParametersStep ())
330+ annotationParameterNameTypeMatcher(name = "foo"), ParametersStep ("name" ))
330331
331332 annotationMappings shouldHaveSize 2
332333 }
@@ -346,7 +347,7 @@ class MappingConverterParameterSpec: StringSpec({
346347
347348 // then:
348349 val annotationMappings = mappings.findAnnotationParameterNameTypeMapping(
349- annotationTypeMatcher(name = "foo"), ParametersStep ())
350+ annotationTypeMatcher(name = "foo"), ParametersStep ("name" ))
350351
351352 annotationMappings.shouldBeEmpty()
352353 }
@@ -376,14 +377,14 @@ class MappingConverterParameterSpec: StringSpec({
376377
377378 // then:
378379 val postQuery = MappingFinderQuery (path = "/foo", method = HttpMethod .POST , name = "Foo ")
379- val typeMapping = mappings[" /foo" ]!!.findParameterTypeMapping(postQuery, ParametersStep ())!!
380+ val typeMapping = mappings[" /foo" ]!!.findParameterTypeMapping(postQuery, ParametersStep ("type" ))!!
380381
381382 typeMapping.sourceTypeName shouldBe " Foo"
382383 typeMapping.sourceTypeFormat.shouldBeNull()
383384 typeMapping.targetTypeName shouldBe " io.openapiprocessor.Foo"
384385
385386 val getQuery = MappingFinderQuery (path = "/foo", method = HttpMethod .GET , name= "Foo ")
386- val typeMappingGet = mappings[" /foo" ]!!.findParameterTypeMapping(getQuery, ParametersStep ())!!
387+ val typeMappingGet = mappings[" /foo" ]!!.findParameterTypeMapping(getQuery, ParametersStep ("type" ))!!
387388
388389 typeMappingGet.sourceTypeName shouldBe " Foo"
389390 typeMappingGet.sourceTypeFormat.shouldBeNull()
@@ -415,7 +416,7 @@ class MappingConverterParameterSpec: StringSpec({
415416 val mappings = MappingConverter (mapping).convert().endpointMappings
416417
417418 val annotationMappings = mappings[" /foo" ]!!.findAnnotationParameterTypeMapping(
418- MappingFinderQuery (path = "/foo", method = HttpMethod .POST , type = "Foo "), ParametersStep ())
419+ MappingFinderQuery (path = "/foo", method = HttpMethod .POST , type = "Foo "), ParametersStep ("type" ))
419420
420421 annotationMappings shouldHaveSize 2
421422 annotationMappings[0 ].sourceTypeName shouldBe " Foo"
@@ -428,7 +429,7 @@ class MappingConverterParameterSpec: StringSpec({
428429 annotationMappings[1 ].annotation.parameters.shouldBeEmpty()
429430
430431 val annotationMappingsGet = mappings[" /foo" ]!!.findAnnotationParameterTypeMapping(
431- MappingFinderQuery (path = "/foo", method = HttpMethod .GET , type = "Foo "), ParametersStep ())
432+ MappingFinderQuery (path = "/foo", method = HttpMethod .GET , type = "Foo "), ParametersStep ("type" ))
432433
433434 annotationMappingsGet shouldHaveSize 2
434435 annotationMappingsGet[0 ].sourceTypeName shouldBe " Foo"
@@ -466,14 +467,14 @@ class MappingConverterParameterSpec: StringSpec({
466467
467468 // then:
468469 val typeMapping = mappings[" /foo" ]!!.findParameterNameTypeMapping(
469- MappingFinderQuery (path = "/foo", method = HttpMethod .POST , name = "foo"), ParametersStep ())!!
470+ MappingFinderQuery (path = "/foo", method = HttpMethod .POST , name = "foo"), ParametersStep ("name" ))!!
470471
471472 typeMapping.parameterName shouldBe " foo"
472473 typeMapping.mapping.sourceTypeName.shouldBeNull()
473474 typeMapping.mapping.targetTypeName shouldBe " io.openapiprocessor.Foo"
474475
475476 val typeMappingGet = mappings[" /foo" ]!!.findParameterNameTypeMapping(
476- MappingFinderQuery (path = "/foo", method = HttpMethod .GET , name= "foo"), ParametersStep ())!!
477+ MappingFinderQuery (path = "/foo", method = HttpMethod .GET , name= "foo"), ParametersStep ("name" ))!!
477478
478479 typeMappingGet.parameterName shouldBe " foo"
479480 typeMappingGet.mapping.sourceTypeName.shouldBeNull()
@@ -505,7 +506,7 @@ class MappingConverterParameterSpec: StringSpec({
505506 val mappings = MappingConverter (mapping).convert().endpointMappings
506507
507508 val annotationMappings = mappings[" /foo" ]!!.findAnnotationParameterNameTypeMapping(
508- MappingFinderQuery (path = "/foo", method = HttpMethod .POST , name = "foo"), ParametersStep ())
509+ MappingFinderQuery (path = "/foo", method = HttpMethod .POST , name = "foo"), ParametersStep ("name" ))
509510
510511 annotationMappings shouldHaveSize 2
511512 annotationMappings[0 ].name shouldBe " foo"
@@ -514,7 +515,7 @@ class MappingConverterParameterSpec: StringSpec({
514515 annotationMappings[1 ].annotation.type shouldBe " io.openapiprocessor.Bar"
515516
516517 val annotationMappingsGet = mappings[" /foo" ]!!.findAnnotationParameterNameTypeMapping(
517- MappingFinderQuery (path = "/foo", method = HttpMethod .GET , name = "foo"), ParametersStep ())
518+ MappingFinderQuery (path = "/foo", method = HttpMethod .GET , name = "foo"), ParametersStep ("name" ))
518519
519520 annotationMappingsGet shouldHaveSize 2
520521 annotationMappingsGet[0 ].name shouldBe " foo"
@@ -550,7 +551,7 @@ class MappingConverterParameterSpec: StringSpec({
550551
551552 // then:
552553 val addMappings = mappings[" /foo" ]!!.findAddParameterTypeMappings(
553- MappingFinderQuery (path = "/foo", method = HttpMethod .POST ), ParametersStep ())
554+ MappingFinderQuery (path = "/foo", method = HttpMethod .POST ), ParametersStep ("add" ))
554555
555556 addMappings shouldHaveSize 2
556557 addMappings[0 ].parameterName shouldBe " foo"
@@ -559,7 +560,7 @@ class MappingConverterParameterSpec: StringSpec({
559560 addMappings[1 ].mapping.targetTypeName shouldBe " io.openapiprocessor.Bar"
560561
561562 val addMappingsGet = mappings[" /foo" ]!!.findAddParameterTypeMappings(
562- MappingFinderQuery (path = "/foo", method = HttpMethod .GET ), ParametersStep ())
563+ MappingFinderQuery (path = "/foo", method = HttpMethod .GET ), ParametersStep ("add" ))
563564
564565 addMappingsGet shouldHaveSize 2
565566 addMappingsGet[0 ].parameterName shouldBe " foo2"
0 commit comments