From 5ab034e54f489d778a25320cab5224949fb833a0 Mon Sep 17 00:00:00 2001 From: Timon Back Date: Mon, 20 Nov 2023 20:48:44 +0100 Subject: [PATCH 1/3] chore: switch examples to application properties configuration Remove usage of AsyncApiDocket bean configuration --- .../configuration/AsyncApiConfiguration.java | 90 ----- .../ApiWithDocketBeanIntegrationTest.java | 17 - ...hDocketFromEnvironmentIntegrationTest.java | 17 - .../example/amqp/BaseApiIntegrationTest.java | 50 --- .../amqp/SpringContextIntegrationTest.java | 25 -- .../src/test/resources/asyncapi.json | 82 ---- .../asyncapi_withdocketfromenvironment.json | 354 ------------------ .../configuration/AsyncApiConfiguration.java | 58 --- .../src/main/resources/application.properties | 2 +- .../SpringContextIntegrationTest.java | 23 -- .../src/test/resources/asyncapi.json | 2 +- .../configuration/AsyncApiConfiguration.java | 102 ----- .../kafka/SpringContextIntegrationTest.java | 30 -- .../src/test/resources/asyncapi.json | 192 ---------- 14 files changed, 2 insertions(+), 1042 deletions(-) delete mode 100644 springwolf-examples/springwolf-amqp-example/src/main/java/io/github/stavshamir/springwolf/example/amqp/configuration/AsyncApiConfiguration.java delete mode 100644 springwolf-examples/springwolf-amqp-example/src/test/java/io/github/stavshamir/springwolf/example/amqp/ApiWithDocketBeanIntegrationTest.java delete mode 100644 springwolf-examples/springwolf-amqp-example/src/test/java/io/github/stavshamir/springwolf/example/amqp/ApiWithDocketFromEnvironmentIntegrationTest.java delete mode 100644 springwolf-examples/springwolf-amqp-example/src/test/java/io/github/stavshamir/springwolf/example/amqp/BaseApiIntegrationTest.java delete mode 100644 springwolf-examples/springwolf-amqp-example/src/test/resources/asyncapi_withdocketfromenvironment.json delete mode 100644 springwolf-examples/springwolf-cloud-stream-example/src/main/java/io/github/stavshamir/springwolf/example/cloudstream/configuration/AsyncApiConfiguration.java delete mode 100644 springwolf-examples/springwolf-kafka-example/src/main/java/io/github/stavshamir/springwolf/example/kafka/configuration/AsyncApiConfiguration.java diff --git a/springwolf-examples/springwolf-amqp-example/src/main/java/io/github/stavshamir/springwolf/example/amqp/configuration/AsyncApiConfiguration.java b/springwolf-examples/springwolf-amqp-example/src/main/java/io/github/stavshamir/springwolf/example/amqp/configuration/AsyncApiConfiguration.java deleted file mode 100644 index 4f457250a..000000000 --- a/springwolf-examples/springwolf-amqp-example/src/main/java/io/github/stavshamir/springwolf/example/amqp/configuration/AsyncApiConfiguration.java +++ /dev/null @@ -1,90 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -package io.github.stavshamir.springwolf.example.amqp.configuration; - -import com.asyncapi.v2._6_0.model.info.Contact; -import com.asyncapi.v2._6_0.model.info.Info; -import com.asyncapi.v2._6_0.model.info.License; -import com.asyncapi.v2._6_0.model.server.Server; -import io.github.stavshamir.springwolf.asyncapi.scanners.channels.operationdata.annotation.AsyncListener; -import io.github.stavshamir.springwolf.asyncapi.scanners.channels.operationdata.annotation.AsyncPublisher; -import io.github.stavshamir.springwolf.asyncapi.types.AmqpConsumerData; -import io.github.stavshamir.springwolf.asyncapi.types.AmqpProducerData; -import io.github.stavshamir.springwolf.configuration.AsyncApiDocket; -import io.github.stavshamir.springwolf.example.amqp.dtos.AnotherPayloadDto; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import java.util.Map; - -@Configuration -public class AsyncApiConfiguration { - - private final String amqpHost; - private final String amqpPort; - - public AsyncApiConfiguration( - @Value("${spring.rabbitmq.host}") String amqpHost, @Value("${spring.rabbitmq.port}") int amqpPort) { - this.amqpHost = amqpHost; - this.amqpPort = String.valueOf(amqpPort); - } - - /** - * This bean is only required if full control on the {@link AsyncApiDocket} is needed - *

- * By default, Springwolf uses the {@see Info} provided in the application.properties - * Consumers are detected when the @RabbitListener or {@link AsyncListener} annotation is used - * Producers are detected when the springwolf {@link AsyncPublisher} annotation is used - */ - @Bean - @ConditionalOnProperty(value = "customAsyncApiDocketBean", havingValue = "true", matchIfMissing = true) - public AsyncApiDocket asyncApiDocket() { - Info info = Info.builder() - .version("1.0.0") - .title("Springwolf example project - AMQP") - .contact(Contact.builder() - .name("springwolf") - .url("https://github.com/springwolf/springwolf-core") - .email("example@example.com") - .build()) - .description("Springwolf example project to demonstrate springwolfs abilities") - .license(License.builder().name("Apache License 2.0").build()) - .build(); - - // the builder for asyncapi info, contact and license doesn't support setting/adding extensions, so - // we add text extension explicitely - info.setExtensionFields(Map.of("x-api-audience", "company-internal")); - info.getContact().setExtensionFields(Map.of("x-phone", "+49 123 456789")); - info.getLicense().setExtensionFields(Map.of("x-desc", "some description")); - - Server amqp = Server.builder() - .protocol("amqp") - .url(String.format("%s:%s", amqpHost, amqpPort)) - .build(); - - AmqpProducerData exampleProducer = AmqpProducerData.amqpProducerDataBuilder() - .queueName("example-producer-channel") - .description("example-producer-channel-description") - .exchangeName("example-topic-exchange") - .routingKey("example-topic-routing-key") - .payloadType(AnotherPayloadDto.class) - .build(); - - AmqpConsumerData exampleManuallyDefinedConsumer = AmqpConsumerData.amqpConsumerDataBuilder() - .queueName("example-manual-consumer-channel") - .description("example-manual-consumer-channel-description") - .exchangeName("example-consumer-topic-exchange") - .routingKey("example-consumer-topic-routing-key") - .payloadType(AnotherPayloadDto.class) - .build(); - - return AsyncApiDocket.builder() - .basePackage("io.github.stavshamir.springwolf.example") - .info(info) - .server("amqp", amqp) - .producer(exampleProducer) - .consumer(exampleManuallyDefinedConsumer) - .build(); - } -} diff --git a/springwolf-examples/springwolf-amqp-example/src/test/java/io/github/stavshamir/springwolf/example/amqp/ApiWithDocketBeanIntegrationTest.java b/springwolf-examples/springwolf-amqp-example/src/test/java/io/github/stavshamir/springwolf/example/amqp/ApiWithDocketBeanIntegrationTest.java deleted file mode 100644 index ea556874a..000000000 --- a/springwolf-examples/springwolf-amqp-example/src/test/java/io/github/stavshamir/springwolf/example/amqp/ApiWithDocketBeanIntegrationTest.java +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -package io.github.stavshamir.springwolf.example.amqp; - -import org.springframework.test.context.TestPropertySource; - -/** - * Api integrationtest based on a SpringBoot application that defines a custom Docket bean. This contains Info and - * Server Informations as well as some explicit Producer and Consumer definitions. - */ -@TestPropertySource(properties = {"customAsyncApiDocketBean=true"}) -public class ApiWithDocketBeanIntegrationTest extends BaseApiIntegrationTest { - - @Override - protected String getExpectedApiFileName() { - return "/asyncapi.json"; - } -} diff --git a/springwolf-examples/springwolf-amqp-example/src/test/java/io/github/stavshamir/springwolf/example/amqp/ApiWithDocketFromEnvironmentIntegrationTest.java b/springwolf-examples/springwolf-amqp-example/src/test/java/io/github/stavshamir/springwolf/example/amqp/ApiWithDocketFromEnvironmentIntegrationTest.java deleted file mode 100644 index a562f65ed..000000000 --- a/springwolf-examples/springwolf-amqp-example/src/test/java/io/github/stavshamir/springwolf/example/amqp/ApiWithDocketFromEnvironmentIntegrationTest.java +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -package io.github.stavshamir.springwolf.example.amqp; - -import org.springframework.test.context.TestPropertySource; - -/** - * Api integrationtest based on a SpringBoot application that defines all info and server properties via - * spring environment (from application.properties). - */ -@TestPropertySource(properties = {"customAsyncApiDocketBean=false"}) -public class ApiWithDocketFromEnvironmentIntegrationTest extends BaseApiIntegrationTest { - - @Override - protected String getExpectedApiFileName() { - return "/asyncapi_withdocketfromenvironment.json"; - } -} diff --git a/springwolf-examples/springwolf-amqp-example/src/test/java/io/github/stavshamir/springwolf/example/amqp/BaseApiIntegrationTest.java b/springwolf-examples/springwolf-amqp-example/src/test/java/io/github/stavshamir/springwolf/example/amqp/BaseApiIntegrationTest.java deleted file mode 100644 index b2cfaa72d..000000000 --- a/springwolf-examples/springwolf-amqp-example/src/test/java/io/github/stavshamir/springwolf/example/amqp/BaseApiIntegrationTest.java +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -package io.github.stavshamir.springwolf.example.amqp; - -import org.json.JSONException; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; - -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -/** - * Api integrationtest base class defining a SpringBootTest and a test method which asserts the resulting asyncapi. - * Subclasses can customize this test with @TestPropertySources and custom expectation file names. - * @see ApiWithDocketBeanIntegrationTest - * @see ApiWithDocketFromEnvironmentIntegrationTest - */ -@SpringBootTest( - classes = {SpringwolfAmqpExampleApplication.class}, - webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -public abstract class BaseApiIntegrationTest { - - @Autowired - private TestRestTemplate restTemplate; - - @Value("${server.port}") - public Integer serverPort; - - @Test - void asyncApiResourceArtifactTest() throws JSONException, IOException { - String url = "/springwolf/docs"; - String actual = restTemplate.getForObject(url, String.class); - Files.writeString(Path.of("src", "test", "resources", "asyncapi.actual.json"), actual); - - String expectedApiFileName = getExpectedApiFileName(); - InputStream s = this.getClass().getResourceAsStream(expectedApiFileName); - String expected = new String(s.readAllBytes(), StandardCharsets.UTF_8); - - assertEquals(expected, actual); - } - - protected abstract String getExpectedApiFileName(); -} diff --git a/springwolf-examples/springwolf-amqp-example/src/test/java/io/github/stavshamir/springwolf/example/amqp/SpringContextIntegrationTest.java b/springwolf-examples/springwolf-amqp-example/src/test/java/io/github/stavshamir/springwolf/example/amqp/SpringContextIntegrationTest.java index 623324ada..7eb8e0ddd 100644 --- a/springwolf-examples/springwolf-amqp-example/src/test/java/io/github/stavshamir/springwolf/example/amqp/SpringContextIntegrationTest.java +++ b/springwolf-examples/springwolf-amqp-example/src/test/java/io/github/stavshamir/springwolf/example/amqp/SpringContextIntegrationTest.java @@ -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", @@ -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); } } diff --git a/springwolf-examples/springwolf-amqp-example/src/test/resources/asyncapi.json b/springwolf-examples/springwolf-amqp-example/src/test/resources/asyncapi.json index 1f1cdaf20..6c6d4ad90 100644 --- a/springwolf-examples/springwolf-amqp-example/src/test/resources/asyncapi.json +++ b/springwolf-examples/springwolf-amqp-example/src/test/resources/asyncapi.json @@ -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", diff --git a/springwolf-examples/springwolf-amqp-example/src/test/resources/asyncapi_withdocketfromenvironment.json b/springwolf-examples/springwolf-amqp-example/src/test/resources/asyncapi_withdocketfromenvironment.json deleted file mode 100644 index 6c6d4ad90..000000000 --- a/springwolf-examples/springwolf-amqp-example/src/test/resources/asyncapi_withdocketfromenvironment.json +++ /dev/null @@ -1,354 +0,0 @@ -{ - "asyncapi": "2.6.0", - "info": { - "title": "Springwolf example project - AMQP", - "version": "1.0.0", - "description": "Springwolf example project to demonstrate springwolfs abilities", - "contact": { - "name": "springwolf", - "url": "https://github.com/springwolf/springwolf-core", - "email": "example@example.com", - "x-phone": "+49 123 456789" - }, - "license": { - "name": "Apache License 2.0", - "x-desc": "some description" - }, - "x-api-audience": "company-internal" - }, - "defaultContentType": "application/json", - "servers": { - "amqp": { - "url": "amqp:5672", - "protocol": "amqp" - } - }, - "channels": { - "another-queue": { - "publish": { - "operationId": "another-queue_publish_receiveAnotherPayload", - "description": "Auto-generated description", - "bindings": { - "amqp": { - "cc": [ - "another-queue" - ], - "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", - "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": "queue", - "exchange": { - "name": "", - "type": "direct", - "durable": true, - "autoDelete": false, - "vhost": "/" - }, - "queue": { - "name": "another-queue", - "durable": false, - "exclusive": false, - "autoDelete": false, - "vhost": "/" - }, - "bindingVersion": "0.2.0" - } - } - }, - "example-producer-channel-publisher": { - "subscribe": { - "operationId": "example-producer-channel-publisher_subscribe", - "description": "Custom, optional description defined in the AsyncPublisher annotation", - "bindings": { - "amqp": { - "expiration": 0, - "cc": [ ], - "priority": 0, - "deliveryMode": 0, - "mandatory": false, - "timestamp": false, - "ack": false, - "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" - } - } - } - } - }, - "example-queue": { - "publish": { - "operationId": "example-queue_publish_receiveExamplePayload", - "description": "Auto-generated description", - "bindings": { - "amqp": { - "cc": [ - "example-queue" - ], - "bindingVersion": "0.2.0" - } - }, - "message": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", - "name": "io.github.stavshamir.springwolf.example.amqp.dtos.ExamplePayloadDto", - "title": "ExamplePayloadDto", - "payload": { - "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.amqp.dtos.ExamplePayloadDto" - }, - "headers": { - "$ref": "#/components/schemas/HeadersNotDocumented" - }, - "bindings": { - "amqp": { - "bindingVersion": "0.2.0" - } - } - } - }, - "bindings": { - "amqp": { - "is": "queue", - "exchange": { - "name": "", - "type": "direct", - "durable": true, - "autoDelete": false, - "vhost": "/" - }, - "queue": { - "name": "example-queue", - "durable": false, - "exclusive": false, - "autoDelete": false, - "vhost": "/" - }, - "bindingVersion": "0.2.0" - } - } - }, - "example-topic-routing-key": { - "publish": { - "operationId": "example-topic-routing-key_publish_bindingsExample", - "description": "Auto-generated 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", - "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-bindings-exchange-name", - "type": "topic", - "durable": true, - "autoDelete": false, - "vhost": "/" - }, - "queue": { - "name": "example-bindings-queue", - "durable": false, - "exclusive": true, - "autoDelete": true, - "vhost": "/" - }, - "bindingVersion": "0.2.0" - } - } - }, - "multi-payload-queue": { - "publish": { - "operationId": "multi-payload-queue_publish_bindingsBeanExample", - "description": "Auto-generated description", - "bindings": { - "amqp": { - "cc": [ - "example-topic-routing-key" - ], - "bindingVersion": "0.2.0" - } - }, - "message": { - "oneOf": [ - { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", - "name": "io.github.stavshamir.springwolf.example.amqp.dtos.AnotherPayloadDto", - "title": "AnotherPayloadDto", - "payload": { - "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.amqp.dtos.AnotherPayloadDto" - }, - "headers": { - "$ref": "#/components/schemas/HeadersNotDocumented" - }, - "bindings": { - "amqp": { - "bindingVersion": "0.2.0" - } - } - }, - { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", - "name": "io.github.stavshamir.springwolf.example.amqp.dtos.ExamplePayloadDto", - "title": "ExamplePayloadDto", - "payload": { - "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.amqp.dtos.ExamplePayloadDto" - }, - "headers": { - "$ref": "#/components/schemas/HeadersNotDocumented" - }, - "bindings": { - "amqp": { - "bindingVersion": "0.2.0" - } - } - } - ] - } - }, - "bindings": { - "amqp": { - "is": "routingKey", - "exchange": { - "name": "example-topic-exchange", - "type": "topic", - "durable": true, - "autoDelete": false, - "vhost": "/" - }, - "queue": { - "name": "multi-payload-queue", - "durable": true, - "exclusive": false, - "autoDelete": false, - "vhost": "/" - }, - "bindingVersion": "0.2.0" - } - } - } - }, - "components": { - "schemas": { - "HeadersNotDocumented": { - "type": "object", - "properties": { }, - "example": { } - }, - "io.github.stavshamir.springwolf.example.amqp.dtos.AnotherPayloadDto": { - "required": [ - "example" - ], - "type": "object", - "properties": { - "example": { - "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.amqp.dtos.ExamplePayloadDto" - }, - "foo": { - "type": "string", - "description": "Foo field", - "example": "bar" - } - }, - "description": "Another payload model", - "example": { - "example": { - "someEnum": "FOO2", - "someLong": 5, - "someString": "some string value" - }, - "foo": "bar" - } - }, - "io.github.stavshamir.springwolf.example.amqp.dtos.ExamplePayloadDto": { - "required": [ - "someEnum", - "someString" - ], - "type": "object", - "properties": { - "someEnum": { - "type": "string", - "description": "Some enum field", - "example": "FOO2", - "enum": [ - "FOO1", - "FOO2", - "FOO3" - ] - }, - "someLong": { - "type": "integer", - "description": "Some long field", - "format": "int64", - "example": 5 - }, - "someString": { - "type": "string", - "description": "Some string field", - "example": "some string value" - } - }, - "description": "Example payload model", - "example": { - "someEnum": "FOO2", - "someLong": 5, - "someString": "some string value" - } - } - } - }, - "tags": [ ] -} \ No newline at end of file diff --git a/springwolf-examples/springwolf-cloud-stream-example/src/main/java/io/github/stavshamir/springwolf/example/cloudstream/configuration/AsyncApiConfiguration.java b/springwolf-examples/springwolf-cloud-stream-example/src/main/java/io/github/stavshamir/springwolf/example/cloudstream/configuration/AsyncApiConfiguration.java deleted file mode 100644 index fa2fe4420..000000000 --- a/springwolf-examples/springwolf-cloud-stream-example/src/main/java/io/github/stavshamir/springwolf/example/cloudstream/configuration/AsyncApiConfiguration.java +++ /dev/null @@ -1,58 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -package io.github.stavshamir.springwolf.example.cloudstream.configuration; - -import com.asyncapi.v2._6_0.model.info.Contact; -import com.asyncapi.v2._6_0.model.info.Info; -import com.asyncapi.v2._6_0.model.info.License; -import com.asyncapi.v2._6_0.model.server.Server; -import io.github.stavshamir.springwolf.asyncapi.scanners.channels.operationdata.annotation.AsyncListener; -import io.github.stavshamir.springwolf.asyncapi.scanners.channels.operationdata.annotation.AsyncPublisher; -import io.github.stavshamir.springwolf.configuration.AsyncApiDocket; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class AsyncApiConfiguration { - - private final String BOOTSTRAP_SERVERS; - - public AsyncApiConfiguration(@Value("${spring.kafka.bootstrap-servers}") String bootstrapServers) { - this.BOOTSTRAP_SERVERS = bootstrapServers; - } - - /** - * This bean is only required if full control on the {@link AsyncApiDocket} is needed - *

- * By default, Springwolf uses the {@see Info} provided in the application.properties - * Consumers are detected when the @KafkaListener or {@link AsyncListener} annotation is used - * Producers are detected when the springwolf {@link AsyncPublisher} annotation is used - */ - @Bean - @ConditionalOnProperty(value = "customAsyncApiDocketBean", havingValue = "true", matchIfMissing = true) - public AsyncApiDocket asyncApiDocket() { - Info info = Info.builder() - .version("1.0.0") - .title("Springwolf example project - CloudStream") - .contact(Contact.builder() - .name("springwolf") - .url("https://github.com/springwolf/springwolf-core") - .email("example@example.com") - .build()) - .description("Springwolf example project") - .license(License.builder().name("Apache License 2.0").build()) - .build(); - - return AsyncApiDocket.builder() - .basePackage("io.github.stavshamir.springwolf.example") - .info(info) - .server( - "kafka", - Server.builder() - .protocol("kafka") - .url(BOOTSTRAP_SERVERS) - .build()) - .build(); - } -} diff --git a/springwolf-examples/springwolf-cloud-stream-example/src/main/resources/application.properties b/springwolf-examples/springwolf-cloud-stream-example/src/main/resources/application.properties index f9fe72611..045b64f32 100644 --- a/springwolf-examples/springwolf-cloud-stream-example/src/main/resources/application.properties +++ b/springwolf-examples/springwolf-cloud-stream-example/src/main/resources/application.properties @@ -16,7 +16,7 @@ spring.cloud.stream.bindings.consumerMethod-in-0.destination=another-topic # Springwolf configuration springwolf.enabled=true springwolf.docket.base-package=io.github.stavshamir.springwolf.example.cloudstream -springwolf.docket.info.title=${spring.application.name} +springwolf.docket.info.title=Springwolf example project - CloudStream springwolf.docket.info.version=1.0.0 springwolf.docket.info.description=Springwolf example project to demonstrate springwolfs abilities springwolf.docket.info.terms-of-service=http://asyncapi.org/terms diff --git a/springwolf-examples/springwolf-cloud-stream-example/src/test/java/io/github/stavshamir/springwolf/example/cloudstream/SpringContextIntegrationTest.java b/springwolf-examples/springwolf-cloud-stream-example/src/test/java/io/github/stavshamir/springwolf/example/cloudstream/SpringContextIntegrationTest.java index f785958ea..c15dd9716 100644 --- a/springwolf-examples/springwolf-cloud-stream-example/src/test/java/io/github/stavshamir/springwolf/example/cloudstream/SpringContextIntegrationTest.java +++ b/springwolf-examples/springwolf-cloud-stream-example/src/test/java/io/github/stavshamir/springwolf/example/cloudstream/SpringContextIntegrationTest.java @@ -16,28 +16,6 @@ public class SpringContextIntegrationTest { - @SpringBootTest(classes = SpringwolfCloudstreamExampleApplication.class) - @EmbeddedKafka( - partitions = 1, - brokerProperties = {"listeners=PLAINTEXT://localhost:29092", "port=29092"}) - @Nested - @DirtiesContext - class AsyncApiDocketTest { - - @Autowired - private ApplicationContext context; - - @Autowired - private AsyncApiService asyncApiService; - - @Test - void testContextWithAsyncApiDocketBean() { - assertNotNull(context); - - assertThat(asyncApiService.getAsyncAPI()).isNotNull(); - } - } - @SpringBootTest(classes = SpringwolfCloudstreamExampleApplication.class) @EmbeddedKafka( partitions = 1, @@ -46,7 +24,6 @@ void testContextWithAsyncApiDocketBean() { @DirtiesContext @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", diff --git a/springwolf-examples/springwolf-cloud-stream-example/src/test/resources/asyncapi.json b/springwolf-examples/springwolf-cloud-stream-example/src/test/resources/asyncapi.json index 4b93d45d0..b1b6ffe67 100644 --- a/springwolf-examples/springwolf-cloud-stream-example/src/test/resources/asyncapi.json +++ b/springwolf-examples/springwolf-cloud-stream-example/src/test/resources/asyncapi.json @@ -3,7 +3,7 @@ "info": { "title": "Springwolf example project - CloudStream", "version": "1.0.0", - "description": "Springwolf example project", + "description": "Springwolf example project to demonstrate springwolfs abilities", "contact": { "name": "springwolf", "url": "https://github.com/springwolf/springwolf-core", diff --git a/springwolf-examples/springwolf-kafka-example/src/main/java/io/github/stavshamir/springwolf/example/kafka/configuration/AsyncApiConfiguration.java b/springwolf-examples/springwolf-kafka-example/src/main/java/io/github/stavshamir/springwolf/example/kafka/configuration/AsyncApiConfiguration.java deleted file mode 100644 index 39c4d67c0..000000000 --- a/springwolf-examples/springwolf-kafka-example/src/main/java/io/github/stavshamir/springwolf/example/kafka/configuration/AsyncApiConfiguration.java +++ /dev/null @@ -1,102 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -package io.github.stavshamir.springwolf.example.kafka.configuration; - -import com.asyncapi.v2._6_0.model.info.Contact; -import com.asyncapi.v2._6_0.model.info.Info; -import com.asyncapi.v2._6_0.model.info.License; -import com.asyncapi.v2._6_0.model.server.Server; -import io.github.stavshamir.springwolf.asyncapi.scanners.channels.operationdata.annotation.AsyncListener; -import io.github.stavshamir.springwolf.asyncapi.scanners.channels.operationdata.annotation.AsyncPublisher; -import io.github.stavshamir.springwolf.asyncapi.types.KafkaConsumerData; -import io.github.stavshamir.springwolf.asyncapi.types.KafkaProducerData; -import io.github.stavshamir.springwolf.asyncapi.types.channel.operation.message.header.AsyncHeaders; -import io.github.stavshamir.springwolf.asyncapi.types.channel.operation.message.header.AsyncHeadersForCloudEventsBuilder; -import io.github.stavshamir.springwolf.configuration.AsyncApiDocket; -import io.github.stavshamir.springwolf.example.kafka.dtos.AnotherPayloadDto; -import io.github.stavshamir.springwolf.example.kafka.dtos.ExamplePayloadDto; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; - -import static io.github.stavshamir.springwolf.example.kafka.configuration.KafkaConfiguration.CONSUMER_TOPIC; -import static io.github.stavshamir.springwolf.example.kafka.configuration.KafkaConfiguration.PRODUCER_TOPIC; - -@Configuration -public class AsyncApiConfiguration { - - private final String BOOTSTRAP_SERVERS; - - public AsyncApiConfiguration(@Value("${spring.kafka.bootstrap-servers}") String bootstrapServers) { - this.BOOTSTRAP_SERVERS = bootstrapServers; - } - - /** - * This bean is only required if full control on the {@link AsyncApiDocket} is needed - *

- * By default, Springwolf uses the {@see Info} provided in the application.properties - * Consumers are detected when the @KafkaListener or {@link AsyncListener} annotation is used - * Producers are detected when the springwolf {@link AsyncPublisher} annotation is used - */ - @Bean - @ConditionalOnProperty(value = "customAsyncApiDocketBean", havingValue = "true", matchIfMissing = true) - public AsyncApiDocket asyncApiDocket() { - Info info = Info.builder() - .version("1.0.0") - .title("Springwolf example project - Kafka") - .contact(Contact.builder() - .name("springwolf") - .url("https://github.com/springwolf/springwolf-core") - .email("example@example.com") - .build()) - .description("Springwolf example project to demonstrate springwolfs abilities") - .license(License.builder().name("Apache License 2.0").build()) - .build(); - - KafkaProducerData anotherProducerData = KafkaProducerData.kafkaProducerDataBuilder() - .topicName(PRODUCER_TOPIC) - .description("Custom, optional description for this produced to topic") - .payloadType(AnotherPayloadDto.class) - .headers(createCloudEventHeaders()) - .build(); - - KafkaConsumerData manuallyConfiguredConsumer = KafkaConsumerData.kafkaConsumerDataBuilder() - .topicName(CONSUMER_TOPIC) - .description("Custom, optional description for this consumed topic") - .payloadType(ExamplePayloadDto.class) - .build(); - - return AsyncApiDocket.builder() - .basePackage("io.github.stavshamir.springwolf.example") - .info(info) - .server( - "kafka", - Server.builder() - .protocol("kafka") - .url(BOOTSTRAP_SERVERS) - .build()) - .producer(anotherProducerData) - .consumer(manuallyConfiguredConsumer) - .build(); - } - - private static AsyncHeaders createCloudEventHeaders() { - AsyncHeaders ceBaseHeaders = createCloudEventsBaseHeaders(); - - return new AsyncHeadersForCloudEventsBuilder("CloudEventHeadersForAnotherPayloadDtoEndpoint", ceBaseHeaders) - .withTypeHeader("io.github.stavshamir.springwolf.CloudEventHeadersForAnotherPayloadDtoEndpoint") - .withSourceHeader("springwolf-kafka-example/anotherPayloadDtoEndpoint") - .withSubjectHeader("Test Subject") - .build(); - } - - private static AsyncHeaders createCloudEventsBaseHeaders() { - return new AsyncHeadersForCloudEventsBuilder() - .withContentTypeHeader(MediaType.APPLICATION_JSON) - .withSpecVersionHeader("1.0") - .withIdHeader("1234-1234-1234") - .withTimeHeader("2015-07-20T15:49:04-07:00") - .build(); - } -} diff --git a/springwolf-examples/springwolf-kafka-example/src/test/java/io/github/stavshamir/springwolf/example/kafka/SpringContextIntegrationTest.java b/springwolf-examples/springwolf-kafka-example/src/test/java/io/github/stavshamir/springwolf/example/kafka/SpringContextIntegrationTest.java index b0e4b6ba8..67f22580d 100644 --- a/springwolf-examples/springwolf-kafka-example/src/test/java/io/github/stavshamir/springwolf/example/kafka/SpringContextIntegrationTest.java +++ b/springwolf-examples/springwolf-kafka-example/src/test/java/io/github/stavshamir/springwolf/example/kafka/SpringContextIntegrationTest.java @@ -16,33 +16,6 @@ public class SpringContextIntegrationTest { - @SpringBootTest(classes = SpringwolfKafkaExampleApplication.class) - @EmbeddedKafka( - partitions = 1, - brokerProperties = {"listeners=PLAINTEXT://localhost:9092", "port=9092"}) - @Nested - @DirtiesContext - 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(6); - } - } - @SpringBootTest(classes = SpringwolfKafkaExampleApplication.class) @EmbeddedKafka( partitions = 1, @@ -51,7 +24,6 @@ void testAllChannelsAreFound() { @DirtiesContext @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", @@ -76,8 +48,6 @@ void testContextWithApplicationProperties() { @Test void testAllChannelsAreFound() { - // 2 channels defined in the AsyncDocket are not found, - // however PRODUCER_TOPIC is also used in ExampleProducer (5 - 2 + 1 = 4) assertThat(asyncApiService.getAsyncAPI().getChannels()).hasSize(4); } } diff --git a/springwolf-examples/springwolf-kafka-example/src/test/resources/asyncapi.json b/springwolf-examples/springwolf-kafka-example/src/test/resources/asyncapi.json index d5529f6bb..fbdc9e901 100644 --- a/springwolf-examples/springwolf-kafka-example/src/test/resources/asyncapi.json +++ b/springwolf-examples/springwolf-kafka-example/src/test/resources/asyncapi.json @@ -59,72 +59,6 @@ } } }, - "example-consumer-topic": { - "publish": { - "operationId": "example-consumer-topic_publish", - "description": "Custom, optional description for this consumed topic", - "bindings": { - "kafka": { - "bindingVersion": "0.4.0" - } - }, - "message": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", - "name": "io.github.stavshamir.springwolf.example.kafka.dtos.ExamplePayloadDto", - "title": "ExamplePayloadDto", - "description": "Example payload model", - "payload": { - "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.kafka.dtos.ExamplePayloadDto" - }, - "headers": { - "$ref": "#/components/schemas/HeadersNotDocumented" - }, - "bindings": { - "kafka": { - "bindingVersion": "0.4.0" - } - } - } - }, - "bindings": { - "kafka": { - "bindingVersion": "0.4.0" - } - } - }, - "example-producer-topic": { - "subscribe": { - "operationId": "example-producer-topic_subscribe", - "description": "Custom, optional description for this produced to topic", - "bindings": { - "kafka": { - "bindingVersion": "0.4.0" - } - }, - "message": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", - "name": "io.github.stavshamir.springwolf.example.kafka.dtos.AnotherPayloadDto", - "title": "AnotherPayloadDto", - "description": "Another payload model", - "payload": { - "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.kafka.dtos.AnotherPayloadDto" - }, - "headers": { - "$ref": "#/components/schemas/CloudEventHeadersForAnotherPayloadDtoEndpoint" - }, - "bindings": { - "kafka": { - "bindingVersion": "0.4.0" - } - } - } - }, - "bindings": { - "kafka": { - "bindingVersion": "0.4.0" - } - } - }, "example-topic": { "publish": { "operationId": "example-topic_publish_receiveExamplePayload", @@ -279,132 +213,6 @@ }, "components": { "schemas": { - "CloudEventHeadersForAnotherPayloadDtoEndpoint": { - "type": "object", - "properties": { - "ce_id": { - "type": "string", - "description": "CloudEvent Id Header", - "example": "1234-1234-1234", - "enum": [ - "1234-1234-1234" - ] - }, - "ce_source": { - "type": "string", - "description": "CloudEvent Source Header", - "example": "springwolf-kafka-example/anotherPayloadDtoEndpoint", - "enum": [ - "springwolf-kafka-example/anotherPayloadDtoEndpoint" - ] - }, - "ce_specversion": { - "type": "string", - "description": "CloudEvent Spec Version Header", - "example": "1.0", - "enum": [ - "1.0" - ] - }, - "ce_subject": { - "type": "string", - "description": "CloudEvent Subject Header", - "example": "Test Subject", - "enum": [ - "Test Subject" - ] - }, - "ce_time": { - "type": "string", - "description": "CloudEvent Time Header", - "example": "2015-07-20T15:49:04-07:00", - "enum": [ - "2015-07-20T15:49:04-07:00" - ] - }, - "ce_type": { - "type": "string", - "description": "CloudEvent Payload Type Header", - "example": "io.github.stavshamir.springwolf.CloudEventHeadersForAnotherPayloadDtoEndpoint", - "enum": [ - "io.github.stavshamir.springwolf.CloudEventHeadersForAnotherPayloadDtoEndpoint" - ] - }, - "content-type": { - "type": "string", - "description": "CloudEvent Content-Type Header", - "example": "application/json", - "enum": [ - "application/json" - ] - } - }, - "example": { - "ce_id": "1234-1234-1234", - "ce_source": "springwolf-kafka-example/anotherPayloadDtoEndpoint", - "ce_specversion": "1.0", - "ce_subject": "Test Subject", - "ce_time": "2015-07-20T15:49:04-07:00", - "ce_type": "io.github.stavshamir.springwolf.CloudEventHeadersForAnotherPayloadDtoEndpoint", - "content-type": "application/json" - }, - "x-json-schema": { - "$schema": "https://json-schema.org/draft-04/schema#", - "name": "CloudEventHeadersForAnotherPayloadDtoEndpoint", - "properties": { - "ce_id": { - "description": "CloudEvent Id Header", - "enum": [ - "1234-1234-1234" - ], - "type": "string" - }, - "ce_source": { - "description": "CloudEvent Source Header", - "enum": [ - "springwolf-kafka-example/anotherPayloadDtoEndpoint" - ], - "type": "string" - }, - "ce_specversion": { - "description": "CloudEvent Spec Version Header", - "enum": [ - "1.0" - ], - "type": "string" - }, - "ce_subject": { - "description": "CloudEvent Subject Header", - "enum": [ - "Test Subject" - ], - "type": "string" - }, - "ce_time": { - "description": "CloudEvent Time Header", - "enum": [ - "2015-07-20T15:49:04-07:00" - ], - "type": "string" - }, - "ce_type": { - "description": "CloudEvent Payload Type Header", - "enum": [ - "io.github.stavshamir.springwolf.CloudEventHeadersForAnotherPayloadDtoEndpoint" - ], - "type": "string" - }, - "content-type": { - "description": "CloudEvent Content-Type Header", - "enum": [ - "application/json" - ], - "type": "string" - } - }, - "type": "object" - } - }, "HeadersNotDocumented": { "type": "object", "properties": { }, From 9e7c9956070ae5de70aa784c238535cd223fee13 Mon Sep 17 00:00:00 2001 From: Timon Back Date: Mon, 20 Nov 2023 20:58:56 +0100 Subject: [PATCH 2/3] chore: update build.gradle dependencies in examples --- springwolf-examples/springwolf-amqp-example/build.gradle | 3 +-- .../springwolf-cloud-stream-example/build.gradle | 9 ++++++--- .../springwolf-kafka-example/build.gradle | 2 -- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/springwolf-examples/springwolf-amqp-example/build.gradle b/springwolf-examples/springwolf-amqp-example/build.gradle index f5cdef724..c8b3aea71 100644 --- a/springwolf-examples/springwolf-amqp-example/build.gradle +++ b/springwolf-examples/springwolf-amqp-example/build.gradle @@ -20,12 +20,10 @@ dependencies { implementation "org.springframework.amqp:spring-rabbit" implementation "org.slf4j:slf4j-api:${slf4jApiVersion}" implementation "io.swagger.core.v3:swagger-annotations:${swaggerVersion}" - implementation "com.asyncapi:asyncapi-core:${asyncapiCoreVersion}" implementation "org.springframework.amqp:spring-amqp" implementation "org.springframework.boot:spring-boot-autoconfigure" implementation "org.springframework.boot:spring-boot" - implementation "org.springframework:spring-beans" implementation "org.springframework:spring-context" testRuntimeOnly "org.junit.jupiter:junit-jupiter:${junitJupiterVersion}" @@ -38,6 +36,7 @@ dependencies { testImplementation "org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}" testImplementation "org.springframework.boot:spring-boot-test" + testImplementation "org.springframework:spring-beans" testImplementation "org.springframework:spring-web" testImplementation "org.springframework:spring-test" diff --git a/springwolf-examples/springwolf-cloud-stream-example/build.gradle b/springwolf-examples/springwolf-cloud-stream-example/build.gradle index 1eca634eb..2f188bf60 100644 --- a/springwolf-examples/springwolf-cloud-stream-example/build.gradle +++ b/springwolf-examples/springwolf-cloud-stream-example/build.gradle @@ -18,7 +18,7 @@ dependencyManagement { } dependencies { - implementation project(":springwolf-core") + testImplementation project(":springwolf-core") runtimeOnly project(":springwolf-plugins:springwolf-cloud-stream") annotationProcessor project(":springwolf-plugins:springwolf-cloud-stream") @@ -27,16 +27,18 @@ dependencies { runtimeOnly "org.springframework.boot:spring-boot-starter-web" runtimeOnly "org.springframework.boot:spring-boot-starter-actuator" - implementation "com.asyncapi:asyncapi-core:${asyncapiCoreVersion}" implementation "org.apache.kafka:kafka-streams:${kafkaStreamsVersion}" implementation "org.slf4j:slf4j-api:${slf4jApiVersion}" implementation "io.swagger.core.v3:swagger-annotations:${swaggerVersion}" implementation "org.springframework.boot:spring-boot-autoconfigure" implementation "org.springframework.boot:spring-boot" - implementation "org.springframework:spring-beans" implementation "org.springframework:spring-context" + compileOnly "org.projectlombok:lombok:${lombokVersion}" + + annotationProcessor "org.projectlombok:lombok:${lombokVersion}" + testImplementation "org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}" testRuntimeOnly "org.junit.jupiter:junit-jupiter:${junitJupiterVersion}" @@ -45,6 +47,7 @@ dependencies { testImplementation "org.springframework.boot:spring-boot-test" testImplementation "org.springframework:spring-test" + testImplementation "org.springframework:spring-beans" testImplementation "org.springframework:spring-web" testImplementation "org.springframework.kafka:spring-kafka-test" testImplementation "org.testcontainers:testcontainers:${testcontainersVersion}" diff --git a/springwolf-examples/springwolf-kafka-example/build.gradle b/springwolf-examples/springwolf-kafka-example/build.gradle index dbb57c2b1..9e95286d3 100644 --- a/springwolf-examples/springwolf-kafka-example/build.gradle +++ b/springwolf-examples/springwolf-kafka-example/build.gradle @@ -23,7 +23,6 @@ dependencies { implementation "org.springframework:spring-beans" implementation "org.springframework:spring-context" - implementation "org.springframework:spring-web" implementation "org.springframework.boot:spring-boot" implementation "org.springframework.boot:spring-boot-autoconfigure" @@ -33,7 +32,6 @@ dependencies { implementation "org.springframework.security:spring-security-config" implementation "org.springframework.security:spring-security-web" - implementation "com.asyncapi:asyncapi-core:${asyncapiCoreVersion}" implementation "io.swagger.core.v3:swagger-annotations:${swaggerVersion}" implementation "org.slf4j:slf4j-api:${slf4jApiVersion}" From 8752659fd37879126d6a7b605498162b8130fecc Mon Sep 17 00:00:00 2001 From: Timon Back Date: Fri, 24 Nov 2023 10:23:54 +0100 Subject: [PATCH 3/3] chore(cloud-stream): revert custom springwolf.docket-info.title --- .../src/main/resources/application.properties | 2 +- .../src/test/resources/asyncapi.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/springwolf-examples/springwolf-cloud-stream-example/src/main/resources/application.properties b/springwolf-examples/springwolf-cloud-stream-example/src/main/resources/application.properties index 045b64f32..f9fe72611 100644 --- a/springwolf-examples/springwolf-cloud-stream-example/src/main/resources/application.properties +++ b/springwolf-examples/springwolf-cloud-stream-example/src/main/resources/application.properties @@ -16,7 +16,7 @@ spring.cloud.stream.bindings.consumerMethod-in-0.destination=another-topic # Springwolf configuration springwolf.enabled=true springwolf.docket.base-package=io.github.stavshamir.springwolf.example.cloudstream -springwolf.docket.info.title=Springwolf example project - CloudStream +springwolf.docket.info.title=${spring.application.name} springwolf.docket.info.version=1.0.0 springwolf.docket.info.description=Springwolf example project to demonstrate springwolfs abilities springwolf.docket.info.terms-of-service=http://asyncapi.org/terms diff --git a/springwolf-examples/springwolf-cloud-stream-example/src/test/resources/asyncapi.json b/springwolf-examples/springwolf-cloud-stream-example/src/test/resources/asyncapi.json index b1b6ffe67..6213321c1 100644 --- a/springwolf-examples/springwolf-cloud-stream-example/src/test/resources/asyncapi.json +++ b/springwolf-examples/springwolf-cloud-stream-example/src/test/resources/asyncapi.json @@ -1,7 +1,7 @@ { "asyncapi": "2.6.0", "info": { - "title": "Springwolf example project - CloudStream", + "title": "Springwolf example project - Cloud Stream", "version": "1.0.0", "description": "Springwolf example project to demonstrate springwolfs abilities", "contact": {