Skip to content

Commit bea377c

Browse files
committed
chore: add tests
1 parent d31cda5 commit bea377c

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

plugins/asyncapi-jsonschema2pojo/src/test/java/io/zenwave360/sdk/plugins/AsyncApiJsonSchema2PojoGeneratorTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ public void test_generator_for_asyncapi_v3() throws Exception {
3232
Assertions.assertTrue(new File("target/zenwave630/src/main/java/io/example/v3/domain/events/CustomerInput.java").exists());
3333
}
3434

35+
@Test
36+
public void test_generator_for_asyncapi_schemas_with_delimiters() throws Exception {
37+
Plugin plugin = new AsyncApiJsonSchema2PojoPlugin()
38+
.withApiFile("classpath:asyncapi.yml")
39+
.withTargetFolder("target/zenwave630")
40+
.withOption("modelPackage", "io.example.integration.test.with_schemas.model");
41+
42+
new MainGenerator().generate(plugin);
43+
44+
Assertions.assertTrue(new File("target/zenwave630/src/main/java/io/example/integration/test/with_schemas/model/DepartmentV1.java").exists());
45+
}
46+
3547
@Test
3648
public void test_generator_for_asyncapi_v3_filter_messages() throws Exception {
3749
Plugin plugin = new AsyncApiJsonSchema2PojoPlugin()

plugins/asyncapi-jsonschema2pojo/src/test/resources/asyncapi.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,19 @@ components:
2424
backupEmail:
2525
description: something else
2626
$ref: "#/components/schemas/Email"
27+
department:
28+
description: department where user works
29+
$ref: "#/components/schemas/Department-v1"
2730
schemas:
2831
Email:
2932
type: string
3033
enum:
3134
- Google
3235
- Yahoo
36+
Department-v1:
37+
type: object
38+
properties:
39+
identifier:
40+
type: string
41+
name:
42+
type: string

0 commit comments

Comments
 (0)