|
6 | 6 | package io.openapiprocessor.core.converter.mapping |
7 | 7 |
|
8 | 8 | import io.kotest.core.spec.style.StringSpec |
| 9 | +import io.kotest.matchers.booleans.shouldBeTrue |
9 | 10 | import io.kotest.matchers.collections.shouldNotBeEmpty |
10 | 11 | import io.kotest.matchers.nulls.shouldNotBeNull |
11 | 12 | import io.kotest.matchers.shouldBe |
@@ -200,4 +201,31 @@ class MappingFinderEndpointMethodSpec: StringSpec({ |
200 | 201 | result.targetTypeName.shouldBe("io.openapiprocessor.MultiWrapper") |
201 | 202 | } |
202 | 203 |
|
| 204 | + "endpoint/method excluded" { |
| 205 | + val finder = MappingFinder( |
| 206 | + listOf( |
| 207 | + EndpointTypeMapping("/foo", null, emptyList()), |
| 208 | + EndpointTypeMapping("/foo", HttpMethod.GET, emptyList(), true) |
| 209 | + ) |
| 210 | + ) |
| 211 | + |
| 212 | + val info = SchemaInfo(foo, "", "", null, resolver) |
| 213 | + val result = finder.isExcludedEndpoint(info.getPath(), info.getMethod()) |
| 214 | + |
| 215 | + result.shouldBeTrue() |
| 216 | + } |
| 217 | + |
| 218 | + "endpoint excluded" { |
| 219 | + val finder = MappingFinder( |
| 220 | + listOf( |
| 221 | + EndpointTypeMapping("/foo", null, emptyList(), true) |
| 222 | + ) |
| 223 | + ) |
| 224 | + |
| 225 | + val info = SchemaInfo(foo, "", "", null, resolver) |
| 226 | + val result = finder.isExcludedEndpoint(info.getPath(), info.getMethod()) |
| 227 | + |
| 228 | + result.shouldBeTrue() |
| 229 | + } |
| 230 | + |
203 | 231 | }) |
0 commit comments