Skip to content

Commit

Permalink
chore: switch examples to application properties configuration
Browse files Browse the repository at this point in the history
Remove usage of AsyncApiDocket bean configuration
  • Loading branch information
timonback committed Nov 20, 2023
1 parent fe2e3f6 commit 51ced6a
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 1,042 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,10 @@

public class SpringContextIntegrationTest {

@Nested
@SpringBootTest(classes = SpringwolfAmqpExampleApplication.class)
class AsyncApiDocketTest {

@Autowired
private ApplicationContext context;

@Autowired
private AsyncApiService asyncApiService;

@Test
void testContextWithAsyncApiDocketBean() {
assertNotNull(context);

assertThat(asyncApiService.getAsyncAPI()).isNotNull();
}

@Test
void testAllChannelsAreFound() {
assertThat(asyncApiService.getAsyncAPI().getChannels()).hasSize(7);
}
}

@Nested
@SpringBootTest(classes = SpringwolfAmqpExampleApplication.class)
@TestPropertySource(
properties = {
"customAsyncApiDocketBean=false",
"springwolf.enabled=true",
"springwolf.docket.info.title=Info title was loaded from spring properties",
"springwolf.docket.info.version=1.0.0",
Expand All @@ -66,7 +42,6 @@ void testContextWithApplicationProperties() {

@Test
void testAllChannelsAreFound() {
// 2 channels defined in the AsyncDocket are not found (7 - 2 = 5)
assertThat(asyncApiService.getAsyncAPI().getChannels()).hasSize(5);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,88 +74,6 @@
}
}
},
"example-manual-consumer-channel": {
"publish": {
"operationId": "example-manual-consumer-channel_publish",
"description": "example-manual-consumer-channel-description",
"bindings": {
"amqp": {
"cc": [
"example-consumer-topic-routing-key"
],
"bindingVersion": "0.2.0"
}
},
"message": {
"schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0",
"name": "io.github.stavshamir.springwolf.example.amqp.dtos.AnotherPayloadDto",
"title": "AnotherPayloadDto",
"description": "Another payload model",
"payload": {
"$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.amqp.dtos.AnotherPayloadDto"
},
"headers": {
"$ref": "#/components/schemas/HeadersNotDocumented"
},
"bindings": {
"amqp": {
"bindingVersion": "0.2.0"
}
}
}
},
"bindings": {
"amqp": {
"is": "routingKey",
"exchange": {
"name": "example-consumer-topic-exchange",
"vhost": "/"
},
"bindingVersion": "0.2.0"
}
}
},
"example-producer-channel": {
"subscribe": {
"operationId": "example-producer-channel_subscribe",
"description": "example-producer-channel-description",
"bindings": {
"amqp": {
"cc": [
"example-topic-routing-key"
],
"bindingVersion": "0.2.0"
}
},
"message": {
"schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0",
"name": "io.github.stavshamir.springwolf.example.amqp.dtos.AnotherPayloadDto",
"title": "AnotherPayloadDto",
"description": "Another payload model",
"payload": {
"$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.amqp.dtos.AnotherPayloadDto"
},
"headers": {
"$ref": "#/components/schemas/HeadersNotDocumented"
},
"bindings": {
"amqp": {
"bindingVersion": "0.2.0"
}
}
}
},
"bindings": {
"amqp": {
"is": "routingKey",
"exchange": {
"name": "example-topic-exchange",
"vhost": "/"
},
"bindingVersion": "0.2.0"
}
}
},
"example-producer-channel-publisher": {
"subscribe": {
"operationId": "example-producer-channel-publisher_subscribe",
Expand Down
Loading

0 comments on commit 51ced6a

Please sign in to comment.