Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: switch examples to application properties configuration #466

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions springwolf-examples/springwolf-amqp-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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"

Expand Down

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