@@ -10,7 +10,6 @@ class ManifestValidationTest : FunSpec({
10
10
test("primitive types") {
11
11
// given
12
12
val manifest = TypesManifest (
13
- typingSpec = expectedTypingSpec,
14
13
inputs = mapOf(
15
14
"string-input" to ApiItem (type = "string"),
16
15
"boolean-input" to ApiItem (type = "boolean"),
@@ -39,7 +38,6 @@ class ManifestValidationTest : FunSpec({
39
38
test("enum type") {
40
39
// given
41
40
val manifest = TypesManifest (
42
- typingSpec = expectedTypingSpec,
43
41
inputs = mapOf(
44
42
"enum-input" to ApiItem (type = "enum", allowedValues = listOf("foo", "bar", "baz")),
45
43
),
@@ -60,7 +58,6 @@ class ManifestValidationTest : FunSpec({
60
58
test("list type") {
61
59
// given
62
60
val manifest = TypesManifest (
63
- typingSpec = expectedTypingSpec,
64
61
inputs = mapOf(
65
62
"list-of-strings-input" to ApiItem (
66
63
type = "list",
@@ -111,53 +108,9 @@ class ManifestValidationTest : FunSpec({
111
108
}
112
109
113
110
context("failure cases") {
114
- test("no typing spec set") {
115
- // given
116
- val manifest = TypesManifest (
117
- typingSpec = null,
118
- inputs = emptyMap(),
119
- outputs = emptyMap(),
120
- )
121
-
122
- // when
123
- val result = manifest.validate()
124
-
125
- // then
126
- result shouldBe ActionValidationResult (
127
- overallResult = ItemValidationResult .Invalid (
128
- "
Set top-level 'typingSpec' attribute to 'krzema12/
[email protected] ', was: null"
129
- ),
130
- inputs = emptyMap(),
131
- outputs = emptyMap(),
132
- )
133
- }
134
-
135
- test("incorrect typing spec set") {
136
- // given
137
- val manifest = TypesManifest (
138
- typingSpec = "incorrect-typing-spec",
139
- inputs = emptyMap(),
140
- outputs = emptyMap(),
141
- )
142
-
143
- // when
144
- val result = manifest.validate()
145
-
146
- // then
147
- result shouldBe ActionValidationResult (
148
- overallResult = ItemValidationResult .Invalid (
149
- "
Set top-level 'typingSpec' attribute to 'krzema12/
[email protected] ', " +
150
- "was: 'incorrect-typing-spec'"
151
- ),
152
- inputs = emptyMap(),
153
- outputs = emptyMap(),
154
- )
155
- }
156
-
157
111
test("input and output without type") {
158
112
// given
159
113
val manifest = TypesManifest (
160
- typingSpec = expectedTypingSpec,
161
114
inputs = mapOf(
162
115
"some-input" to ApiItem (type = null),
163
116
),
@@ -188,7 +141,6 @@ class ManifestValidationTest : FunSpec({
188
141
test("unknown type") {
189
142
// given
190
143
val manifest = TypesManifest (
191
- typingSpec = expectedTypingSpec,
192
144
inputs = mapOf(
193
145
"some-input" to ApiItem (type = "for-sure-unknown-type"),
194
146
),
@@ -211,7 +163,6 @@ class ManifestValidationTest : FunSpec({
211
163
test("primitive types with 'allowedValues' attribute") {
212
164
// given
213
165
val manifest = TypesManifest (
214
- typingSpec = expectedTypingSpec,
215
166
inputs = mapOf(
216
167
"string-input" to ApiItem (type = "string", allowedValues = listOf("foo", "bar")),
217
168
"boolean-input" to ApiItem (type = "boolean", allowedValues = listOf("foo", "bar")),
@@ -238,7 +189,6 @@ class ManifestValidationTest : FunSpec({
238
189
test("primitive types with 'separator' attribute") {
239
190
// given
240
191
val manifest = TypesManifest (
241
- typingSpec = expectedTypingSpec,
242
192
inputs = mapOf(
243
193
"string-input" to ApiItem (type = "string", separator = ","),
244
194
"boolean-input" to ApiItem (type = "boolean", separator = ","),
@@ -265,7 +215,6 @@ class ManifestValidationTest : FunSpec({
265
215
test("non-list types with 'listItem' attribute") {
266
216
// given
267
217
val manifest = TypesManifest (
268
- typingSpec = expectedTypingSpec,
269
218
inputs = mapOf(
270
219
"string-input" to ApiItem (type = "string", listItem = ApiItem (type = "string")),
271
220
"boolean-input" to ApiItem (type = "boolean", listItem = ApiItem (type = "string")),
@@ -298,7 +247,6 @@ class ManifestValidationTest : FunSpec({
298
247
test("enum type with 'separator' attribute") {
299
248
// given
300
249
val manifest = TypesManifest (
301
- typingSpec = expectedTypingSpec,
302
250
inputs = mapOf(
303
251
"enum-input" to ApiItem (type = "enum", allowedValues = listOf("foo", "bar", "baz"), separator = ","),
304
252
),
@@ -319,7 +267,6 @@ class ManifestValidationTest : FunSpec({
319
267
test("enum type without 'allowedValues' attribute") {
320
268
// given
321
269
val manifest = TypesManifest (
322
- typingSpec = expectedTypingSpec,
323
270
inputs = mapOf(
324
271
"enum-input" to ApiItem (type = "enum", allowedValues = null),
325
272
),
@@ -340,7 +287,6 @@ class ManifestValidationTest : FunSpec({
340
287
test("enum type with just one allowed value") {
341
288
// given
342
289
val manifest = TypesManifest (
343
- typingSpec = expectedTypingSpec,
344
290
inputs = mapOf(
345
291
"enum-input" to ApiItem (type = "enum", allowedValues = listOf("foo")),
346
292
),
@@ -361,7 +307,6 @@ class ManifestValidationTest : FunSpec({
361
307
test("list type without 'listItem' attribute") {
362
308
// given
363
309
val manifest = TypesManifest (
364
- typingSpec = expectedTypingSpec,
365
310
inputs = mapOf(
366
311
"list-input" to ApiItem (type = "list", separator = ","),
367
312
),
@@ -382,7 +327,6 @@ class ManifestValidationTest : FunSpec({
382
327
test("list type without 'separator' attribute") {
383
328
// given
384
329
val manifest = TypesManifest (
385
- typingSpec = expectedTypingSpec,
386
330
inputs = mapOf(
387
331
"list-input" to ApiItem (type = "list", listItem = ApiItem (type = "string")),
388
332
),
@@ -403,7 +347,6 @@ class ManifestValidationTest : FunSpec({
403
347
test("list type with 'allowedValues' attribute") {
404
348
// given
405
349
val manifest = TypesManifest (
406
- typingSpec = expectedTypingSpec,
407
350
inputs = mapOf(
408
351
"list-input" to ApiItem (
409
352
type = "list",
@@ -429,7 +372,6 @@ class ManifestValidationTest : FunSpec({
429
372
test("list type with forbidden list item type") {
430
373
// given
431
374
val manifest = TypesManifest (
432
- typingSpec = expectedTypingSpec,
433
375
inputs = mapOf(
434
376
"list-of-lists-input" to ApiItem (
435
377
type = "list",
@@ -460,7 +402,6 @@ class ManifestValidationTest : FunSpec({
460
402
test("list type with list item type with incorrect attributes") {
461
403
// given
462
404
val manifest = TypesManifest (
463
- typingSpec = expectedTypingSpec,
464
405
inputs = mapOf(
465
406
"list-of-enums-without-allowed-values-input" to ApiItem (
466
407
type = "list",
@@ -503,7 +444,6 @@ class ManifestValidationTest : FunSpec({
503
444
test("non-integer types with named values") {
504
445
// given
505
446
val manifest = TypesManifest (
506
- typingSpec = expectedTypingSpec,
507
447
inputs = mapOf(
508
448
"string-input" to ApiItem (type = "string", namedValues = mapOf("foo" to 1)),
509
449
"boolean-input" to ApiItem (type = "boolean", namedValues = mapOf("foo" to 1)),
0 commit comments