diff --git a/test/bindings/amqp/0.2.0/channel/empty.json b/test/bindings/amqp/0.2.0/channel/empty.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/amqp/0.2.0/channel/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/amqp/0.2.0/channel/examples/is queue.json b/test/bindings/amqp/0.2.0/channel/examples/is queue.json deleted file mode 100644 index 530d1ecb..00000000 --- a/test/bindings/amqp/0.2.0/channel/examples/is queue.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "is": "queue", - "queue": { - "name": "my-queue-name", - "durable": true, - "exclusive": true, - "autoDelete": false, - "vhost": "/" - }, - "bindingVersion": "0.2.0" -} \ No newline at end of file diff --git a/test/bindings/amqp/0.2.0/channel/examples/is routing key.json b/test/bindings/amqp/0.2.0/channel/examples/is routing key.json deleted file mode 100644 index f7f30ac7..00000000 --- a/test/bindings/amqp/0.2.0/channel/examples/is routing key.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "is": "routingKey", - "exchange": { - "name": "myExchange", - "type": "topic", - "durable": true, - "autoDelete": false, - "vhost": "/" - }, - "bindingVersion": "0.2.0" -} \ No newline at end of file diff --git a/test/bindings/amqp/0.2.0/channel/extended.json b/test/bindings/amqp/0.2.0/channel/extended.json deleted file mode 100644 index 2f750d3e..00000000 --- a/test/bindings/amqp/0.2.0/channel/extended.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "is": "queue", - "queue": { - "name": "my-queue-name", - "durable": true, - "exclusive": true, - "autoDelete": false, - "vhost": "/" - }, - "bindingVersion": "0.2.0", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/amqp/0.2.0/channel/only required properties.json b/test/bindings/amqp/0.2.0/channel/only required properties.json deleted file mode 100644 index beee99d3..00000000 --- a/test/bindings/amqp/0.2.0/channel/only required properties.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "is": "routingKey", - "bindingVersion": "0.2.0" -} \ No newline at end of file diff --git a/test/bindings/amqp/0.2.0/channel/without required properties.json b/test/bindings/amqp/0.2.0/channel/without required properties.json deleted file mode 100644 index 2938f064..00000000 --- a/test/bindings/amqp/0.2.0/channel/without required properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "queue": { - "name": "my-queue-name", - "durable": true, - "exclusive": true, - "autoDelete": false, - "vhost": "/" - }, - "exchange": { - "name": "myExchange", - "type": "topic", - "durable": true, - "autoDelete": false, - "vhost": "/" - }, - "bindingVersion": "0.2.0" -} \ No newline at end of file diff --git a/test/bindings/amqp/0.2.0/channel/wrongly extended.json b/test/bindings/amqp/0.2.0/channel/wrongly extended.json deleted file mode 100644 index df061e48..00000000 --- a/test/bindings/amqp/0.2.0/channel/wrongly extended.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "is": "queue", - "queue": { - "name": "my-queue-name", - "durable": true, - "exclusive": true, - "autoDelete": false, - "vhost": "/" - }, - "bindingVersion": "0.2.0", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/amqp/0.2.0/message/empty.json b/test/bindings/amqp/0.2.0/message/empty.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/amqp/0.2.0/message/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/amqp/0.2.0/message/example.json b/test/bindings/amqp/0.2.0/message/example.json deleted file mode 100644 index 67fc27b2..00000000 --- a/test/bindings/amqp/0.2.0/message/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" -} \ No newline at end of file diff --git a/test/bindings/amqp/0.2.0/message/extended.json b/test/bindings/amqp/0.2.0/message/extended.json deleted file mode 100644 index 9701a441..00000000 --- a/test/bindings/amqp/0.2.0/message/extended.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/amqp/0.2.0/message/only required properties.json b/test/bindings/amqp/0.2.0/message/only required properties.json deleted file mode 100644 index 281892d4..00000000 --- a/test/bindings/amqp/0.2.0/message/only required properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "bindingVersion": "0.2.0" -} \ No newline at end of file diff --git a/test/bindings/amqp/0.2.0/message/without required properties.json b/test/bindings/amqp/0.2.0/message/without required properties.json deleted file mode 100644 index 281892d4..00000000 --- a/test/bindings/amqp/0.2.0/message/without required properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "bindingVersion": "0.2.0" -} \ No newline at end of file diff --git a/test/bindings/amqp/0.2.0/message/wrongly extended.json b/test/bindings/amqp/0.2.0/message/wrongly extended.json deleted file mode 100644 index d00f98e2..00000000 --- a/test/bindings/amqp/0.2.0/message/wrongly extended.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/amqp/0.2.0/operation/empty.json b/test/bindings/amqp/0.2.0/operation/empty.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/amqp/0.2.0/operation/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/amqp/0.2.0/operation/example.json b/test/bindings/amqp/0.2.0/operation/example.json deleted file mode 100644 index 535dd488..00000000 --- a/test/bindings/amqp/0.2.0/operation/example.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "replyTo": "user.signedup", - "timestamp": true, - "ack": false, - "bindingVersion": "0.2.0" -} \ No newline at end of file diff --git a/test/bindings/amqp/0.2.0/operation/extended.json b/test/bindings/amqp/0.2.0/operation/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/amqp/0.2.0/operation/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/amqp/0.2.0/operation/only required properties.json b/test/bindings/amqp/0.2.0/operation/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/amqp/0.2.0/operation/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/amqp/0.2.0/operation/without required properties.json b/test/bindings/amqp/0.2.0/operation/without required properties.json deleted file mode 100644 index 535dd488..00000000 --- a/test/bindings/amqp/0.2.0/operation/without required properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "replyTo": "user.signedup", - "timestamp": true, - "ack": false, - "bindingVersion": "0.2.0" -} \ No newline at end of file diff --git a/test/bindings/amqp/0.2.0/operation/wrongly extended.json b/test/bindings/amqp/0.2.0/operation/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/amqp/0.2.0/operation/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/channel/empty.json b/test/bindings/amqp/0.3.0/channel/empty.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/amqp/0.3.0/channel/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/channel/examples/is queue.json b/test/bindings/amqp/0.3.0/channel/examples/is queue.json deleted file mode 100644 index 7e893eed..00000000 --- a/test/bindings/amqp/0.3.0/channel/examples/is queue.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "is": "queue", - "queue": { - "name": "my-queue-name", - "durable": true, - "exclusive": true, - "autoDelete": false, - "vhost": "/" - }, - "bindingVersion": "0.3.0" -} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/channel/examples/is routing key.json b/test/bindings/amqp/0.3.0/channel/examples/is routing key.json deleted file mode 100644 index c7b27515..00000000 --- a/test/bindings/amqp/0.3.0/channel/examples/is routing key.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "is": "routingKey", - "exchange": { - "name": "myExchange", - "type": "topic", - "durable": true, - "autoDelete": false, - "vhost": "/" - }, - "bindingVersion": "0.3.0" -} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/channel/extended.json b/test/bindings/amqp/0.3.0/channel/extended.json deleted file mode 100644 index cd51d044..00000000 --- a/test/bindings/amqp/0.3.0/channel/extended.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "is": "queue", - "queue": { - "name": "my-queue-name", - "durable": true, - "exclusive": true, - "autoDelete": false, - "vhost": "/" - }, - "bindingVersion": "0.3.0", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/channel/only required properties.json b/test/bindings/amqp/0.3.0/channel/only required properties.json deleted file mode 100644 index beee99d3..00000000 --- a/test/bindings/amqp/0.3.0/channel/only required properties.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "is": "routingKey", - "bindingVersion": "0.2.0" -} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/channel/without required properties.json b/test/bindings/amqp/0.3.0/channel/without required properties.json deleted file mode 100644 index 2938f064..00000000 --- a/test/bindings/amqp/0.3.0/channel/without required properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "queue": { - "name": "my-queue-name", - "durable": true, - "exclusive": true, - "autoDelete": false, - "vhost": "/" - }, - "exchange": { - "name": "myExchange", - "type": "topic", - "durable": true, - "autoDelete": false, - "vhost": "/" - }, - "bindingVersion": "0.2.0" -} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/channel/wrongly extended.json b/test/bindings/amqp/0.3.0/channel/wrongly extended.json deleted file mode 100644 index da65e5a8..00000000 --- a/test/bindings/amqp/0.3.0/channel/wrongly extended.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "is": "queue", - "queue": { - "name": "my-queue-name", - "durable": true, - "exclusive": true, - "autoDelete": false, - "vhost": "/" - }, - "bindingVersion": "0.3.0", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/message/empty.json b/test/bindings/amqp/0.3.0/message/empty.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/amqp/0.3.0/message/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/message/example.json b/test/bindings/amqp/0.3.0/message/example.json deleted file mode 100644 index fa5d13ff..00000000 --- a/test/bindings/amqp/0.3.0/message/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.3.0" -} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/message/extended.json b/test/bindings/amqp/0.3.0/message/extended.json deleted file mode 100644 index 9aa622c6..00000000 --- a/test/bindings/amqp/0.3.0/message/extended.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.3.0", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/message/only required properties.json b/test/bindings/amqp/0.3.0/message/only required properties.json deleted file mode 100644 index e50c8c3e..00000000 --- a/test/bindings/amqp/0.3.0/message/only required properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "bindingVersion": "0.3.0" -} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/message/without required properties.json b/test/bindings/amqp/0.3.0/message/without required properties.json deleted file mode 100644 index e50c8c3e..00000000 --- a/test/bindings/amqp/0.3.0/message/without required properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "bindingVersion": "0.3.0" -} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/message/wrongly extended.json b/test/bindings/amqp/0.3.0/message/wrongly extended.json deleted file mode 100644 index f3ea9cc5..00000000 --- a/test/bindings/amqp/0.3.0/message/wrongly extended.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.3.0", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/operation/empty.json b/test/bindings/amqp/0.3.0/operation/empty.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/amqp/0.3.0/operation/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/operation/example.json b/test/bindings/amqp/0.3.0/operation/example.json deleted file mode 100644 index 86b28401..00000000 --- a/test/bindings/amqp/0.3.0/operation/example.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "timestamp": true, - "ack": false, - "bindingVersion": "0.3.0" -} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/operation/extended.json b/test/bindings/amqp/0.3.0/operation/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/amqp/0.3.0/operation/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/operation/only required properties.json b/test/bindings/amqp/0.3.0/operation/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/amqp/0.3.0/operation/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/operation/without required properties.json b/test/bindings/amqp/0.3.0/operation/without required properties.json deleted file mode 100644 index 86b28401..00000000 --- a/test/bindings/amqp/0.3.0/operation/without required properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "timestamp": true, - "ack": false, - "bindingVersion": "0.3.0" -} \ No newline at end of file diff --git a/test/bindings/amqp/0.3.0/operation/wrongly extended.json b/test/bindings/amqp/0.3.0/operation/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/amqp/0.3.0/operation/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/amqp/amqp channel binding.test.mjs b/test/bindings/amqp/amqp channel binding.test.mjs new file mode 100644 index 00000000..74173ef9 --- /dev/null +++ b/test/bindings/amqp/amqp channel binding.test.mjs @@ -0,0 +1,171 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + true, + [ + 'must have required property \'exchange\'', + 'must have required property \'queue\'', + 'must match exactly one schema in oneOf' + ], + true, + [] +); + +let data = { + "0.2.0": new JsonSchemaTestSuiteData( + require(`@bindings/amqp/0.2.0/channel.json`), + [ + { + "is": "queue", + "queue": { + "name": "my-queue-name", + "durable": true, + "exclusive": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.2.0" + }, + { + "is": "routingKey", + "exchange": { + "name": "myExchange", + "type": "topic", + "durable": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.2.0" + } + ], + { + "is": "queue", + "queue": { + "name": "my-queue-name", + "durable": true, + "exclusive": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.2.0" + }, + { + "bindingVersion": "0.2.0" + }, + { + "is": "queue", + "queue": { + "name": "my-queue-name", + "durable": true, + "exclusive": true, + "autoDelete": false, + "vhost": "/" + }, + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "is": "queue", + "queue": { + "name": "my-queue-name", + "durable": true, + "exclusive": true, + "autoDelete": false, + "vhost": "/" + }, + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.3.0": new JsonSchemaTestSuiteData( + require(`@bindings/amqp/0.3.0/channel.json`), + [ + { + "is": "queue", + "queue": { + "name": "my-queue-name", + "durable": true, + "exclusive": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.3.0" + }, + { + "is": "routingKey", + "exchange": { + "name": "myExchange", + "type": "topic", + "durable": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.3.0" + } + ], + { + "is": "queue", + "queue": { + "name": "my-queue-name", + "durable": true, + "exclusive": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.3.0" + }, + { + "bindingVersion": "0.3.0" + }, + { + "is": "queue", + "queue": { + "name": "my-queue-name", + "durable": true, + "exclusive": true, + "autoDelete": false, + "vhost": "/" + }, + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "is": "queue", + "queue": { + "name": "my-queue-name", + "durable": true, + "exclusive": true, + "autoDelete": false, + "vhost": "/" + }, + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ) +} + +describe.each([ + '0.2.0', + '0.3.0' +])('AMQP channel binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/amqp/amqp message binding.test.mjs b/test/bindings/amqp/amqp message binding.test.mjs new file mode 100644 index 00000000..ffbcc3a5 --- /dev/null +++ b/test/bindings/amqp/amqp message binding.test.mjs @@ -0,0 +1,77 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.2.0": new JsonSchemaTestSuiteData( + require(`@bindings/amqp/0.2.0/message.json`), + [ + { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.2.0" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.3.0": new JsonSchemaTestSuiteData( + require(`@bindings/amqp/0.3.0/message.json`), + [ + { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ) +} + +describe.each([ + '0.2.0', + '0.3.0' +])('AMQP message binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/amqp/amqp operation binding.test.mjs b/test/bindings/amqp/amqp operation binding.test.mjs new file mode 100644 index 00000000..b5882714 --- /dev/null +++ b/test/bindings/amqp/amqp operation binding.test.mjs @@ -0,0 +1,99 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.2.0": new JsonSchemaTestSuiteData( + require(`@bindings/amqp/0.2.0/operation.json`), + [ + { + "expiration": 100000, + "userId": "guest", + "cc": [ + "user.logs" + ], + "priority": 10, + "deliveryMode": 2, + "mandatory": false, + "bcc": [ + "external.audit" + ], + "timestamp": true, + "ack": false, + "bindingVersion": "0.2.0" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.3.0": new JsonSchemaTestSuiteData( + require(`@bindings/amqp/0.3.0/operation.json`), + [ + { + "expiration": 100000, + "userId": "guest", + "cc": [ + "user.logs" + ], + "priority": 10, + "deliveryMode": 2, + "mandatory": false, + "bcc": [ + "external.audit" + ], + "timestamp": true, + "ack": false, + "bindingVersion": "0.3.0" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ) +} + +describe.each([ + '0.2.0', + '0.3.0' +])('AMQP operation binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/amqp/amqp.test.mjs b/test/bindings/amqp/amqp.test.mjs deleted file mode 100644 index f9025e76..00000000 --- a/test/bindings/amqp/amqp.test.mjs +++ /dev/null @@ -1,125 +0,0 @@ -import {it, test} from 'vitest'; -import TestHelper from '@test/test-helper.mjs'; -import path from 'path'; - -describe.each([ - '0.2.0', - '0.3.0' -])('AMQP bindings v%s', async (bindingVersion) => { - - const channelSchema = await import(`@bindings/amqp/${bindingVersion}/channel.json`); - const messageSchema = await import(`@bindings/amqp/${bindingVersion}/message.json`); - const operationSchema = await import(`@bindings/amqp/${bindingVersion}/operation.json`); - - describe('channel', () => { - it('is: routingKey', () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/examples/is routing key.json`), - )); - - it('is: queue', () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/examples/is queue.json`), - )); - - it(TestHelper.cannotBeEmptyTestName, () => TestHelper.objectIsNotValid( - channelSchema, - {}, - [ - 'must have required property \'exchange\'', - 'must have required property \'queue\'', - 'must match exactly one schema in oneOf' - ] - )); - - it.todo('without required properties - \'is\' must be required property?', () => TestHelper.objectIsNotValid( - channelSchema, - { - bindingVersion: bindingVersion - }, - [] - )); - - it.todo('only required properties - \'is\' must be required property?', () => TestHelper.objectIsNotValid( - channelSchema, - { - bindingVersion: bindingVersion - }, - [] - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/wrongly extended.json`), - )); - }) - - describe('message', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - messageSchema, - {} - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/wrongly extended.json`), - )); - }) - - describe('operation', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - operationSchema, - {} - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/wrongly extended.json`), - )); - }) -}) \ No newline at end of file diff --git a/test/bindings/anypointmq/0.0.1/channel/example.json b/test/bindings/anypointmq/0.0.1/channel/example.json deleted file mode 100644 index 8c3ee230..00000000 --- a/test/bindings/anypointmq/0.0.1/channel/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "destination": "user-signup-exchg", - "destinationType": "exchange", - "bindingVersion": "0.0.1" -} \ No newline at end of file diff --git a/test/bindings/anypointmq/0.0.1/channel/extended.json b/test/bindings/anypointmq/0.0.1/channel/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/anypointmq/0.0.1/channel/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/anypointmq/0.0.1/channel/only required properties.json b/test/bindings/anypointmq/0.0.1/channel/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/anypointmq/0.0.1/channel/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/anypointmq/0.0.1/channel/without required properties.json b/test/bindings/anypointmq/0.0.1/channel/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/anypointmq/0.0.1/channel/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/anypointmq/0.0.1/channel/wrongly extended.json b/test/bindings/anypointmq/0.0.1/channel/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/anypointmq/0.0.1/channel/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/anypointmq/0.0.1/message/example.json b/test/bindings/anypointmq/0.0.1/message/example.json deleted file mode 100644 index 7dcaba38..00000000 --- a/test/bindings/anypointmq/0.0.1/message/example.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" -} \ No newline at end of file diff --git a/test/bindings/anypointmq/0.0.1/message/extended.json b/test/bindings/anypointmq/0.0.1/message/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/anypointmq/0.0.1/message/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/anypointmq/0.0.1/message/only required properties.json b/test/bindings/anypointmq/0.0.1/message/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/anypointmq/0.0.1/message/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/anypointmq/0.0.1/message/without required properties.json b/test/bindings/anypointmq/0.0.1/message/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/anypointmq/0.0.1/message/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/anypointmq/0.0.1/message/wrongly extended.json b/test/bindings/anypointmq/0.0.1/message/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/anypointmq/0.0.1/message/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/anypointmq/anypointmq channel binding.test.mjs b/test/bindings/anypointmq/anypointmq channel binding.test.mjs new file mode 100644 index 00000000..c1a882f4 --- /dev/null +++ b/test/bindings/anypointmq/anypointmq channel binding.test.mjs @@ -0,0 +1,49 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.0.1": new JsonSchemaTestSuiteData( + require(`@bindings/anypointmq/0.0.1/channel.json`), + [ + { + "destination": "user-signup-exchg", + "destinationType": "exchange", + "bindingVersion": "0.0.1" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.0.1', +])('Anypoint MQ channel binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/anypointmq/anypointmq message binding.test.mjs b/test/bindings/anypointmq/anypointmq message binding.test.mjs new file mode 100644 index 00000000..c3c9a811 --- /dev/null +++ b/test/bindings/anypointmq/anypointmq message binding.test.mjs @@ -0,0 +1,56 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.0.1": new JsonSchemaTestSuiteData( + require(`@bindings/anypointmq/0.0.1/message.json`), + [ + { + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + } + } + }, + "bindingVersion": "0.0.1" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.0.1', +])('Anypoint MQ message binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/anypointmq/anypointmq.test.mjs b/test/bindings/anypointmq/anypointmq.test.mjs deleted file mode 100644 index 0aa3fbe6..00000000 --- a/test/bindings/anypointmq/anypointmq.test.mjs +++ /dev/null @@ -1,75 +0,0 @@ -import {it} from 'vitest'; -import TestHelper from '@test/test-helper.mjs'; -import path from 'path'; - -describe.each([ - '0.0.1' -])('Anypoint MQ bindings v%s', async (bindingVersion) => { - - const channelSchema = await import(`@bindings/anypointmq/${bindingVersion}/channel.json`); - const messageSchema = await import(`@bindings/anypointmq/${bindingVersion}/message.json`); - - describe('channel', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - channelSchema, - {} - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/wrongly extended.json`), - )); - }) - - describe('message', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - messageSchema, - {} - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/wrongly extended.json`), - )); - }) -}) \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.1.0/channel/example.json b/test/bindings/googlepubsub/0.1.0/channel/example.json deleted file mode 100644 index 2eae2500..00000000 --- a/test/bindings/googlepubsub/0.1.0/channel/example.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "topic": "projects/your-project/topics/topic-proto-schema", - "messageRetentionDuration": "86400s", - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4" - ] - }, - "schemaSettings": { - "encoding": "binary", - "name": "projects/your-project/schemas/message-proto" - }, - "bindingVersion": "0.1.0" -} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.1.0/channel/extended.json b/test/bindings/googlepubsub/0.1.0/channel/extended.json deleted file mode 100644 index c1f000f7..00000000 --- a/test/bindings/googlepubsub/0.1.0/channel/extended.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "topic": "projects/your-project/topics/topic-proto-schema", - "schemaSettings": { - "encoding": "binary", - "name": "projects/your-project/schemas/message-proto" - }, - "bindingVersion": "0.1.0", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.1.0/channel/only required properties.json b/test/bindings/googlepubsub/0.1.0/channel/only required properties.json deleted file mode 100644 index 0625e927..00000000 --- a/test/bindings/googlepubsub/0.1.0/channel/only required properties.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "topic": "projects/your-project/topics/topic-proto-schema", - "schemaSettings": { - "encoding": "binary", - "name": "projects/your-project/schemas/message-proto" - }, - "bindingVersion": "0.1.0" -} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.1.0/channel/without required properties.json b/test/bindings/googlepubsub/0.1.0/channel/without required properties.json deleted file mode 100644 index 09caa2bf..00000000 --- a/test/bindings/googlepubsub/0.1.0/channel/without required properties.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "messageRetentionDuration": "86400s", - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4" - ] - }, - "bindingVersion": "0.1.0" -} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.1.0/channel/wrongly extended.json b/test/bindings/googlepubsub/0.1.0/channel/wrongly extended.json deleted file mode 100644 index 6ad4b418..00000000 --- a/test/bindings/googlepubsub/0.1.0/channel/wrongly extended.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "topic": "projects/your-project/topics/topic-proto-schema", - "schemaSettings": { - "encoding": "binary", - "name": "projects/your-project/schemas/message-proto" - }, - "bindingVersion": "0.1.0", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.1.0/message/example.json b/test/bindings/googlepubsub/0.1.0/message/example.json deleted file mode 100644 index c60a8f60..00000000 --- a/test/bindings/googlepubsub/0.1.0/message/example.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" -} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.1.0/message/extended.json b/test/bindings/googlepubsub/0.1.0/message/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/googlepubsub/0.1.0/message/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.1.0/message/only required properties.json b/test/bindings/googlepubsub/0.1.0/message/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/googlepubsub/0.1.0/message/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.1.0/message/without required properties.json b/test/bindings/googlepubsub/0.1.0/message/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/googlepubsub/0.1.0/message/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.1.0/message/wrongly extended.json b/test/bindings/googlepubsub/0.1.0/message/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/googlepubsub/0.1.0/message/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.2.0/channel/example.json b/test/bindings/googlepubsub/0.2.0/channel/example.json deleted file mode 100644 index 8828154d..00000000 --- a/test/bindings/googlepubsub/0.2.0/channel/example.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "messageRetentionDuration": "86400s", - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4" - ] - }, - "schemaSettings": { - "encoding": "binary", - "name": "projects/your-project/schemas/message-proto" - } -} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.2.0/channel/extended.json b/test/bindings/googlepubsub/0.2.0/channel/extended.json deleted file mode 100644 index b97769c2..00000000 --- a/test/bindings/googlepubsub/0.2.0/channel/extended.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "schemaSettings": { - "encoding": "binary", - "name": "projects/your-project/schemas/message-proto" - }, - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.2.0/channel/only required properties.json b/test/bindings/googlepubsub/0.2.0/channel/only required properties.json deleted file mode 100644 index e1ff89bd..00000000 --- a/test/bindings/googlepubsub/0.2.0/channel/only required properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "schemaSettings": { - "encoding": "binary", - "name": "projects/your-project/schemas/message-proto" - } -} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.2.0/channel/without required properties.json b/test/bindings/googlepubsub/0.2.0/channel/without required properties.json deleted file mode 100644 index 90b93fdf..00000000 --- a/test/bindings/googlepubsub/0.2.0/channel/without required properties.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "messageRetentionDuration": "86400s", - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4" - ] - } -} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.2.0/channel/wrongly extended.json b/test/bindings/googlepubsub/0.2.0/channel/wrongly extended.json deleted file mode 100644 index 250c106f..00000000 --- a/test/bindings/googlepubsub/0.2.0/channel/wrongly extended.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "schemaSettings": { - "encoding": "binary", - "name": "projects/your-project/schemas/message-proto" - }, - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.2.0/message/example.json b/test/bindings/googlepubsub/0.2.0/message/example.json deleted file mode 100644 index df865f0e..00000000 --- a/test/bindings/googlepubsub/0.2.0/message/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "schema": { - "name": "projects/your-project/schemas/message-avro" - } -} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.2.0/message/extended.json b/test/bindings/googlepubsub/0.2.0/message/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/googlepubsub/0.2.0/message/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.2.0/message/only required properties.json b/test/bindings/googlepubsub/0.2.0/message/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/googlepubsub/0.2.0/message/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.2.0/message/without required properties.json b/test/bindings/googlepubsub/0.2.0/message/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/googlepubsub/0.2.0/message/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/googlepubsub/0.2.0/message/wrongly extended.json b/test/bindings/googlepubsub/0.2.0/message/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/googlepubsub/0.2.0/message/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/googlepubsub/googlepubsub channel binding.test.mjs b/test/bindings/googlepubsub/googlepubsub channel binding.test.mjs new file mode 100644 index 00000000..71ec6a4e --- /dev/null +++ b/test/bindings/googlepubsub/googlepubsub channel binding.test.mjs @@ -0,0 +1,191 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = { + "0.1.0": new JsonSchemaTestSuiteConfig( + true, + [ + 'must have required property \'schemaSettings\'', + 'must have required property \'topic\'' + ], + true, + [] + ), + "0.2.0": new JsonSchemaTestSuiteConfig( + true, + [ + 'must have required property \'schemaSettings\'', + ], + true, + [] + ) +}; + +let data = { + "0.1.0": new JsonSchemaTestSuiteData( + require(`@bindings/googlepubsub/0.1.0/channel.json`), + [ + { + "topic": "projects/your-project/topics/topic-proto-schema", + "messageRetentionDuration": "86400s", + "messageStoragePolicy": { + "allowedPersistenceRegions": [ + "us-central1", + "us-central2", + "us-east1", + "us-east4", + "us-east5", + "us-east7", + "us-south1", + "us-west1", + "us-west2", + "us-west3", + "us-west4" + ] + }, + "schemaSettings": { + "encoding": "binary", + "name": "projects/your-project/schemas/message-proto" + }, + "bindingVersion": "0.1.0" + } + ], + { + "topic": "projects/your-project/topics/topic-proto-schema", + "schemaSettings": { + "encoding": "binary", + "name": "projects/your-project/schemas/message-proto" + }, + "bindingVersion": "0.1.0" + }, + { + "messageRetentionDuration": "86400s", + "messageStoragePolicy": { + "allowedPersistenceRegions": [ + "us-central1", + "us-central2", + "us-east1", + "us-east4", + "us-east5", + "us-east7", + "us-south1", + "us-west1", + "us-west2", + "us-west3", + "us-west4" + ] + }, + "bindingVersion": "0.1.0" + }, + { + "topic": "projects/your-project/topics/topic-proto-schema", + "schemaSettings": { + "encoding": "binary", + "name": "projects/your-project/schemas/message-proto" + }, + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "topic": "projects/your-project/topics/topic-proto-schema", + "schemaSettings": { + "encoding": "binary", + "name": "projects/your-project/schemas/message-proto" + }, + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.2.0": new JsonSchemaTestSuiteData( + require(`@bindings/googlepubsub/0.2.0/channel.json`), + [ + { + "messageRetentionDuration": "86400s", + "messageStoragePolicy": { + "allowedPersistenceRegions": [ + "us-central1", + "us-central2", + "us-east1", + "us-east4", + "us-east5", + "us-east7", + "us-south1", + "us-west1", + "us-west2", + "us-west3", + "us-west4" + ] + }, + "schemaSettings": { + "encoding": "binary", + "name": "projects/your-project/schemas/message-proto" + } + } + ], + { + "schemaSettings": { + "encoding": "binary", + "name": "projects/your-project/schemas/message-proto" + } + }, + { + "messageRetentionDuration": "86400s", + "messageStoragePolicy": { + "allowedPersistenceRegions": [ + "us-central1", + "us-central2", + "us-east1", + "us-east4", + "us-east5", + "us-east7", + "us-south1", + "us-west1", + "us-west2", + "us-west3", + "us-west4" + ] + } + }, + { + "schemaSettings": { + "encoding": "binary", + "name": "projects/your-project/schemas/message-proto" + }, + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "schemaSettings": { + "encoding": "binary", + "name": "projects/your-project/schemas/message-proto" + }, + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.1.0', + '0.2.0', +])('Google Pub/Sub channel binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config[bindingVersion]).testSuite() +}) diff --git a/test/bindings/googlepubsub/googlepubsub message binding.test.mjs b/test/bindings/googlepubsub/googlepubsub message binding.test.mjs new file mode 100644 index 00000000..3bd03ecb --- /dev/null +++ b/test/bindings/googlepubsub/googlepubsub message binding.test.mjs @@ -0,0 +1,79 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.1.0": new JsonSchemaTestSuiteData( + require(`@bindings/googlepubsub/0.1.0/message.json`), + [ + { + "schema": { + "name": "projects/your-project/schemas/message-avro", + "type": "avro" + }, + "bindingVersion": "0.1.0" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.2.0": new JsonSchemaTestSuiteData( + require(`@bindings/googlepubsub/0.2.0/message.json`), + [ + { + "schema": { + "name": "projects/your-project/schemas/message-avro" + } + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.1.0', + '0.2.0', +])('Google Pub/Sub message binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config[bindingVersion]).testSuite() +}) diff --git a/test/bindings/googlepubsub/googlepubsub.test.mjs b/test/bindings/googlepubsub/googlepubsub.test.mjs deleted file mode 100644 index dab92554..00000000 --- a/test/bindings/googlepubsub/googlepubsub.test.mjs +++ /dev/null @@ -1,100 +0,0 @@ -import {it} from 'vitest'; -import TestHelper from '@test/test-helper.mjs'; -import path from 'path'; - -describe.each([ - '0.1.0', - '0.2.0', -])('Google Pub/Sub bindings v%s', async (bindingVersion) => { - - const channelSchema = await import(`@bindings/googlepubsub/${bindingVersion}/channel.json`); - const messageSchema = await import(`@bindings/googlepubsub/${bindingVersion}/message.json`); - - describe('channel', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/example.json`), - )); - - it(TestHelper.cannotBeEmptyTestName, () => { - const expectedValidationErrorMessages = bindingVersion === '0.1.0' - ? [ - 'must have required property \'schemaSettings\'', - 'must have required property \'topic\'' - ] - : [ - 'must have required property \'schemaSettings\'', - ] - - TestHelper.objectIsNotValid( - channelSchema, - {}, - expectedValidationErrorMessages - ) - }); - - it(TestHelper.isNotValidWithoutRequiredPropertiesTestName, () => { - const expectedValidationErrorMessages = bindingVersion === '0.1.0' - ? [ - 'must have required property \'schemaSettings\'', - 'must have required property \'topic\'' - ] - : [ - 'must have required property \'schemaSettings\'', - ] - - TestHelper.objectIsNotValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/without required properties.json`), - expectedValidationErrorMessages - ) - }); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/wrongly extended.json`), - )); - }) - - describe('message', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - messageSchema, - {} - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/wrongly extended.json`), - )); - }) -}) \ No newline at end of file diff --git a/test/bindings/http/0.1.0/message/example.json b/test/bindings/http/0.1.0/message/example.json deleted file mode 100644 index bdf5759a..00000000 --- a/test/bindings/http/0.1.0/message/example.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - } -} \ No newline at end of file diff --git a/test/bindings/http/0.1.0/message/extended.json b/test/bindings/http/0.1.0/message/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/http/0.1.0/message/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/http/0.1.0/message/only required properties.json b/test/bindings/http/0.1.0/message/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/http/0.1.0/message/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/http/0.1.0/message/without required properties.json b/test/bindings/http/0.1.0/message/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/http/0.1.0/message/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/http/0.1.0/message/wrongly extended.json b/test/bindings/http/0.1.0/message/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/http/0.1.0/message/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/http/0.1.0/operation/example.json b/test/bindings/http/0.1.0/operation/example.json deleted file mode 100644 index 9f22ccba..00000000 --- a/test/bindings/http/0.1.0/operation/example.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "request", - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - } -} \ No newline at end of file diff --git a/test/bindings/http/0.1.0/operation/extended.json b/test/bindings/http/0.1.0/operation/extended.json deleted file mode 100644 index 3d6a78a1..00000000 --- a/test/bindings/http/0.1.0/operation/extended.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "request", - "method": "GET", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/http/0.1.0/operation/only required properties.json b/test/bindings/http/0.1.0/operation/only required properties.json deleted file mode 100644 index 4197fa3b..00000000 --- a/test/bindings/http/0.1.0/operation/only required properties.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "request", - "method": "GET" -} \ No newline at end of file diff --git a/test/bindings/http/0.1.0/operation/without required properties.json b/test/bindings/http/0.1.0/operation/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/http/0.1.0/operation/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/http/0.1.0/operation/wrongly extended.json b/test/bindings/http/0.1.0/operation/wrongly extended.json deleted file mode 100644 index 9244f9e8..00000000 --- a/test/bindings/http/0.1.0/operation/wrongly extended.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "request", - "method": "GET", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/http/0.2.0/message/example.json b/test/bindings/http/0.2.0/message/example.json deleted file mode 100644 index bdf5759a..00000000 --- a/test/bindings/http/0.2.0/message/example.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - } -} \ No newline at end of file diff --git a/test/bindings/http/0.2.0/message/extended.json b/test/bindings/http/0.2.0/message/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/http/0.2.0/message/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/http/0.2.0/message/only required properties.json b/test/bindings/http/0.2.0/message/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/http/0.2.0/message/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/http/0.2.0/message/without required properties.json b/test/bindings/http/0.2.0/message/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/http/0.2.0/message/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/http/0.2.0/message/wrongly extended.json b/test/bindings/http/0.2.0/message/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/http/0.2.0/message/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/http/0.2.0/operation/example.json b/test/bindings/http/0.2.0/operation/example.json deleted file mode 100644 index 6b36a705..00000000 --- a/test/bindings/http/0.2.0/operation/example.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - } -} \ No newline at end of file diff --git a/test/bindings/http/0.2.0/operation/extended.json b/test/bindings/http/0.2.0/operation/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/http/0.2.0/operation/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/http/0.2.0/operation/only required properties.json b/test/bindings/http/0.2.0/operation/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/http/0.2.0/operation/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/http/0.2.0/operation/without required properties.json b/test/bindings/http/0.2.0/operation/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/http/0.2.0/operation/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/http/0.2.0/operation/wrongly extended.json b/test/bindings/http/0.2.0/operation/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/http/0.2.0/operation/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/http/0.3.0/message/example.json b/test/bindings/http/0.3.0/message/example.json deleted file mode 100644 index ea047d8c..00000000 --- a/test/bindings/http/0.3.0/message/example.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "statusCode": 200 -} \ No newline at end of file diff --git a/test/bindings/http/0.3.0/message/extended.json b/test/bindings/http/0.3.0/message/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/http/0.3.0/message/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/http/0.3.0/message/only required properties.json b/test/bindings/http/0.3.0/message/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/http/0.3.0/message/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/http/0.3.0/message/without required properties.json b/test/bindings/http/0.3.0/message/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/http/0.3.0/message/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/http/0.3.0/message/wrongly extended.json b/test/bindings/http/0.3.0/message/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/http/0.3.0/message/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/http/0.3.0/operation/example.json b/test/bindings/http/0.3.0/operation/example.json deleted file mode 100644 index 6b36a705..00000000 --- a/test/bindings/http/0.3.0/operation/example.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - } -} \ No newline at end of file diff --git a/test/bindings/http/0.3.0/operation/extended.json b/test/bindings/http/0.3.0/operation/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/http/0.3.0/operation/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/http/0.3.0/operation/only required properties.json b/test/bindings/http/0.3.0/operation/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/http/0.3.0/operation/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/http/0.3.0/operation/without required properties.json b/test/bindings/http/0.3.0/operation/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/http/0.3.0/operation/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/http/0.3.0/operation/wrongly extended.json b/test/bindings/http/0.3.0/operation/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/http/0.3.0/operation/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/http/http message binding.test.mjs b/test/bindings/http/http message binding.test.mjs new file mode 100644 index 00000000..4ef2bdae --- /dev/null +++ b/test/bindings/http/http message binding.test.mjs @@ -0,0 +1,130 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.1.0": new JsonSchemaTestSuiteData( + require(`@bindings/http/0.1.0/message.json`), + [ + { + "headers": { + "type": "object", + "properties": { + "Content-Type": { + "type": "string", + "enum": [ + "application/json" + ] + } + } + } + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.2.0": new JsonSchemaTestSuiteData( + require(`@bindings/http/0.2.0/message.json`), + [ + { + "headers": { + "type": "object", + "properties": { + "Content-Type": { + "type": "string", + "enum": [ + "application/json" + ] + } + } + } + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.3.0": new JsonSchemaTestSuiteData( + require(`@bindings/http/0.3.0/message.json`), + [ + { + "headers": { + "type": "object", + "properties": { + "Content-Type": { + "type": "string", + "enum": [ + "application/json" + ] + } + } + }, + "statusCode": 200 + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ) +} + +describe.each([ + '0.1.0', + '0.2.0', + '0.3.0', +])('HTTP message binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config[bindingVersion]).testSuite() +}) diff --git a/test/bindings/http/http operation binding.test.mjs b/test/bindings/http/http operation binding.test.mjs new file mode 100644 index 00000000..f96c5dab --- /dev/null +++ b/test/bindings/http/http operation binding.test.mjs @@ -0,0 +1,162 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = { + "0.1.0": new JsonSchemaTestSuiteConfig( + true, + [ + 'must have required property \'type\'' + ], + true, + [] + ), + "0.2.0": new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] + ), + "0.3.0": new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] + ) +} + +let data = { + "0.1.0": new JsonSchemaTestSuiteData( + require(`@bindings/http/0.1.0/operation.json`), + [ + { + "type": "request", + "method": "GET", + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + } + } + ], + { + "type": "request", + }, + {}, + { + "type": "request", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "type": "request", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.2.0": new JsonSchemaTestSuiteData( + require(`@bindings/http/0.2.0/operation.json`), + [ + { + "method": "GET", + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + } + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.3.0": new JsonSchemaTestSuiteData( + require(`@bindings/http/0.3.0/operation.json`), + [ + { + "method": "GET", + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + } + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ) +} + +describe.each([ + '0.1.0', + '0.2.0', + '0.3.0', +])('HTTP message binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config[bindingVersion]).testSuite() +}) diff --git a/test/bindings/http/http.test.mjs b/test/bindings/http/http.test.mjs deleted file mode 100644 index d550083c..00000000 --- a/test/bindings/http/http.test.mjs +++ /dev/null @@ -1,97 +0,0 @@ -import {it} from 'vitest'; -import TestHelper from '@test/test-helper.mjs'; -import path from 'path'; - -describe.each([ - '0.1.0', - '0.2.0', - '0.3.0', -])('HTTP bindings v%s', async (bindingVersion) => { - - const messageSchema = await import(`@bindings/http/${bindingVersion}/message.json`); - const operationSchema = await import(`@bindings/http/${bindingVersion}/operation.json`); - - describe('message', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - messageSchema, - {} - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/wrongly extended.json`), - )); - }) - - describe('operation', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/example.json`), - )); - - it(`${bindingVersion === '0.1.0' ? TestHelper.cannotBeEmptyTestName : TestHelper.canBeEmptyTestName}`, () => { - if (bindingVersion === '0.1.0') { - TestHelper.objectIsNotValid( - operationSchema, - {}, - ['must have required property \'type\''] - ) - } else { - TestHelper.objectIsValid( - operationSchema, - {}, - ) - } - }) - - it(`${bindingVersion === '0.1.0' ? TestHelper.isNotValidWithoutRequiredPropertiesTestName : TestHelper.isValidWithoutRequiredPropertiesTestName}`, () => { - if (bindingVersion === '0.1.0') { - TestHelper.objectIsNotValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/without required properties.json`), - ['must have required property \'type\''] - ) - } else { - TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/without required properties.json`), - ) - } - }) - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/wrongly extended.json`), - )); - }) -}) \ No newline at end of file diff --git a/test/bindings/ibmmq/0.1.0/channel/examples/queue destination.json b/test/bindings/ibmmq/0.1.0/channel/examples/queue destination.json deleted file mode 100644 index 89055d3b..00000000 --- a/test/bindings/ibmmq/0.1.0/channel/examples/queue destination.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "destinationType": "queue", - "queue": { - "objectName": "message", - "isPartitioned": false, - "exclusive": true - }, - "maxMsgLength": 1024 -} \ No newline at end of file diff --git a/test/bindings/ibmmq/0.1.0/channel/examples/topic destination.json b/test/bindings/ibmmq/0.1.0/channel/examples/topic destination.json deleted file mode 100644 index 740c51a1..00000000 --- a/test/bindings/ibmmq/0.1.0/channel/examples/topic destination.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "destinationType": "topic", - "topic": { - "string": "messages", - "objectName": "message", - "durablePermitted": true, - "lastMsgRetained": true - }, - "maxMsgLength": 1024 -} \ No newline at end of file diff --git a/test/bindings/ibmmq/0.1.0/channel/extended.json b/test/bindings/ibmmq/0.1.0/channel/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/ibmmq/0.1.0/channel/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/ibmmq/0.1.0/channel/only required properties.json b/test/bindings/ibmmq/0.1.0/channel/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/ibmmq/0.1.0/channel/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/ibmmq/0.1.0/channel/without required properties.json b/test/bindings/ibmmq/0.1.0/channel/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/ibmmq/0.1.0/channel/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/ibmmq/0.1.0/channel/wrongly extended.json b/test/bindings/ibmmq/0.1.0/channel/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/ibmmq/0.1.0/channel/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/ibmmq/0.1.0/message/example.json b/test/bindings/ibmmq/0.1.0/message/example.json deleted file mode 100644 index 9c097e10..00000000 --- a/test/bindings/ibmmq/0.1.0/message/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "type": "jms", - "description": "JMS stream message", - "expiry": 0 -} \ No newline at end of file diff --git a/test/bindings/ibmmq/0.1.0/message/extended.json b/test/bindings/ibmmq/0.1.0/message/extended.json deleted file mode 100644 index ad885462..00000000 --- a/test/bindings/ibmmq/0.1.0/message/extended.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "jms", - "description": "JMS stream message", - "expiry": 0, - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/ibmmq/0.1.0/message/only required properties.json b/test/bindings/ibmmq/0.1.0/message/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/ibmmq/0.1.0/message/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/ibmmq/0.1.0/message/without required properties.json b/test/bindings/ibmmq/0.1.0/message/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/ibmmq/0.1.0/message/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/ibmmq/0.1.0/message/wrongly extended.json b/test/bindings/ibmmq/0.1.0/message/wrongly extended.json deleted file mode 100644 index 828bba9b..00000000 --- a/test/bindings/ibmmq/0.1.0/message/wrongly extended.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "type": "jms", - "description": "JMS stream message", - "expiry": 0, - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/ibmmq/0.1.0/server/example.json b/test/bindings/ibmmq/0.1.0/server/example.json deleted file mode 100644 index 47dbbe64..00000000 --- a/test/bindings/ibmmq/0.1.0/server/example.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "groupId": "PRODCLSTR1", - "ccdtQueueManagerName": "*", - "multiEndpointServer": false, - "heartBeatInterval": 300, - "cipherSpec": "ANY_TLS12_OR_HIGHER" -} \ No newline at end of file diff --git a/test/bindings/ibmmq/0.1.0/server/extended.json b/test/bindings/ibmmq/0.1.0/server/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/ibmmq/0.1.0/server/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/ibmmq/0.1.0/server/only required properties.json b/test/bindings/ibmmq/0.1.0/server/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/ibmmq/0.1.0/server/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/ibmmq/0.1.0/server/without required properties.json b/test/bindings/ibmmq/0.1.0/server/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/ibmmq/0.1.0/server/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/ibmmq/0.1.0/server/wrongly extended.json b/test/bindings/ibmmq/0.1.0/server/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/ibmmq/0.1.0/server/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/ibmmq/ibmmq channel binding.test.mjs b/test/bindings/ibmmq/ibmmq channel binding.test.mjs new file mode 100644 index 00000000..6fddce25 --- /dev/null +++ b/test/bindings/ibmmq/ibmmq channel binding.test.mjs @@ -0,0 +1,63 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.1.0": new JsonSchemaTestSuiteData( + require(`@bindings/ibmmq/0.1.0/channel.json`), + [ + { + "destinationType": "queue", + "queue": { + "objectName": "message", + "isPartitioned": false, + "exclusive": true + }, + "maxMsgLength": 1024 + }, + { + "destinationType": "topic", + "topic": { + "string": "messages", + "objectName": "message", + "durablePermitted": true, + "lastMsgRetained": true + }, + "maxMsgLength": 1024 + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.1.0', +])('IBM MQ channel binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/ibmmq/ibmmq message binding.test.mjs b/test/bindings/ibmmq/ibmmq message binding.test.mjs new file mode 100644 index 00000000..2737b03b --- /dev/null +++ b/test/bindings/ibmmq/ibmmq message binding.test.mjs @@ -0,0 +1,58 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + true, + [ + 'must match exactly one schema in oneOf' + ], + true, + [] +); + +let data = { + "0.1.0": new JsonSchemaTestSuiteData( + require(`@bindings/ibmmq/0.1.0/message.json`), + [ + { + "type": "jms", + "description": "JMS stream message", + "expiry": 0 + } + ], + { + "type": "jms", + "description": "JMS stream message", + }, + {}, + { + "type": "jms", + "description": "JMS stream message", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "type": "jms", + "description": "JMS stream message", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.1.0', +])('IBM MQ message binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/ibmmq/ibmmq server binding.test.mjs b/test/bindings/ibmmq/ibmmq server binding.test.mjs new file mode 100644 index 00000000..e6d2cacc --- /dev/null +++ b/test/bindings/ibmmq/ibmmq server binding.test.mjs @@ -0,0 +1,51 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.1.0": new JsonSchemaTestSuiteData( + require(`@bindings/ibmmq/0.1.0/server.json`), + [ + { + "groupId": "PRODCLSTR1", + "ccdtQueueManagerName": "*", + "multiEndpointServer": false, + "heartBeatInterval": 300, + "cipherSpec": "ANY_TLS12_OR_HIGHER" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.1.0', +])('IBM MQ server binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/ibmmq/ibmmq.test.mjs b/test/bindings/ibmmq/ibmmq.test.mjs deleted file mode 100644 index 91e16e2f..00000000 --- a/test/bindings/ibmmq/ibmmq.test.mjs +++ /dev/null @@ -1,115 +0,0 @@ -import {it} from 'vitest'; -import TestHelper from '@test/test-helper.mjs'; -import path from 'path'; - -describe.each([ - '0.1.0', -])('IBM MQ bindings v%s', async (bindingVersion) => { - - const channelSchema = await import(`@bindings/ibmmq/${bindingVersion}/channel.json`); - const messageSchema = await import(`@bindings/ibmmq/${bindingVersion}/message.json`); - const serverSchema = await import(`@bindings/ibmmq/${bindingVersion}/server.json`); - - describe('channel', () => { - it('queue destination', () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/examples/queue destination.json`), - )); - - it('topic destination', () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/examples/topic destination.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - channelSchema, - {}, - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/wrongly extended.json`), - )); - }) - - describe('message', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/example.json`), - )); - - it(TestHelper.cannotBeEmptyTestName, () => TestHelper.objectIsNotValid( - messageSchema, - {}, - ['must match exactly one schema in oneOf'] - )); - - it(TestHelper.isNotValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsNotValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/without required properties.json`), - ['must match exactly one schema in oneOf'] - )); - - it.todo('\'type\' must be required?', () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/wrongly extended.json`), - )); - }) - - describe('server', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - serverSchema, - {} - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/wrongly extended.json`), - )); - }) -}) \ No newline at end of file diff --git a/test/bindings/jms/0.0.1/channel/example.json b/test/bindings/jms/0.0.1/channel/example.json deleted file mode 100644 index a903c8ff..00000000 --- a/test/bindings/jms/0.0.1/channel/example.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "destination": "user-signed-up", - "destinationType": "fifo-queue" -} \ No newline at end of file diff --git a/test/bindings/jms/0.0.1/channel/extended.json b/test/bindings/jms/0.0.1/channel/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/jms/0.0.1/channel/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/jms/0.0.1/channel/only required properties.json b/test/bindings/jms/0.0.1/channel/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/jms/0.0.1/channel/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/jms/0.0.1/channel/without required properties.json b/test/bindings/jms/0.0.1/channel/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/jms/0.0.1/channel/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/jms/0.0.1/channel/wrongly extended.json b/test/bindings/jms/0.0.1/channel/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/jms/0.0.1/channel/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/jms/0.0.1/message/example.json b/test/bindings/jms/0.0.1/message/example.json deleted file mode 100644 index 022d8894..00000000 --- a/test/bindings/jms/0.0.1/message/example.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "headers": { - "type": "object", - "required": ["JMSMessageID"], - "properties": { - "JMSMessageID": { - "type": ["string", "null"], - "description": "A unique message identifier. This may be set by your JMS Provider on your behalf." - }, - "JMSTimestamp": { - "type": "integer", - "description": "The time the message was sent. This may be set by your JMS Provider on your behalf. The time the message was sent. The value of the timestamp is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC." - }, - "JMSDeliveryMode": { - "type": "string", - "enum": ["PERSISTENT", "NON_PERSISTENT"], - "default": "PERSISTENT", - "description": "Denotes the delivery mode for the message. This may be set by your JMS Provider on your behalf." - }, - "JMSPriority": { - "type": "integer", - "default": 4, - "description": "The priority of the message. This may be set by your JMS Provider on your behalf." - }, - "JMSExpires": { - "type": "integer", - "description": "The time at which the message expires. This may be set by your JMS Provider on your behalf. A value of zero means that the message does not expire. Any non-zero value is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC, at which the message will expire." - }, - "JMSType": { - "type": ["string", "null"], - "description": "The type of message. Some JMS providers use a message repository that contains the definitions of messages sent by applications. The 'JMSType' header field may reference a message's definition in the provider's repository. The JMS API does not define a standard message definition repository, nor does it define a naming policy for the definitions it contains. Some messaging systems require that a message type definition for each application message be created and that each message specify its type. In order to work with such JMS providers, JMS clients should assign a value to 'JMSType', whether the application makes use of it or not. This ensures that the field is properly set for those providers that require it." - }, - "JMSCorrelationID": { - "type": ["string", "null"], - "description": "The correlation identifier of the message. A client can use the 'JMSCorrelationID' header field to link one message with another. A typical use is to link a response message with its request message. Since each message sent by a JMS provider is assigned a message ID value, it is convenient to link messages via message ID, such message ID values must start with the 'ID:' prefix. Conversely, application-specified values must not start with the 'ID:' prefix; this is reserved for provider-generated message ID values." - }, - "JMSReplyTo": { - "type": "string", - "description": "The queue or topic that the message sender expects replies to." - } - } - } -} \ No newline at end of file diff --git a/test/bindings/jms/0.0.1/message/extended.json b/test/bindings/jms/0.0.1/message/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/jms/0.0.1/message/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/jms/0.0.1/message/only required properties.json b/test/bindings/jms/0.0.1/message/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/jms/0.0.1/message/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/jms/0.0.1/message/without required properties.json b/test/bindings/jms/0.0.1/message/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/jms/0.0.1/message/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/jms/0.0.1/message/wrongly extended.json b/test/bindings/jms/0.0.1/message/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/jms/0.0.1/message/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/jms/0.0.1/server/empty.json b/test/bindings/jms/0.0.1/server/empty.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/jms/0.0.1/server/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/jms/0.0.1/server/example.json b/test/bindings/jms/0.0.1/server/example.json deleted file mode 100644 index 003cf750..00000000 --- a/test/bindings/jms/0.0.1/server/example.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "jmsConnectionFactory": "org.apache.activemq.ActiveMQConnectionFactory", - "properties": [ - { - "name": "disableTimeStampsByDefault", - "value": false - } - ], - "clientID": "my-application-1" -} \ No newline at end of file diff --git a/test/bindings/jms/0.0.1/server/extended.json b/test/bindings/jms/0.0.1/server/extended.json deleted file mode 100644 index 51b78e36..00000000 --- a/test/bindings/jms/0.0.1/server/extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "jmsConnectionFactory": "org.apache.activemq.ActiveMQConnectionFactory", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/jms/0.0.1/server/only required properties.json b/test/bindings/jms/0.0.1/server/only required properties.json deleted file mode 100644 index cca0c5a7..00000000 --- a/test/bindings/jms/0.0.1/server/only required properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "jmsConnectionFactory": "org.apache.activemq.ActiveMQConnectionFactory" -} \ No newline at end of file diff --git a/test/bindings/jms/0.0.1/server/without required properties.json b/test/bindings/jms/0.0.1/server/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/jms/0.0.1/server/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/jms/0.0.1/server/wrongly extended.json b/test/bindings/jms/0.0.1/server/wrongly extended.json deleted file mode 100644 index efa1bea2..00000000 --- a/test/bindings/jms/0.0.1/server/wrongly extended.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "jmsConnectionFactory": "org.apache.activemq.ActiveMQConnectionFactory", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/jms/jms channel binding.test.mjs b/test/bindings/jms/jms channel binding.test.mjs new file mode 100644 index 00000000..8ec95d36 --- /dev/null +++ b/test/bindings/jms/jms channel binding.test.mjs @@ -0,0 +1,48 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.0.1": new JsonSchemaTestSuiteData( + require(`@bindings/jms/0.0.1/channel.json`), + [ + { + "destination": "user-signed-up", + "destinationType": "fifo-queue" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.0.1', +])('JMS channel binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/jms/jms message binding.test.mjs b/test/bindings/jms/jms message binding.test.mjs new file mode 100644 index 00000000..5556afdc --- /dev/null +++ b/test/bindings/jms/jms message binding.test.mjs @@ -0,0 +1,87 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.0.1": new JsonSchemaTestSuiteData( + require(`@bindings/jms/0.0.1/message.json`), + [ + { + "headers": { + "type": "object", + "required": ["JMSMessageID"], + "properties": { + "JMSMessageID": { + "type": ["string", "null"], + "description": "A unique message identifier. This may be set by your JMS Provider on your behalf." + }, + "JMSTimestamp": { + "type": "integer", + "description": "The time the message was sent. This may be set by your JMS Provider on your behalf. The time the message was sent. The value of the timestamp is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC." + }, + "JMSDeliveryMode": { + "type": "string", + "enum": ["PERSISTENT", "NON_PERSISTENT"], + "default": "PERSISTENT", + "description": "Denotes the delivery mode for the message. This may be set by your JMS Provider on your behalf." + }, + "JMSPriority": { + "type": "integer", + "default": 4, + "description": "The priority of the message. This may be set by your JMS Provider on your behalf." + }, + "JMSExpires": { + "type": "integer", + "description": "The time at which the message expires. This may be set by your JMS Provider on your behalf. A value of zero means that the message does not expire. Any non-zero value is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC, at which the message will expire." + }, + "JMSType": { + "type": ["string", "null"], + "description": "The type of message. Some JMS providers use a message repository that contains the definitions of messages sent by applications. The 'JMSType' header field may reference a message's definition in the provider's repository. The JMS API does not define a standard message definition repository, nor does it define a naming policy for the definitions it contains. Some messaging systems require that a message type definition for each application message be created and that each message specify its type. In order to work with such JMS providers, JMS clients should assign a value to 'JMSType', whether the application makes use of it or not. This ensures that the field is properly set for those providers that require it." + }, + "JMSCorrelationID": { + "type": ["string", "null"], + "description": "The correlation identifier of the message. A client can use the 'JMSCorrelationID' header field to link one message with another. A typical use is to link a response message with its request message. Since each message sent by a JMS provider is assigned a message ID value, it is convenient to link messages via message ID, such message ID values must start with the 'ID:' prefix. Conversely, application-specified values must not start with the 'ID:' prefix; this is reserved for provider-generated message ID values." + }, + "JMSReplyTo": { + "type": "string", + "description": "The queue or topic that the message sender expects replies to." + } + } + } + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.0.1', +])('JMS message binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/jms/jms server binding.test.mjs b/test/bindings/jms/jms server binding.test.mjs new file mode 100644 index 00000000..e4aab720 --- /dev/null +++ b/test/bindings/jms/jms server binding.test.mjs @@ -0,0 +1,60 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + true, + [ + 'must have required property \'jmsConnectionFactory\'', + ], + true, + [] +); + +let data = { + "0.0.1": new JsonSchemaTestSuiteData( + require(`@bindings/jms/0.0.1/server.json`), + [ + { + "jmsConnectionFactory": "org.apache.activemq.ActiveMQConnectionFactory", + "properties": [ + { + "name": "disableTimeStampsByDefault", + "value": false + } + ], + "clientID": "my-application-1" + } + ], + { + "jmsConnectionFactory": "org.apache.activemq.ActiveMQConnectionFactory" + }, + {}, + { + "jmsConnectionFactory": "org.apache.activemq.ActiveMQConnectionFactory", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "jmsConnectionFactory": "org.apache.activemq.ActiveMQConnectionFactory", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.0.1', +])('JMS server binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/jms/jms.test.mjs b/test/bindings/jms/jms.test.mjs deleted file mode 100644 index c26342a0..00000000 --- a/test/bindings/jms/jms.test.mjs +++ /dev/null @@ -1,111 +0,0 @@ -import {it} from 'vitest'; -import TestHelper from '@test/test-helper.mjs'; -import path from 'path'; - -describe.each([ - '0.0.1', -])('JMS bindings v%s', async (bindingVersion) => { - - const channelSchema = await import(`@bindings/jms/${bindingVersion}/channel.json`); - const messageSchema = await import(`@bindings/jms/${bindingVersion}/message.json`); - const serverSchema = await import(`@bindings/jms/${bindingVersion}/server.json`); - - describe('channel', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - channelSchema, - {}, - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/wrongly extended.json`), - )); - }) - - describe('message', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - messageSchema, - {}, - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/wrongly extended.json`), - )); - }) - - describe('server', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/example.json`), - )); - - it(TestHelper.cannotBeEmptyTestName, () => TestHelper.objectIsNotValid( - serverSchema, - {}, - ['must have required property \'jmsConnectionFactory\''] - )); - - it(TestHelper.isNotValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsNotValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/without required properties.json`), - ['must have required property \'jmsConnectionFactory\''] - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/only required properties.json`), - ['must have required property \'jmsConnectionFactory\''] - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/wrongly extended.json`), - )); - }) -}) \ No newline at end of file diff --git a/test/bindings/kafka/0.1.0/message/example.json b/test/bindings/kafka/0.1.0/message/example.json deleted file mode 100644 index 6e453bab..00000000 --- a/test/bindings/kafka/0.1.0/message/example.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "key": { - "type": "string", - "enum": [ - "myKey" - ] - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.1.0/message/extended.json b/test/bindings/kafka/0.1.0/message/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/kafka/0.1.0/message/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.1.0/message/only required properties.json b/test/bindings/kafka/0.1.0/message/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.1.0/message/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.1.0/message/without required properties.json b/test/bindings/kafka/0.1.0/message/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.1.0/message/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.1.0/message/wrongly extended.json b/test/bindings/kafka/0.1.0/message/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/kafka/0.1.0/message/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/kafka/0.1.0/operation/example.json b/test/bindings/kafka/0.1.0/operation/example.json deleted file mode 100644 index 9eb035c2..00000000 --- a/test/bindings/kafka/0.1.0/operation/example.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.1.0/operation/extended.json b/test/bindings/kafka/0.1.0/operation/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/kafka/0.1.0/operation/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.1.0/operation/only required properties.json b/test/bindings/kafka/0.1.0/operation/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.1.0/operation/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.1.0/operation/without required properties.json b/test/bindings/kafka/0.1.0/operation/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.1.0/operation/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.1.0/operation/wrongly extended.json b/test/bindings/kafka/0.1.0/operation/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/kafka/0.1.0/operation/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/channel/example.json b/test/bindings/kafka/0.3.0/channel/example.json deleted file mode 100644 index 7be205b8..00000000 --- a/test/bindings/kafka/0.3.0/channel/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "topic": "my-specific-topic", - "partitions": 20, - "replicas": 3 -} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/channel/extended.json b/test/bindings/kafka/0.3.0/channel/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/kafka/0.3.0/channel/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/channel/only required properties.json b/test/bindings/kafka/0.3.0/channel/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.3.0/channel/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/channel/without required properties.json b/test/bindings/kafka/0.3.0/channel/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.3.0/channel/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/channel/wrongly extended.json b/test/bindings/kafka/0.3.0/channel/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/kafka/0.3.0/channel/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/message/example.json b/test/bindings/kafka/0.3.0/message/example.json deleted file mode 100644 index 73436b7d..00000000 --- a/test/bindings/kafka/0.3.0/message/example.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy" -} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/message/extended.json b/test/bindings/kafka/0.3.0/message/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/kafka/0.3.0/message/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/message/only required properties.json b/test/bindings/kafka/0.3.0/message/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.3.0/message/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/message/without required properties.json b/test/bindings/kafka/0.3.0/message/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.3.0/message/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/message/wrongly extended.json b/test/bindings/kafka/0.3.0/message/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/kafka/0.3.0/message/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/operation/example.json b/test/bindings/kafka/0.3.0/operation/example.json deleted file mode 100644 index 9eb035c2..00000000 --- a/test/bindings/kafka/0.3.0/operation/example.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/operation/extended.json b/test/bindings/kafka/0.3.0/operation/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/kafka/0.3.0/operation/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/operation/only required properties.json b/test/bindings/kafka/0.3.0/operation/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.3.0/operation/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/operation/without required properties.json b/test/bindings/kafka/0.3.0/operation/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.3.0/operation/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/operation/wrongly extended.json b/test/bindings/kafka/0.3.0/operation/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/kafka/0.3.0/operation/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/server/example.json b/test/bindings/kafka/0.3.0/server/example.json deleted file mode 100644 index 2edb3cb8..00000000 --- a/test/bindings/kafka/0.3.0/server/example.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "schemaRegistryUrl": "https://my-schema-registry.com", - "schemaRegistryVendor": "confluent" -} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/server/extended.json b/test/bindings/kafka/0.3.0/server/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/kafka/0.3.0/server/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/server/only required properties.json b/test/bindings/kafka/0.3.0/server/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.3.0/server/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/server/without required properties.json b/test/bindings/kafka/0.3.0/server/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.3.0/server/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.3.0/server/wrongly extended.json b/test/bindings/kafka/0.3.0/server/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/kafka/0.3.0/server/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/channel/empty.json b/test/bindings/kafka/0.4.0/channel/empty.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.4.0/channel/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/channel/example.json b/test/bindings/kafka/0.4.0/channel/example.json deleted file mode 100644 index cd504f3e..00000000 --- a/test/bindings/kafka/0.4.0/channel/example.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "topic": "my-specific-topic-name", - "partitions": 20, - "replicas": 3, - "topicConfiguration": { - "cleanup.policy": [ - "delete", - "compact" - ], - "retention.ms": 604800000, - "retention.bytes": 1000000000, - "delete.retention.ms": 86400000, - "max.message.bytes": 1048588 - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/channel/extended.json b/test/bindings/kafka/0.4.0/channel/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/kafka/0.4.0/channel/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/channel/index.mjs b/test/bindings/kafka/0.4.0/channel/index.mjs deleted file mode 100644 index 0c4302bf..00000000 --- a/test/bindings/kafka/0.4.0/channel/index.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@bindings/kafka/0.4.0/channel.json'); - -describe('Channel', () => { - it('example', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('empty', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - )); - - it('without required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - )); - - it('only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it('extended', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json'), - )); - - it('wrongly extended', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json'), - )); -}); diff --git a/test/bindings/kafka/0.4.0/channel/only required properties.json b/test/bindings/kafka/0.4.0/channel/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.4.0/channel/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/channel/without required properties.json b/test/bindings/kafka/0.4.0/channel/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.4.0/channel/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/channel/wrongly extended.json b/test/bindings/kafka/0.4.0/channel/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/kafka/0.4.0/channel/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/message/empty.json b/test/bindings/kafka/0.4.0/message/empty.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.4.0/message/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/message/example.json b/test/bindings/kafka/0.4.0/message/example.json deleted file mode 100644 index 73436b7d..00000000 --- a/test/bindings/kafka/0.4.0/message/example.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy" -} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/message/extended.json b/test/bindings/kafka/0.4.0/message/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/kafka/0.4.0/message/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/message/index.mjs b/test/bindings/kafka/0.4.0/message/index.mjs deleted file mode 100644 index 38ee15a8..00000000 --- a/test/bindings/kafka/0.4.0/message/index.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@bindings/kafka/0.4.0/message.json'); - -describe('Message', () => { - it('example', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('empty', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - )); - - it('without required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - )); - - it('only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it('extended', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json'), - )); - - it('wrongly extended', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json'), - )); -}); diff --git a/test/bindings/kafka/0.4.0/message/only required properties.json b/test/bindings/kafka/0.4.0/message/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.4.0/message/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/message/without required properties.json b/test/bindings/kafka/0.4.0/message/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.4.0/message/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/message/wrongly extended.json b/test/bindings/kafka/0.4.0/message/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/kafka/0.4.0/message/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/operation/empty.json b/test/bindings/kafka/0.4.0/operation/empty.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.4.0/operation/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/operation/example.json b/test/bindings/kafka/0.4.0/operation/example.json deleted file mode 100644 index 9eb035c2..00000000 --- a/test/bindings/kafka/0.4.0/operation/example.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/operation/extended.json b/test/bindings/kafka/0.4.0/operation/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/kafka/0.4.0/operation/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/operation/index.mjs b/test/bindings/kafka/0.4.0/operation/index.mjs deleted file mode 100644 index a7ba13f7..00000000 --- a/test/bindings/kafka/0.4.0/operation/index.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@bindings/kafka/0.4.0/operation.json'); - -describe('Operation', () => { - it('example', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('empty', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - )); - - it('without required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - )); - - it('only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it('extended', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json'), - )); - - it('wrongly extended', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json'), - )); -}); diff --git a/test/bindings/kafka/0.4.0/operation/only required properties.json b/test/bindings/kafka/0.4.0/operation/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.4.0/operation/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/operation/without required properties.json b/test/bindings/kafka/0.4.0/operation/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.4.0/operation/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/operation/wrongly extended.json b/test/bindings/kafka/0.4.0/operation/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/kafka/0.4.0/operation/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/server/empty.json b/test/bindings/kafka/0.4.0/server/empty.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.4.0/server/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/server/example.json b/test/bindings/kafka/0.4.0/server/example.json deleted file mode 100644 index 2edb3cb8..00000000 --- a/test/bindings/kafka/0.4.0/server/example.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "schemaRegistryUrl": "https://my-schema-registry.com", - "schemaRegistryVendor": "confluent" -} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/server/extended.json b/test/bindings/kafka/0.4.0/server/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/kafka/0.4.0/server/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/server/index.mjs b/test/bindings/kafka/0.4.0/server/index.mjs deleted file mode 100644 index bb9a2ef4..00000000 --- a/test/bindings/kafka/0.4.0/server/index.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@bindings/kafka/0.4.0/server.json'); - -describe('Server', () => { - it('example', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('empty', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - )); - - it('without required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - )); - - it('only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it('extended', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json'), - )); - - it('wrongly extended', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json'), - )); -}); diff --git a/test/bindings/kafka/0.4.0/server/only required properties.json b/test/bindings/kafka/0.4.0/server/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.4.0/server/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/server/without required properties.json b/test/bindings/kafka/0.4.0/server/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.4.0/server/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.4.0/server/wrongly extended.json b/test/bindings/kafka/0.4.0/server/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/kafka/0.4.0/server/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/channel/example.json b/test/bindings/kafka/0.5.0/channel/example.json deleted file mode 100644 index cd504f3e..00000000 --- a/test/bindings/kafka/0.5.0/channel/example.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "topic": "my-specific-topic-name", - "partitions": 20, - "replicas": 3, - "topicConfiguration": { - "cleanup.policy": [ - "delete", - "compact" - ], - "retention.ms": 604800000, - "retention.bytes": 1000000000, - "delete.retention.ms": 86400000, - "max.message.bytes": 1048588 - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/channel/extended.json b/test/bindings/kafka/0.5.0/channel/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/kafka/0.5.0/channel/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/channel/only required properties.json b/test/bindings/kafka/0.5.0/channel/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.5.0/channel/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/channel/without required properties.json b/test/bindings/kafka/0.5.0/channel/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.5.0/channel/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/channel/wrongly extended.json b/test/bindings/kafka/0.5.0/channel/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/kafka/0.5.0/channel/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/message/example.json b/test/bindings/kafka/0.5.0/message/example.json deleted file mode 100644 index 73436b7d..00000000 --- a/test/bindings/kafka/0.5.0/message/example.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy" -} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/message/extended.json b/test/bindings/kafka/0.5.0/message/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/kafka/0.5.0/message/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/message/only required properties.json b/test/bindings/kafka/0.5.0/message/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.5.0/message/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/message/without required properties.json b/test/bindings/kafka/0.5.0/message/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.5.0/message/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/message/wrongly extended.json b/test/bindings/kafka/0.5.0/message/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/kafka/0.5.0/message/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/operation/example.json b/test/bindings/kafka/0.5.0/operation/example.json deleted file mode 100644 index 9eb035c2..00000000 --- a/test/bindings/kafka/0.5.0/operation/example.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/operation/extended.json b/test/bindings/kafka/0.5.0/operation/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/kafka/0.5.0/operation/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/operation/only required properties.json b/test/bindings/kafka/0.5.0/operation/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.5.0/operation/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/operation/without required properties.json b/test/bindings/kafka/0.5.0/operation/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.5.0/operation/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/operation/wrongly extended.json b/test/bindings/kafka/0.5.0/operation/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/kafka/0.5.0/operation/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/server/example.json b/test/bindings/kafka/0.5.0/server/example.json deleted file mode 100644 index 2edb3cb8..00000000 --- a/test/bindings/kafka/0.5.0/server/example.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "schemaRegistryUrl": "https://my-schema-registry.com", - "schemaRegistryVendor": "confluent" -} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/server/extended.json b/test/bindings/kafka/0.5.0/server/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/kafka/0.5.0/server/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/server/only required properties.json b/test/bindings/kafka/0.5.0/server/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.5.0/server/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/server/without required properties.json b/test/bindings/kafka/0.5.0/server/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/kafka/0.5.0/server/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/kafka/0.5.0/server/wrongly extended.json b/test/bindings/kafka/0.5.0/server/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/kafka/0.5.0/server/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/kafka/kafka channel binding.test.mjs b/test/bindings/kafka/kafka channel binding.test.mjs new file mode 100644 index 00000000..cf3126bf --- /dev/null +++ b/test/bindings/kafka/kafka channel binding.test.mjs @@ -0,0 +1,125 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.3.0": new JsonSchemaTestSuiteData( + require(`@bindings/kafka/0.3.0/channel.json`), + [ + { + "topic": "my-specific-topic", + "partitions": 20, + "replicas": 3 + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.4.0": new JsonSchemaTestSuiteData( + require(`@bindings/kafka/0.4.0/channel.json`), + [ + { + "topic": "my-specific-topic-name", + "partitions": 20, + "replicas": 3, + "topicConfiguration": { + "cleanup.policy": [ + "delete", + "compact" + ], + "retention.ms": 604800000, + "retention.bytes": 1000000000, + "delete.retention.ms": 86400000, + "max.message.bytes": 1048588 + } + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.5.0": new JsonSchemaTestSuiteData( + require(`@bindings/kafka/0.5.0/channel.json`), + [ + { + "topic": "my-specific-topic-name", + "partitions": 20, + "replicas": 3, + "topicConfiguration": { + "cleanup.policy": [ + "delete", + "compact" + ], + "retention.ms": 604800000, + "retention.bytes": 1000000000, + "delete.retention.ms": 86400000, + "max.message.bytes": 1048588 + } + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.3.0', + '0.4.0', + '0.5.0', +])('Kafka channel binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/kafka/kafka message binding.test.mjs b/test/bindings/kafka/kafka message binding.test.mjs new file mode 100644 index 00000000..083f3411 --- /dev/null +++ b/test/bindings/kafka/kafka message binding.test.mjs @@ -0,0 +1,154 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.1.0": new JsonSchemaTestSuiteData( + require(`@bindings/kafka/0.1.0/message.json`), + [ + { + "key": { + "type": "string", + "enum": [ + "myKey" + ] + } + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.3.0": new JsonSchemaTestSuiteData( + require(`@bindings/kafka/0.3.0/message.json`), + [ + { + "key": { + "type": "string", + "enum": [ + "myKey" + ] + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "apicurio-new", + "schemaLookupStrategy": "TopicIdStrategy" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.4.0": new JsonSchemaTestSuiteData( + require(`@bindings/kafka/0.4.0/message.json`), + [ + { + "key": { + "type": "string", + "enum": [ + "myKey" + ] + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "apicurio-new", + "schemaLookupStrategy": "TopicIdStrategy" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.5.0": new JsonSchemaTestSuiteData( + require(`@bindings/kafka/0.5.0/message.json`), + [ + { + "key": { + "type": "string", + "enum": [ + "myKey" + ] + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "apicurio-new", + "schemaLookupStrategy": "TopicIdStrategy" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.1.0', + '0.3.0', + '0.4.0', + '0.5.0', +])('Kafka message binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/kafka/kafka operation binding.test.mjs b/test/bindings/kafka/kafka operation binding.test.mjs new file mode 100644 index 00000000..0dc031e3 --- /dev/null +++ b/test/bindings/kafka/kafka operation binding.test.mjs @@ -0,0 +1,169 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.1.0": new JsonSchemaTestSuiteData( + require(`@bindings/kafka/0.1.0/operation.json`), + [ + { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + } + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.3.0": new JsonSchemaTestSuiteData( + require(`@bindings/kafka/0.3.0/operation.json`), + [ + { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + } + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.4.0": new JsonSchemaTestSuiteData( + require(`@bindings/kafka/0.4.0/operation.json`), + [ + { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + } + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.5.0": new JsonSchemaTestSuiteData( + require(`@bindings/kafka/0.5.0/operation.json`), + [ + { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + } + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.1.0', + '0.3.0', + '0.4.0', + '0.5.0', +])('Kafka operation binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/kafka/kafka server binding.test.mjs b/test/bindings/kafka/kafka server binding.test.mjs new file mode 100644 index 00000000..6e59a3ea --- /dev/null +++ b/test/bindings/kafka/kafka server binding.test.mjs @@ -0,0 +1,102 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.3.0": new JsonSchemaTestSuiteData( + require(`@bindings/kafka/0.3.0/server.json`), + [ + { + "schemaRegistryUrl": "https://my-schema-registry.com", + "schemaRegistryVendor": "confluent" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.4.0": new JsonSchemaTestSuiteData( + require(`@bindings/kafka/0.4.0/server.json`), + [ + { + "schemaRegistryUrl": "https://my-schema-registry.com", + "schemaRegistryVendor": "confluent" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.5.0": new JsonSchemaTestSuiteData( + require(`@bindings/kafka/0.5.0/server.json`), + [ + { + "schemaRegistryUrl": "https://my-schema-registry.com", + "schemaRegistryVendor": "confluent" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.3.0', + '0.4.0', + '0.5.0', +])('Kafka operation binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/kafka/kafka.test.mjs b/test/bindings/kafka/kafka.test.mjs deleted file mode 100644 index e4d5ef58..00000000 --- a/test/bindings/kafka/kafka.test.mjs +++ /dev/null @@ -1,148 +0,0 @@ -import {it} from 'vitest'; -import TestHelper from '@test/test-helper.mjs'; -import path from 'path'; - -describe.each([ - '0.1.0', - '0.3.0', - '0.4.0', - '0.5.0', -])('Kafka bindings v%s', async (bindingVersion) => { - - const channelSchema = bindingVersion === '0.1.0' - ? null - : await import(`@bindings/kafka/${bindingVersion}/channel.json`); - const messageSchema = await import(`@bindings/kafka/${bindingVersion}/message.json`); - const operationSchema = await import(`@bindings/kafka/${bindingVersion}/operation.json`); - const serverSchema = bindingVersion === '0.1.0' - ? null - : await import(`@bindings/kafka/${bindingVersion}/server.json`); - - describe.skipIf(bindingVersion === '0.1.0')('channel', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - channelSchema, - {}, - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/wrongly extended.json`), - )); - }) - - describe('message', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - messageSchema, - {} - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/wrongly extended.json`), - )); - }) - - describe('operation', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - operationSchema, - {} - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/wrongly extended.json`), - )); - }) - - describe.skipIf(bindingVersion === '0.1.0')('server', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - serverSchema, - {} - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/wrongly extended.json`), - )); - }) -}) \ No newline at end of file diff --git a/test/bindings/mqtt/0.1.0/message/example.json b/test/bindings/mqtt/0.1.0/message/example.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/mqtt/0.1.0/message/example.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/mqtt/0.1.0/message/extended.json b/test/bindings/mqtt/0.1.0/message/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/mqtt/0.1.0/message/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/mqtt/0.1.0/message/only required properties.json b/test/bindings/mqtt/0.1.0/message/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/mqtt/0.1.0/message/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/mqtt/0.1.0/message/without required properties.json b/test/bindings/mqtt/0.1.0/message/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/mqtt/0.1.0/message/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/mqtt/0.1.0/message/wrongly extended.json b/test/bindings/mqtt/0.1.0/message/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/mqtt/0.1.0/message/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/mqtt/0.1.0/operation/example.json b/test/bindings/mqtt/0.1.0/operation/example.json deleted file mode 100644 index f1774992..00000000 --- a/test/bindings/mqtt/0.1.0/operation/example.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "qos": 2, - "retain": true -} \ No newline at end of file diff --git a/test/bindings/mqtt/0.1.0/operation/extended.json b/test/bindings/mqtt/0.1.0/operation/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/mqtt/0.1.0/operation/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/mqtt/0.1.0/operation/only required properties.json b/test/bindings/mqtt/0.1.0/operation/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/mqtt/0.1.0/operation/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/mqtt/0.1.0/operation/without required properties.json b/test/bindings/mqtt/0.1.0/operation/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/mqtt/0.1.0/operation/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/mqtt/0.1.0/operation/wrongly extended.json b/test/bindings/mqtt/0.1.0/operation/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/mqtt/0.1.0/operation/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/mqtt/0.1.0/server/example.json b/test/bindings/mqtt/0.1.0/server/example.json deleted file mode 100644 index 6a5958b6..00000000 --- a/test/bindings/mqtt/0.1.0/server/example.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "clientId": "guest", - "cleanSession": true, - "lastWill": { - "topic": "/last-wills", - "qos": 2, - "message": "Guest gone offline.", - "retain": false - }, - "keepAlive": 60 -} \ No newline at end of file diff --git a/test/bindings/mqtt/0.1.0/server/extended.json b/test/bindings/mqtt/0.1.0/server/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/mqtt/0.1.0/server/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/mqtt/0.1.0/server/only required properties.json b/test/bindings/mqtt/0.1.0/server/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/mqtt/0.1.0/server/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/mqtt/0.1.0/server/without required properties.json b/test/bindings/mqtt/0.1.0/server/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/mqtt/0.1.0/server/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/mqtt/0.1.0/server/wrongly extended.json b/test/bindings/mqtt/0.1.0/server/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/mqtt/0.1.0/server/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/mqtt/0.2.0/message/example.json b/test/bindings/mqtt/0.2.0/message/example.json deleted file mode 100644 index 54cee00c..00000000 --- a/test/bindings/mqtt/0.2.0/message/example.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "contentType": "application/json", - "correlationData": { - "type": "string", - "format": "uuid" - }, - "responseTopic": "application/responses" -} \ No newline at end of file diff --git a/test/bindings/mqtt/0.2.0/message/extended.json b/test/bindings/mqtt/0.2.0/message/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/mqtt/0.2.0/message/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/mqtt/0.2.0/message/only required properties.json b/test/bindings/mqtt/0.2.0/message/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/mqtt/0.2.0/message/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/mqtt/0.2.0/message/without required properties.json b/test/bindings/mqtt/0.2.0/message/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/mqtt/0.2.0/message/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/mqtt/0.2.0/message/wrongly extended.json b/test/bindings/mqtt/0.2.0/message/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/mqtt/0.2.0/message/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/mqtt/0.2.0/operation/example.json b/test/bindings/mqtt/0.2.0/operation/example.json deleted file mode 100644 index d754209c..00000000 --- a/test/bindings/mqtt/0.2.0/operation/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "qos": 2, - "retain": true, - "messageExpiryInterval": 60 -} \ No newline at end of file diff --git a/test/bindings/mqtt/0.2.0/operation/extended.json b/test/bindings/mqtt/0.2.0/operation/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/mqtt/0.2.0/operation/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/mqtt/0.2.0/operation/only required properties.json b/test/bindings/mqtt/0.2.0/operation/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/mqtt/0.2.0/operation/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/mqtt/0.2.0/operation/without required properties.json b/test/bindings/mqtt/0.2.0/operation/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/mqtt/0.2.0/operation/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/mqtt/0.2.0/operation/wrongly extended.json b/test/bindings/mqtt/0.2.0/operation/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/mqtt/0.2.0/operation/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/mqtt/0.2.0/server/example.json b/test/bindings/mqtt/0.2.0/server/example.json deleted file mode 100644 index ee70de36..00000000 --- a/test/bindings/mqtt/0.2.0/server/example.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "clientId": "guest", - "cleanSession": true, - "lastWill": { - "topic": "/last-wills", - "qos": 2, - "message": "Guest gone offline.", - "retain": false - }, - "keepAlive": 60, - "sessionExpiryInterval": 120, - "maximumPacketSize": 1024 -} \ No newline at end of file diff --git a/test/bindings/mqtt/0.2.0/server/extended.json b/test/bindings/mqtt/0.2.0/server/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/mqtt/0.2.0/server/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/mqtt/0.2.0/server/only required properties.json b/test/bindings/mqtt/0.2.0/server/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/mqtt/0.2.0/server/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/mqtt/0.2.0/server/without required properties.json b/test/bindings/mqtt/0.2.0/server/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/mqtt/0.2.0/server/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/mqtt/0.2.0/server/wrongly extended.json b/test/bindings/mqtt/0.2.0/server/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/mqtt/0.2.0/server/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/mqtt/mqtt message binding.test.mjs b/test/bindings/mqtt/mqtt message binding.test.mjs new file mode 100644 index 00000000..ef791fc3 --- /dev/null +++ b/test/bindings/mqtt/mqtt message binding.test.mjs @@ -0,0 +1,77 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.1.0": new JsonSchemaTestSuiteData( + require(`@bindings/mqtt/0.1.0/message.json`), + [ + {} + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.2.0": new JsonSchemaTestSuiteData( + require(`@bindings/mqtt/0.2.0/message.json`), + [ + { + "contentType": "application/json", + "correlationData": { + "type": "string", + "format": "uuid" + }, + "responseTopic": "application/responses", + "bindingVersion": "0.2.0" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.1.0', + '0.2.0', +])('MQTT message binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/mqtt/mqtt operation binding.test.mjs b/test/bindings/mqtt/mqtt operation binding.test.mjs new file mode 100644 index 00000000..921196e5 --- /dev/null +++ b/test/bindings/mqtt/mqtt operation binding.test.mjs @@ -0,0 +1,76 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.1.0": new JsonSchemaTestSuiteData( + require(`@bindings/mqtt/0.1.0/operation.json`), + [ + { + "qos": 2, + "retain": true + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.2.0": new JsonSchemaTestSuiteData( + require(`@bindings/mqtt/0.2.0/operation.json`), + [ + { + "qos": 2, + "retain": true, + "messageExpiryInterval": 60 + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.1.0', + '0.2.0', +])('MQTT operation binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/mqtt/mqtt server binding.test.mjs b/test/bindings/mqtt/mqtt server binding.test.mjs new file mode 100644 index 00000000..4cb89151 --- /dev/null +++ b/test/bindings/mqtt/mqtt server binding.test.mjs @@ -0,0 +1,91 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.1.0": new JsonSchemaTestSuiteData( + require(`@bindings/mqtt/0.1.0/server.json`), + [ + { + "clientId": "guest", + "cleanSession": true, + "lastWill": { + "topic": "/last-wills", + "qos": 2, + "message": "Guest gone offline.", + "retain": false + }, + "keepAlive": 60 + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.2.0": new JsonSchemaTestSuiteData( + require(`@bindings/mqtt/0.2.0/server.json`), + [ + { + "clientId": "guest", + "cleanSession": true, + "lastWill": { + "topic": "/last-wills", + "qos": 2, + "message": "Guest gone offline.", + "retain": false + }, + "keepAlive": 60, + "sessionExpiryInterval": 120, + "maximumPacketSize": 1024 + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.1.0', + '0.2.0', +])('MQTT server binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/mqtt/mqtt.test.mjs b/test/bindings/mqtt/mqtt.test.mjs deleted file mode 100644 index 33e4da7e..00000000 --- a/test/bindings/mqtt/mqtt.test.mjs +++ /dev/null @@ -1,109 +0,0 @@ -import {it} from 'vitest'; -import TestHelper from '@test/test-helper.mjs'; -import path from 'path'; - -describe.each([ - '0.1.0', - '0.2.0' -])('MQTT bindings v%s', async (bindingVersion) => { - - const messageSchema = await import(`@bindings/mqtt/${bindingVersion}/message.json`); - const operationSchema = await import(`@bindings/mqtt/${bindingVersion}/operation.json`); - const serverSchema = await import(`@bindings/mqtt/${bindingVersion}/server.json`); - - describe('message', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - messageSchema, - {} - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - messageSchema, - path.resolve(__dirname, `./${bindingVersion}/message/wrongly extended.json`), - )); - }) - - describe('operation', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - operationSchema, - {} - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/wrongly extended.json`), - )); - }) - - describe('server', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - serverSchema, - {} - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/wrongly extended.json`), - )); - }) -}) \ No newline at end of file diff --git a/test/bindings/nats/0.1.0/operation/example.json b/test/bindings/nats/0.1.0/operation/example.json deleted file mode 100644 index 136049ac..00000000 --- a/test/bindings/nats/0.1.0/operation/example.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "queue": "messages" -} \ No newline at end of file diff --git a/test/bindings/nats/0.1.0/operation/extended.json b/test/bindings/nats/0.1.0/operation/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/nats/0.1.0/operation/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/nats/0.1.0/operation/only required properties.json b/test/bindings/nats/0.1.0/operation/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/nats/0.1.0/operation/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/nats/0.1.0/operation/without required properties.json b/test/bindings/nats/0.1.0/operation/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/nats/0.1.0/operation/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/nats/0.1.0/operation/wrongly extended.json b/test/bindings/nats/0.1.0/operation/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/nats/0.1.0/operation/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/nats/nats operation binding.test.mjs b/test/bindings/nats/nats operation binding.test.mjs new file mode 100644 index 00000000..5c801a61 --- /dev/null +++ b/test/bindings/nats/nats operation binding.test.mjs @@ -0,0 +1,47 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.1.0": new JsonSchemaTestSuiteData( + require(`@bindings/nats/0.1.0/operation.json`), + [ + { + "queue": "messages" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.1.0', +])('NATS operation binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/nats/nats.test.mjs b/test/bindings/nats/nats.test.mjs deleted file mode 100644 index ecb4ce52..00000000 --- a/test/bindings/nats/nats.test.mjs +++ /dev/null @@ -1,43 +0,0 @@ -import {it} from 'vitest'; -import TestHelper from '@test/test-helper.mjs'; -import path from 'path'; - -describe.each([ - '0.1.0', -])('NATS bindings v%s', async (bindingVersion) => { - - const operationSchema = await import(`@bindings/nats/${bindingVersion}/operation.json`); - - describe('operation', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - operationSchema, - {} - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/wrongly extended.json`), - )); - }) - -}) \ No newline at end of file diff --git a/test/bindings/pulsar/0.1.0/channel/example.json b/test/bindings/pulsar/0.1.0/channel/example.json deleted file mode 100644 index 11186640..00000000 --- a/test/bindings/pulsar/0.1.0/channel/example.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "namespace": "staging", - "persistence": "persistent", - "compaction": 1000, - "geo-replication": [ - "us-east1", - "us-west1" - ], - "retention": { - "time": 7, - "size": 1000 - }, - "ttl": 360, - "deduplication": false -} \ No newline at end of file diff --git a/test/bindings/pulsar/0.1.0/channel/extended.json b/test/bindings/pulsar/0.1.0/channel/extended.json deleted file mode 100644 index 0ffd0881..00000000 --- a/test/bindings/pulsar/0.1.0/channel/extended.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "namespace": "staging", - "persistence": "persistent", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/pulsar/0.1.0/channel/only required properties.json b/test/bindings/pulsar/0.1.0/channel/only required properties.json deleted file mode 100644 index 293b0c6d..00000000 --- a/test/bindings/pulsar/0.1.0/channel/only required properties.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "namespace": "staging", - "persistence": "persistent" -} \ No newline at end of file diff --git a/test/bindings/pulsar/0.1.0/channel/without required properties.json b/test/bindings/pulsar/0.1.0/channel/without required properties.json deleted file mode 100644 index 4ef738d3..00000000 --- a/test/bindings/pulsar/0.1.0/channel/without required properties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compaction": 1000, - "geo-replication": [ - "us-east1", - "us-west1" - ], - "retention": { - "time": 7, - "size": 1000 - }, - "ttl": 360, - "deduplication": false -} \ No newline at end of file diff --git a/test/bindings/pulsar/0.1.0/channel/wrongly extended.json b/test/bindings/pulsar/0.1.0/channel/wrongly extended.json deleted file mode 100644 index e20fcdd1..00000000 --- a/test/bindings/pulsar/0.1.0/channel/wrongly extended.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "namespace": "staging", - "persistence": "persistent", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/pulsar/0.1.0/server/example.json b/test/bindings/pulsar/0.1.0/server/example.json deleted file mode 100644 index b741b501..00000000 --- a/test/bindings/pulsar/0.1.0/server/example.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "tenant": "contoso" -} \ No newline at end of file diff --git a/test/bindings/pulsar/0.1.0/server/extended.json b/test/bindings/pulsar/0.1.0/server/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/pulsar/0.1.0/server/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/pulsar/0.1.0/server/only required properties.json b/test/bindings/pulsar/0.1.0/server/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/pulsar/0.1.0/server/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/pulsar/0.1.0/server/without required properties.json b/test/bindings/pulsar/0.1.0/server/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/pulsar/0.1.0/server/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/pulsar/0.1.0/server/wrongly extended.json b/test/bindings/pulsar/0.1.0/server/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/pulsar/0.1.0/server/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/pulsar/pulsar channel binding.test.mjs b/test/bindings/pulsar/pulsar channel binding.test.mjs new file mode 100644 index 00000000..22cbb356 --- /dev/null +++ b/test/bindings/pulsar/pulsar channel binding.test.mjs @@ -0,0 +1,69 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + true, + [ + 'must have required property \'namespace\'', + 'must have required property \'persistence\'', + ], + true, + [] +); + +let data = { + "0.1.0": new JsonSchemaTestSuiteData( + require(`@bindings/pulsar/0.1.0/channel.json`), + [ + { + "namespace": "staging", + "persistence": "persistent", + "compaction": 1000, + "geo-replication": [ + "us-east1", + "us-west1" + ], + "retention": { + "time": 7, + "size": 1000 + }, + "ttl": 360, + "deduplication": false + } + ], + { + "namespace": "staging", + "persistence": "persistent" + }, + {}, + { + "namespace": "staging", + "persistence": "persistent", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "namespace": "staging", + "persistence": "persistent", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.1.0', +])('Pulsar channel binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/pulsar/pulsar server binding.test.mjs b/test/bindings/pulsar/pulsar server binding.test.mjs new file mode 100644 index 00000000..94083769 --- /dev/null +++ b/test/bindings/pulsar/pulsar server binding.test.mjs @@ -0,0 +1,47 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.1.0": new JsonSchemaTestSuiteData( + require(`@bindings/pulsar/0.1.0/server.json`), + [ + { + "tenant": "contoso" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.1.0', +])('Pulsar server binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/pulsar/pulsar.test.mjs b/test/bindings/pulsar/pulsar.test.mjs deleted file mode 100644 index c2d4c5fa..00000000 --- a/test/bindings/pulsar/pulsar.test.mjs +++ /dev/null @@ -1,84 +0,0 @@ -import {it} from 'vitest'; -import TestHelper from '@test/test-helper.mjs'; -import path from 'path'; - -describe.each([ - '0.1.0', -])('Pulsar bindings v%s', async (bindingVersion) => { - - const channelSchema = await import(`@bindings/pulsar/${bindingVersion}/channel.json`); - const serverSchema = await import(`@bindings/pulsar/${bindingVersion}/server.json`); - - describe('channel', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/example.json`), - )); - - it(TestHelper.cannotBeEmptyTestName, () => TestHelper.objectIsNotValid( - channelSchema, - {}, - [ - 'must have required property \'namespace\'', - 'must have required property \'persistence\'' - ] - )); - - it(TestHelper.isNotValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsNotValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/without required properties.json`), - [ - 'must have required property \'namespace\'', - 'must have required property \'persistence\'' - ] - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/wrongly extended.json`), - )); - }) - - describe('server', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - serverSchema, - {} - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/wrongly extended.json`), - )); - }) - -}) \ No newline at end of file diff --git a/test/bindings/sns/0.1.0/channel/example.json b/test/bindings/sns/0.1.0/channel/example.json deleted file mode 100644 index 8b95c79c..00000000 --- a/test/bindings/sns/0.1.0/channel/example.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "my-sns-topic", - "policy": { - "statements": [ - { - "effect": "Allow", - "principal": "*", - "action": "SNS:Publish" - } - ] - } -} \ No newline at end of file diff --git a/test/bindings/sns/0.1.0/channel/extended.json b/test/bindings/sns/0.1.0/channel/extended.json deleted file mode 100644 index 6cdc519f..00000000 --- a/test/bindings/sns/0.1.0/channel/extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "my-sns-topic", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/sns/0.1.0/channel/only required properties.json b/test/bindings/sns/0.1.0/channel/only required properties.json deleted file mode 100644 index 469b264c..00000000 --- a/test/bindings/sns/0.1.0/channel/only required properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "my-sns-topic" -} \ No newline at end of file diff --git a/test/bindings/sns/0.1.0/channel/without required properties.json b/test/bindings/sns/0.1.0/channel/without required properties.json deleted file mode 100644 index a7d95b5f..00000000 --- a/test/bindings/sns/0.1.0/channel/without required properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "policy": { - "statements": [ - { - "effect": "Allow", - "principal": "*", - "action": "SNS:Publish" - } - ] - } -} \ No newline at end of file diff --git a/test/bindings/sns/0.1.0/channel/wrongly extended.json b/test/bindings/sns/0.1.0/channel/wrongly extended.json deleted file mode 100644 index 19330618..00000000 --- a/test/bindings/sns/0.1.0/channel/wrongly extended.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "my-sns-topic", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/sns/0.1.0/operation/example.json b/test/bindings/sns/0.1.0/operation/example.json deleted file mode 100644 index 756aadbe..00000000 --- a/test/bindings/sns/0.1.0/operation/example.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "topic": { - "name": "someTopic" - }, - "consumers": [ - { - "protocol": "sqs", - "endpoint": { - "name": "someQueue" - }, - "filterPolicy": { - "store": [ - "asyncapi_corp" - ], - "event": [ - { - "anything-but": "order_cancelled" - } - ], - "customer_interests": [ - "rugby", - "football", - "baseball" - ] - }, - "filterPolicyScope": "MessageAttributes", - "rawMessageDelivery": false, - "redrivePolicy": { - "deadLetterQueue": { - "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" - }, - "maxReceiveCount": 25 - }, - "deliveryPolicy": { - "minDelayTarget": 10, - "maxDelayTarget": 100, - "numRetries": 5, - "numNoDelayRetries": 2, - "numMinDelayRetries": 3, - "numMaxDelayRetries": 5, - "backoffFunction": "linear", - "maxReceivesPerSecond": 2 - } - } - ] -} \ No newline at end of file diff --git a/test/bindings/sns/0.1.0/operation/extended.json b/test/bindings/sns/0.1.0/operation/extended.json deleted file mode 100644 index 49dc794b..00000000 --- a/test/bindings/sns/0.1.0/operation/extended.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "consumers": [ - { - "protocol": "sqs", - "endpoint": { - "name": "someQueue" - }, - "filterPolicy": { - "store": [ - "asyncapi_corp" - ], - "event": [ - { - "anything-but": "order_cancelled" - } - ], - "customer_interests": [ - "rugby", - "football", - "baseball" - ] - }, - "filterPolicyScope": "MessageAttributes", - "rawMessageDelivery": false, - "redrivePolicy": { - "deadLetterQueue": { - "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" - }, - "maxReceiveCount": 25 - }, - "deliveryPolicy": { - "minDelayTarget": 10, - "maxDelayTarget": 100, - "numRetries": 5, - "numNoDelayRetries": 2, - "numMinDelayRetries": 3, - "numMaxDelayRetries": 5, - "backoffFunction": "linear", - "maxReceivesPerSecond": 2 - } - } - ], - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/sns/0.1.0/operation/only required properties.json b/test/bindings/sns/0.1.0/operation/only required properties.json deleted file mode 100644 index 24301f0a..00000000 --- a/test/bindings/sns/0.1.0/operation/only required properties.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "consumers": [ - { - "protocol": "sqs", - "endpoint": { - "name": "someQueue" - }, - "filterPolicy": { - "store": [ - "asyncapi_corp" - ], - "event": [ - { - "anything-but": "order_cancelled" - } - ], - "customer_interests": [ - "rugby", - "football", - "baseball" - ] - }, - "filterPolicyScope": "MessageAttributes", - "rawMessageDelivery": false, - "redrivePolicy": { - "deadLetterQueue": { - "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" - }, - "maxReceiveCount": 25 - }, - "deliveryPolicy": { - "minDelayTarget": 10, - "maxDelayTarget": 100, - "numRetries": 5, - "numNoDelayRetries": 2, - "numMinDelayRetries": 3, - "numMaxDelayRetries": 5, - "backoffFunction": "linear", - "maxReceivesPerSecond": 2 - } - } - ] -} \ No newline at end of file diff --git a/test/bindings/sns/0.1.0/operation/without required properties.json b/test/bindings/sns/0.1.0/operation/without required properties.json deleted file mode 100644 index 0172ffa1..00000000 --- a/test/bindings/sns/0.1.0/operation/without required properties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "topic": { - "name": "someTopic" - } -} \ No newline at end of file diff --git a/test/bindings/sns/0.1.0/operation/wrongly extended.json b/test/bindings/sns/0.1.0/operation/wrongly extended.json deleted file mode 100644 index 9183f4cd..00000000 --- a/test/bindings/sns/0.1.0/operation/wrongly extended.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "consumers": [ - { - "protocol": "sqs", - "endpoint": { - "name": "someQueue" - }, - "filterPolicy": { - "store": [ - "asyncapi_corp" - ], - "event": [ - { - "anything-but": "order_cancelled" - } - ], - "customer_interests": [ - "rugby", - "football", - "baseball" - ] - }, - "filterPolicyScope": "MessageAttributes", - "rawMessageDelivery": false, - "redrivePolicy": { - "deadLetterQueue": { - "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" - }, - "maxReceiveCount": 25 - }, - "deliveryPolicy": { - "minDelayTarget": 10, - "maxDelayTarget": 100, - "numRetries": 5, - "numNoDelayRetries": 2, - "numMinDelayRetries": 3, - "numMaxDelayRetries": 5, - "backoffFunction": "linear", - "maxReceivesPerSecond": 2 - } - } - ], - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/sns/sns channel binding.test.mjs b/test/bindings/sns/sns channel binding.test.mjs new file mode 100644 index 00000000..dfe0447f --- /dev/null +++ b/test/bindings/sns/sns channel binding.test.mjs @@ -0,0 +1,62 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + true, + [ + 'must have required property \'name\'', + ], + true, + [] +); + +let data = { + "0.1.0": new JsonSchemaTestSuiteData( + require(`@bindings/sns/0.1.0/channel.json`), + [ + { + "name": "my-sns-topic", + "policy": { + "statements": [ + { + "effect": "Allow", + "principal": "*", + "action": "SNS:Publish" + } + ] + } + } + ], + { + "name": "my-sns-topic" + }, + {}, + { + "name": "my-sns-topic", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "name": "my-sns-topic", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.1.0', +])('Amazon SNS channel binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/sns/sns operation binding.test.mjs b/test/bindings/sns/sns operation binding.test.mjs new file mode 100644 index 00000000..b33dec22 --- /dev/null +++ b/test/bindings/sns/sns operation binding.test.mjs @@ -0,0 +1,108 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + true, + [ + 'must have required property \'consumers\'', + ], + true, + [] +); + +let data = { + "0.1.0": new JsonSchemaTestSuiteData( + require(`@bindings/sns/0.1.0/operation.json`), + [ + { + "topic": { + "name": "someTopic" + }, + "consumers": [ + { + "protocol": "sqs", + "endpoint": { + "name": "someQueue" + }, + "filterPolicyScope": "MessageAttributes", + "rawMessageDelivery": false, + "redrivePolicy": { + "deadLetterQueue": { + "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + "maxReceiveCount": 25 + }, + "deliveryPolicy": { + "minDelayTarget": 10, + "maxDelayTarget": 100, + "numRetries": 5, + "numNoDelayRetries": 2, + "numMinDelayRetries": 3, + "numMaxDelayRetries": 5, + "backoffFunction": "linear", + "maxReceivesPerSecond": 2 + } + } + ] + } + ], + { + "consumers": [ + { + "protocol": "sqs", + "endpoint": { + "name": "someQueue" + }, + "filterPolicyScope": "MessageAttributes", + "rawMessageDelivery": false, + } + ] + }, + {}, + { + "consumers": [ + { + "protocol": "sqs", + "endpoint": { + "name": "someQueue" + }, + "filterPolicyScope": "MessageAttributes", + "rawMessageDelivery": false, + } + ], + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "consumers": [ + { + "protocol": "sqs", + "endpoint": { + "name": "someQueue" + }, + "filterPolicyScope": "MessageAttributes", + "rawMessageDelivery": false, + } + ], + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.1.0', +])('Amazon SNS operation binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/sns/sns.test.mjs b/test/bindings/sns/sns.test.mjs deleted file mode 100644 index 78afd6dc..00000000 --- a/test/bindings/sns/sns.test.mjs +++ /dev/null @@ -1,84 +0,0 @@ -import {it} from 'vitest'; -import TestHelper from '@test/test-helper.mjs'; -import path from 'path'; - -describe.each([ - '0.1.0', -])('SNS bindings v%s', async (bindingVersion) => { - - const channelSchema = await import(`@bindings/sns/${bindingVersion}/channel.json`); - const operationSchema = await import(`@bindings/sns/${bindingVersion}/operation.json`); - - describe('channel', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/example.json`), - )); - - it(TestHelper.cannotBeEmptyTestName, () => TestHelper.objectIsNotValid( - channelSchema, - {}, - [ - 'must have required property \'name\'', - ] - )); - - it(TestHelper.isNotValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsNotValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/without required properties.json`), - [ - 'must have required property \'name\'', - ] - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/wrongly extended.json`), - )); - }) - - describe.skip('operation has wrong example in schema', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/example.json`), - )); - - it(TestHelper.cannotBeEmptyTestName, () => TestHelper.objectIsNotValid( - operationSchema, - {}, - ['must have required property \'consumers\''] - )); - - it(TestHelper.isNotValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsNotValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/without required properties.json`), - ['must have required property \'consumers\''] - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/wrongly extended.json`), - )); - }) - -}) \ No newline at end of file diff --git a/test/bindings/solace/0.2.0/operation/example.json b/test/bindings/solace/0.2.0/operation/example.json deleted file mode 100644 index 7032e2d6..00000000 --- a/test/bindings/solace/0.2.0/operation/example.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "destinations": [ - { - "destinationType": "queue", - "queue": { - "name": "CreatedHREvents", - "topicSubscriptions": [ - "person/*/created" - ], - "accessType": "exclusive" - } - }, - { - "destinationType": "topic", - "topicSubscriptions": [ - "person/*/updated" - ] - } - ] -} \ No newline at end of file diff --git a/test/bindings/solace/0.2.0/operation/extended.json b/test/bindings/solace/0.2.0/operation/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/solace/0.2.0/operation/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/solace/0.2.0/operation/only required properties.json b/test/bindings/solace/0.2.0/operation/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/solace/0.2.0/operation/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/solace/0.2.0/operation/without required properties.json b/test/bindings/solace/0.2.0/operation/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/solace/0.2.0/operation/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/solace/0.2.0/operation/wrongly extended.json b/test/bindings/solace/0.2.0/operation/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/solace/0.2.0/operation/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/solace/0.2.0/server/example.json b/test/bindings/solace/0.2.0/server/example.json deleted file mode 100644 index 757ce876..00000000 --- a/test/bindings/solace/0.2.0/server/example.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "msvVpn": "solace.private.net" -} \ No newline at end of file diff --git a/test/bindings/solace/0.2.0/server/extended.json b/test/bindings/solace/0.2.0/server/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/solace/0.2.0/server/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/solace/0.2.0/server/only required properties.json b/test/bindings/solace/0.2.0/server/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/solace/0.2.0/server/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/solace/0.2.0/server/without required properties.json b/test/bindings/solace/0.2.0/server/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/solace/0.2.0/server/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/solace/0.2.0/server/wrongly extended.json b/test/bindings/solace/0.2.0/server/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/solace/0.2.0/server/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/solace/0.3.0/operation/example.json b/test/bindings/solace/0.3.0/operation/example.json deleted file mode 100644 index e29bb893..00000000 --- a/test/bindings/solace/0.3.0/operation/example.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "destinations": [ - { - "destinationType": "queue", - "queue": { - "name": "CreatedHREvents", - "topicSubscriptions": [ - "person/*/created" - ], - "accessType": "exclusive", - "maxMsgSpoolSize": "1,500", - "maxTtl": "60" - } - }, - { - "destinationType": "topic", - "topicSubscriptions": [ - "person/*/updated" - ] - } - ] -} \ No newline at end of file diff --git a/test/bindings/solace/0.3.0/operation/extended.json b/test/bindings/solace/0.3.0/operation/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/solace/0.3.0/operation/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/solace/0.3.0/operation/only required properties.json b/test/bindings/solace/0.3.0/operation/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/solace/0.3.0/operation/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/solace/0.3.0/operation/without required properties.json b/test/bindings/solace/0.3.0/operation/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/solace/0.3.0/operation/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/solace/0.3.0/operation/wrongly extended.json b/test/bindings/solace/0.3.0/operation/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/solace/0.3.0/operation/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/solace/0.3.0/server/example.json b/test/bindings/solace/0.3.0/server/example.json deleted file mode 100644 index a479ad3a..00000000 --- a/test/bindings/solace/0.3.0/server/example.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "msgVpn": "solace.private.net" -} \ No newline at end of file diff --git a/test/bindings/solace/0.3.0/server/extended.json b/test/bindings/solace/0.3.0/server/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/solace/0.3.0/server/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/solace/0.3.0/server/only required properties.json b/test/bindings/solace/0.3.0/server/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/solace/0.3.0/server/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/solace/0.3.0/server/without required properties.json b/test/bindings/solace/0.3.0/server/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/solace/0.3.0/server/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/solace/0.3.0/server/wrongly extended.json b/test/bindings/solace/0.3.0/server/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/solace/0.3.0/server/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/solace/0.4.0/operation/example.json b/test/bindings/solace/0.4.0/operation/example.json deleted file mode 100644 index 2048d271..00000000 --- a/test/bindings/solace/0.4.0/operation/example.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "destinations": [ - { - "destinationType": "queue", - "queue": { - "name": "sampleQueue", - "topicSubscriptions": [ - "samples/*" - ], - "accessType": "nonexclusive" - } - }, - { - "destinationType": "topic", - "topicSubscriptions": [ - "samples/*" - ] - } - ] -} \ No newline at end of file diff --git a/test/bindings/solace/0.4.0/operation/extended.json b/test/bindings/solace/0.4.0/operation/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/solace/0.4.0/operation/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/solace/0.4.0/operation/only required properties.json b/test/bindings/solace/0.4.0/operation/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/solace/0.4.0/operation/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/solace/0.4.0/operation/without required properties.json b/test/bindings/solace/0.4.0/operation/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/solace/0.4.0/operation/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/solace/0.4.0/operation/wrongly extended.json b/test/bindings/solace/0.4.0/operation/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/solace/0.4.0/operation/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/solace/0.4.0/server/example.json b/test/bindings/solace/0.4.0/server/example.json deleted file mode 100644 index e0d027bb..00000000 --- a/test/bindings/solace/0.4.0/server/example.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "clientName": "transactions-broker", - "msgVpn": "ProdVPN" -} \ No newline at end of file diff --git a/test/bindings/solace/0.4.0/server/extended.json b/test/bindings/solace/0.4.0/server/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/solace/0.4.0/server/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/solace/0.4.0/server/only required properties.json b/test/bindings/solace/0.4.0/server/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/solace/0.4.0/server/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/solace/0.4.0/server/without required properties.json b/test/bindings/solace/0.4.0/server/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/solace/0.4.0/server/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/solace/0.4.0/server/wrongly extended.json b/test/bindings/solace/0.4.0/server/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/solace/0.4.0/server/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/solace/solace operation binding.test.mjs b/test/bindings/solace/solace operation binding.test.mjs new file mode 100644 index 00000000..92529b8f --- /dev/null +++ b/test/bindings/solace/solace operation binding.test.mjs @@ -0,0 +1,152 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.2.0": new JsonSchemaTestSuiteData( + require(`@bindings/solace/0.2.0/operation.json`), + [ + { + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "CreatedHREvents", + "topicSubscriptions": [ + "person/*/created" + ], + "accessType": "exclusive" + } + }, + { + "destinationType": "topic", + "topicSubscriptions": [ + "person/*/updated" + ] + } + ] + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.3.0": new JsonSchemaTestSuiteData( + require(`@bindings/solace/0.3.0/operation.json`), + [ + { + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "CreatedHREvents", + "topicSubscriptions": [ + "person/*/created" + ], + "accessType": "exclusive", + "maxMsgSpoolSize": "1,500", + "maxTtl": "60" + } + }, + { + "destinationType": "topic", + "topicSubscriptions": [ + "person/*/updated" + ] + } + ] + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.4.0": new JsonSchemaTestSuiteData( + require(`@bindings/solace/0.4.0/operation.json`), + [ + { + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "sampleQueue", + "topicSubscriptions": [ + "samples/*" + ], + "accessType": "nonexclusive" + } + }, + { + "destinationType": "topic", + "topicSubscriptions": [ + "samples/*" + ] + } + ] + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.2.0', + '0.3.0', + '0.4.0', +])('Solace operation binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/solace/solace server binding.test.mjs b/test/bindings/solace/solace server binding.test.mjs new file mode 100644 index 00000000..24652ad6 --- /dev/null +++ b/test/bindings/solace/solace server binding.test.mjs @@ -0,0 +1,100 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.2.0": new JsonSchemaTestSuiteData( + require(`@bindings/solace/0.2.0/server.json`), + [ + { + "msvVpn": "solace.private.net" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.3.0": new JsonSchemaTestSuiteData( + require(`@bindings/solace/0.3.0/server.json`), + [ + { + "msgVpn": "solace.private.net" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), + "0.4.0": new JsonSchemaTestSuiteData( + require(`@bindings/solace/0.4.0/server.json`), + [ + { + "clientName": "transactions-broker", + "msgVpn": "ProdVPN" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.2.0', + '0.3.0', + '0.4.0', +])('Solace server binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/solace/solace.test.mjs b/test/bindings/solace/solace.test.mjs deleted file mode 100644 index 4bfcf383..00000000 --- a/test/bindings/solace/solace.test.mjs +++ /dev/null @@ -1,78 +0,0 @@ -import {it} from 'vitest'; -import TestHelper from '@test/test-helper.mjs'; -import path from 'path'; - -describe.each([ - '0.2.0', - '0.3.0', - '0.4.0', -])('Solace bindings v%s', async (bindingVersion) => { - - const operationSchema = await import(`@bindings/solace/${bindingVersion}/operation.json`); - const serverSchema = await import(`@bindings/solace/${bindingVersion}/server.json`); - - describe('operation', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - operationSchema, - {} - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/only required properties.json`), - )); - - it.todo('Can be extended or not?', () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/extended.json`), - )); - - it.todo('Can be extended or not?', () => TestHelper.wronglyExtended( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/wrongly extended.json`), - )); - }) - - describe('server', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - serverSchema, - {} - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - serverSchema, - path.resolve(__dirname, `./${bindingVersion}/server/wrongly extended.json`), - )); - }) - -}) \ No newline at end of file diff --git a/test/bindings/sqs/0.2.0/channel/example.json b/test/bindings/sqs/0.2.0/channel/example.json deleted file mode 100644 index 5eb8b535..00000000 --- a/test/bindings/sqs/0.2.0/channel/example.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "queue": { - "name": "myQueue", - "fifoQueue": true, - "deduplicationScope": "messageGroup", - "fifoThroughputLimit": "perMessageGroupId", - "deliveryDelay": 15, - "visibilityTimeout": 60, - "receiveMessageWaitTime": 0, - "messageRetentionPeriod": 86400, - "redrivePolicy": { - "deadLetterQueue": { - "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" - }, - "maxReceiveCount": 15 - }, - "policy": { - "statements": [ - { - "effect": "Deny", - "principal": "arn:aws:iam::123456789012:user/dec.kolakowski", - "action": [ - "sqs:SendMessage", - "sqs:ReceiveMessage" - ] - } - ] - }, - "tags": { - "owner": "AsyncAPI.NET", - "platform": "AsyncAPIOrg" - } - }, - "deadLetterQueue": { - "name": "myQueue_error", - "fifoQueue": false, - "deliveryDelay": 0, - "visibilityTimeout": 0, - "receiveMessageWaitTime": 0, - "messageRetentionPeriod": 604800 - } -} \ No newline at end of file diff --git a/test/bindings/sqs/0.2.0/channel/extended.json b/test/bindings/sqs/0.2.0/channel/extended.json deleted file mode 100644 index 4fa8b6bf..00000000 --- a/test/bindings/sqs/0.2.0/channel/extended.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "queue": { - "name": "myQueue", - "fifoQueue": true - }, - "name": "my-sns-topic", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/sqs/0.2.0/channel/only required properties.json b/test/bindings/sqs/0.2.0/channel/only required properties.json deleted file mode 100644 index e9a8e471..00000000 --- a/test/bindings/sqs/0.2.0/channel/only required properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "queue": { - "name": "myQueue", - "fifoQueue": true - } -} \ No newline at end of file diff --git a/test/bindings/sqs/0.2.0/channel/without required properties.json b/test/bindings/sqs/0.2.0/channel/without required properties.json deleted file mode 100644 index bc117dd6..00000000 --- a/test/bindings/sqs/0.2.0/channel/without required properties.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "deadLetterQueue": { - "name": "myQueue_error", - "fifoQueue": false, - "deliveryDelay": 0, - "visibilityTimeout": 0, - "receiveMessageWaitTime": 0, - "messageRetentionPeriod": 604800 - } -} \ No newline at end of file diff --git a/test/bindings/sqs/0.2.0/channel/wrongly extended.json b/test/bindings/sqs/0.2.0/channel/wrongly extended.json deleted file mode 100644 index faadae08..00000000 --- a/test/bindings/sqs/0.2.0/channel/wrongly extended.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "queue": { - "name": "myQueue", - "fifoQueue": true - }, - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/sqs/0.2.0/operation/example.json b/test/bindings/sqs/0.2.0/operation/example.json deleted file mode 100644 index f4d6c740..00000000 --- a/test/bindings/sqs/0.2.0/operation/example.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "queues": [ - { - "name": "myQueue", - "fifoQueue": true, - "deduplicationScope": "messageGroup", - "fifoThroughputLimit": "perMessageGroupId", - "deliveryDelay": 10, - "redrivePolicy": { - "deadLetterQueue": { - "name": "myQueue_error" - }, - "maxReceiveCount": 15 - }, - "policy": { - "statements": [ - { - "effect": "Deny", - "principal": "arn:aws:iam::123456789012:user/dec.kolakowski", - "action": [ - "sqs:SendMessage", - "sqs:ReceiveMessage" - ] - } - ] - } - }, - { - "name": "myQueue_error", - "deliveryDelay": 10 - } - ] -} \ No newline at end of file diff --git a/test/bindings/sqs/0.2.0/operation/extended.json b/test/bindings/sqs/0.2.0/operation/extended.json deleted file mode 100644 index 9811270b..00000000 --- a/test/bindings/sqs/0.2.0/operation/extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "queues": [], - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/sqs/0.2.0/operation/only required properties.json b/test/bindings/sqs/0.2.0/operation/only required properties.json deleted file mode 100644 index 062d88da..00000000 --- a/test/bindings/sqs/0.2.0/operation/only required properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "queues": [] -} \ No newline at end of file diff --git a/test/bindings/sqs/0.2.0/operation/without required properties.json b/test/bindings/sqs/0.2.0/operation/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/sqs/0.2.0/operation/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/sqs/0.2.0/operation/wrongly extended.json b/test/bindings/sqs/0.2.0/operation/wrongly extended.json deleted file mode 100644 index f7b655a9..00000000 --- a/test/bindings/sqs/0.2.0/operation/wrongly extended.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "queues": [], - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/sqs/sqs channel binding.test.mjs b/test/bindings/sqs/sqs channel binding.test.mjs new file mode 100644 index 00000000..929a4370 --- /dev/null +++ b/test/bindings/sqs/sqs channel binding.test.mjs @@ -0,0 +1,101 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + true, + [ + 'must have required property \'queue\'', + ], + true, + [] +); + +let data = { + "0.2.0": new JsonSchemaTestSuiteData( + require(`@bindings/sqs/0.2.0/channel.json`), + [ + { + "queue": { + "name": "myQueue", + "fifoQueue": true, + "deduplicationScope": "messageGroup", + "fifoThroughputLimit": "perMessageGroupId", + "deliveryDelay": 15, + "visibilityTimeout": 60, + "receiveMessageWaitTime": 0, + "messageRetentionPeriod": 86400, + "redrivePolicy": { + "deadLetterQueue": { + "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + "maxReceiveCount": 15 + }, + "policy": { + "statements": [ + { + "effect": "Deny", + "principal": "arn:aws:iam::123456789012:user/dec.kolakowski", + "action": [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + }, + "tags": { + "owner": "AsyncAPI.NET", + "platform": "AsyncAPIOrg" + } + }, + "deadLetterQueue": { + "name": "myQueue_error", + "fifoQueue": false, + "deliveryDelay": 0, + "visibilityTimeout": 0, + "receiveMessageWaitTime": 0, + "messageRetentionPeriod": 604800 + } + } + ], + { + "queue": { + "name": "myQueue", + "fifoQueue": true + } + }, + {}, + { + "queue": { + "name": "myQueue", + "fifoQueue": true + }, + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "queue": { + "name": "myQueue", + "fifoQueue": true + }, + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.2.0', +])('Amazon SQS channel binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/sqs/sqs operation binding.test.mjs b/test/bindings/sqs/sqs operation binding.test.mjs new file mode 100644 index 00000000..9a420e63 --- /dev/null +++ b/test/bindings/sqs/sqs operation binding.test.mjs @@ -0,0 +1,98 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + true, + [ + 'must have required property \'queues\'', + ], + true, + [] +); + +let data = { + "0.2.0": new JsonSchemaTestSuiteData( + require(`@bindings/sqs/0.2.0/operation.json`), + [ + { + "queues": [ + { + "name": "myQueue", + "fifoQueue": true, + "deduplicationScope": "messageGroup", + "fifoThroughputLimit": "perMessageGroupId", + "deliveryDelay": 10, + "redrivePolicy": { + "deadLetterQueue": { + "name": "myQueue_error" + }, + "maxReceiveCount": 15 + }, + "policy": { + "statements": [ + { + "effect": "Deny", + "principal": "arn:aws:iam::123456789012:user/dec.kolakowski", + "action": [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + } + }, + { + "name": "myQueue_error", + "deliveryDelay": 10 + } + ] + } + ], + { + "queues": [ + { + "name": "myQueue_error", + "deliveryDelay": 10 + } + ] + }, + {}, + { + "queues": [ + { + "name": "myQueue_error", + "deliveryDelay": 10 + } + ], + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "queues": [ + { + "name": "myQueue_error", + "deliveryDelay": 10 + } + ], + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.2.0', +])('Amazon SNS operation binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/sqs/sqs.test.mjs b/test/bindings/sqs/sqs.test.mjs deleted file mode 100644 index 16a530a2..00000000 --- a/test/bindings/sqs/sqs.test.mjs +++ /dev/null @@ -1,84 +0,0 @@ -import {it} from 'vitest'; -import TestHelper from '@test/test-helper.mjs'; -import path from 'path'; - -describe.each([ - '0.2.0', -])('SQS bindings v%s', async (bindingVersion) => { - - const channelSchema = await import(`@bindings/sqs/${bindingVersion}/channel.json`); - const operationSchema = await import(`@bindings/sqs/${bindingVersion}/operation.json`); - - describe('channel', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/example.json`), - )); - - it(TestHelper.cannotBeEmptyTestName, () => TestHelper.objectIsNotValid( - channelSchema, - {}, - [ - 'must have required property \'queue\'', - ] - )); - - it(TestHelper.isNotValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsNotValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/without required properties.json`), - [ - 'must have required property \'queue\'', - ] - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/only required properties.json`), - )); - - it.todo('Can be extended or not?', () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/extended.json`), - )); - - it.todo('Can be extended or not?', () => TestHelper.wronglyExtended( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/wrongly extended.json`), - )); - }) - - describe('operation', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/example.json`), - )); - - it(TestHelper.cannotBeEmptyTestName, () => TestHelper.objectIsNotValid( - operationSchema, - {}, - ['must have required property \'queues\''] - )); - - it(TestHelper.isNotValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsNotValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/without required properties.json`), - ['must have required property \'queues\''] - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/only required properties.json`), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/extended.json`), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - operationSchema, - path.resolve(__dirname, `./${bindingVersion}/operation/wrongly extended.json`), - )); - }) - -}) \ No newline at end of file diff --git a/test/bindings/websockets/0.1.0/channel/example.json b/test/bindings/websockets/0.1.0/channel/example.json deleted file mode 100644 index 792c1b04..00000000 --- a/test/bindings/websockets/0.1.0/channel/example.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "method": "GET", - "query": { - "type": "object", - "properties": { - "ref": { - "type": "string", - "description": "Referral." - } - } - }, - "headers": { - "type": "object", - "properties": { - "Authentication": { - "type": "string", - "description": "Authentication token" - } - } - } -} \ No newline at end of file diff --git a/test/bindings/websockets/0.1.0/channel/extended.json b/test/bindings/websockets/0.1.0/channel/extended.json deleted file mode 100644 index 2da8cc79..00000000 --- a/test/bindings/websockets/0.1.0/channel/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} \ No newline at end of file diff --git a/test/bindings/websockets/0.1.0/channel/only required properties.json b/test/bindings/websockets/0.1.0/channel/only required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/websockets/0.1.0/channel/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/websockets/0.1.0/channel/without required properties.json b/test/bindings/websockets/0.1.0/channel/without required properties.json deleted file mode 100644 index 9e26dfee..00000000 --- a/test/bindings/websockets/0.1.0/channel/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/bindings/websockets/0.1.0/channel/wrongly extended.json b/test/bindings/websockets/0.1.0/channel/wrongly extended.json deleted file mode 100644 index e6738ad9..00000000 --- a/test/bindings/websockets/0.1.0/channel/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} \ No newline at end of file diff --git a/test/bindings/websockets/websockets channel binding.test.mjs b/test/bindings/websockets/websockets channel binding.test.mjs new file mode 100644 index 00000000..b0e7d317 --- /dev/null +++ b/test/bindings/websockets/websockets channel binding.test.mjs @@ -0,0 +1,65 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +let data = { + "0.1.0": new JsonSchemaTestSuiteData( + require(`@bindings/websockets/0.1.0/channel.json`), + [ + { + "method": "GET", + "query": { + "type": "object", + "properties": { + "ref": { + "type": "string", + "description": "Referral." + } + } + }, + "headers": { + "type": "object", + "properties": { + "Authentication": { + "type": "string", + "description": "Authentication token" + } + } + } + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } + ), +} + +describe.each([ + '0.1.0', +])('WebSockets channel binding v%s', (bindingVersion) => { + new JsonSchemaTestSuite(data[bindingVersion], config).testSuite() +}) diff --git a/test/bindings/websockets/websockets.test.mjs b/test/bindings/websockets/websockets.test.mjs deleted file mode 100644 index af533e97..00000000 --- a/test/bindings/websockets/websockets.test.mjs +++ /dev/null @@ -1,43 +0,0 @@ -import {it} from 'vitest'; -import TestHelper from '@test/test-helper.mjs'; -import path from 'path'; - -describe.each([ - '0.1.0', -])('WebSockets bindings v%s', async (bindingVersion) => { - - const channelSchema = await import(`@bindings/websockets/${bindingVersion}/channel.json`); - - describe('channel', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/example.json`), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - channelSchema, - {} - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/without required properties.json`), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/only required properties.json`), - )); - - it.todo('Can be extended or not?', () => TestHelper.objectIsValid( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/extended.json`), - )); - - it.todo('Can be extended or not?', () => TestHelper.wronglyExtended( - channelSchema, - path.resolve(__dirname, `./${bindingVersion}/channel/wrongly extended.json`), - )); - }) - -}) \ No newline at end of file diff --git a/test/definitions/base-schema-test.mjs b/test/definitions/base-schema-test.mjs index 31c88720..3c14bfb2 100644 --- a/test/definitions/base-schema-test.mjs +++ b/test/definitions/base-schema-test.mjs @@ -55,10 +55,12 @@ export class JsonSchemaTestSuite { testSuite() { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - this.data.jsonSchema, - this.data.examples[0], - )); + for (const example of this.data.examples) { + it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( + this.data.jsonSchema, + example, + )); + } if (this.config.hasRequiredProperties) { diff --git a/test/definitions/extended.json b/test/definitions/extended.json deleted file mode 100644 index 39302144..00000000 --- a/test/definitions/extended.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} diff --git a/test/definitions/wrongly extended.json b/test/definitions/wrongly extended.json deleted file mode 100644 index b5744bca..00000000 --- a/test/definitions/wrongly extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -}