Skip to content

Commit

Permalink
test(definitions): Anypoint MQ bindings new tests structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakisan committed Jul 25, 2024
1 parent e108553 commit ac48407
Show file tree
Hide file tree
Showing 13 changed files with 105 additions and 126 deletions.
5 changes: 0 additions & 5 deletions test/bindings/anypointmq/0.0.1/channel/example.json

This file was deleted.

7 changes: 0 additions & 7 deletions test/bindings/anypointmq/0.0.1/channel/extended.json

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions test/bindings/anypointmq/0.0.1/channel/wrongly extended.json

This file was deleted.

12 changes: 0 additions & 12 deletions test/bindings/anypointmq/0.0.1/message/example.json

This file was deleted.

7 changes: 0 additions & 7 deletions test/bindings/anypointmq/0.0.1/message/extended.json

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions test/bindings/anypointmq/0.0.1/message/wrongly extended.json

This file was deleted.

49 changes: 49 additions & 0 deletions test/bindings/anypointmq/anypointmq channel binding.test.mjs
Original file line number Diff line number Diff line change
@@ -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()
})
56 changes: 56 additions & 0 deletions test/bindings/anypointmq/anypointmq message binding.test.mjs
Original file line number Diff line number Diff line change
@@ -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()
})
75 changes: 0 additions & 75 deletions test/bindings/anypointmq/anypointmq.test.mjs

This file was deleted.

0 comments on commit ac48407

Please sign in to comment.