Skip to content

Commit

Permalink
test(amqp): update asyncapi artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
timonback committed Aug 28, 2024
1 parent dd90f08 commit 610a7fa
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,14 @@ void asyncApiResourceJsonArtifactTest() throws IOException {
@Test
void asyncApiResourceYamlArtifactTest() throws IOException {
String url = "/springwolf/docs.yaml";
String actual = restTemplate
.getForObject(url, String.class)
.replaceAll("\r", "")
.trim();
String actual = restTemplate.getForObject(url, String.class);
String actualPatched = actual.replace(amqpHost + ":" + amqpPort, "amqp:5672");
Files.writeString(Path.of("src", "test", "resources", "asyncapi.actual.yaml"), actual);

String expected;
try (InputStream s = this.getClass().getResourceAsStream("/asyncapi.yaml")) {
assert s != null;
expected = new String(s.readAllBytes(), StandardCharsets.UTF_8)
.replaceAll("\r", "")
.trim();
expected = new String(s.readAllBytes(), StandardCharsets.UTF_8).trim() + "\n";
}

assertEquals(expected, actualPatched);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void testContextWithApplicationProperties() {

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,22 @@
}
}
},
"example-bindings-queue": {
"address": "example-bindings-queue",
"bindings": {
"amqp": {
"is": "queue",
"queue": {
"name": "example-bindings-queue",
"durable": false,
"exclusive": true,
"autoDelete": true,
"vhost": "/"
},
"bindingVersion": "0.3.0"
}
}
},
"example-queue": {
"address": "example-queue",
"messages": {
Expand Down Expand Up @@ -185,6 +201,38 @@
"bindingVersion": "0.3.0"
}
}
},
"queue-read": {
"address": "queue-read",
"bindings": {
"amqp": {
"is": "queue",
"queue": {
"name": "queue-read",
"durable": false,
"exclusive": false,
"autoDelete": false,
"vhost": "/"
},
"bindingVersion": "0.3.0"
}
}
},
"queue-update": {
"address": "queue-update",
"bindings": {
"amqp": {
"is": "queue",
"queue": {
"name": "queue-update",
"durable": true,
"exclusive": false,
"autoDelete": false,
"vhost": "/"
},
"bindingVersion": "0.3.0"
}
}
}
},
"components": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ info:
defaultContentType: application/json
servers:
amqp-server:
host: localhost:5672
host: amqp:5672
protocol: amqp
channels:
'#':
Expand Down Expand Up @@ -51,6 +51,18 @@ channels:
autoDelete: false
vhost: /
bindingVersion: 0.3.0
example-bindings-queue:
address: example-bindings-queue
bindings:
amqp:
is: queue
queue:
name: example-bindings-queue
durable: false
exclusive: true
autoDelete: true
vhost: /
bindingVersion: 0.3.0
example-queue:
address: example-queue
messages:
Expand Down Expand Up @@ -133,6 +145,30 @@ channels:
autoDelete: false
vhost: /
bindingVersion: 0.3.0
queue-read:
address: queue-read
bindings:
amqp:
is: queue
queue:
name: queue-read
durable: false
exclusive: false
autoDelete: false
vhost: /
bindingVersion: 0.3.0
queue-update:
address: queue-update
bindings:
amqp:
is: queue
queue:
name: queue-update
durable: true
exclusive: false
autoDelete: false
vhost: /
bindingVersion: 0.3.0
components:
schemas:
HeadersNotDocumented:
Expand Down

0 comments on commit 610a7fa

Please sign in to comment.