Skip to content

Commit c0decd8

Browse files
Merge branch '3.0.x' into main
2 parents 40ed5b7 + 28cc756 commit c0decd8

31 files changed

Lines changed: 38 additions & 41 deletions

File tree

beer_contracts/js/d3.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

beer_contracts/js/raphael-min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
org.gradle.daemon=false
22
BOM_VERSION=2021.0.0-SNAPSHOT
3-
bootVersion=2.6.0-M1
3+
bootVersion=2.6.0-M1

consumer_pact/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
org.gradle.daemon=false
22
BOM_VERSION=2021.0.0-SNAPSHOT
3-
bootVersion=2.6.0-M1
3+
bootVersion=2.6.0-M1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
org.gradle.daemon=false
22
BOM_VERSION=2021.0.0-SNAPSHOT
3-
bootVersion=2.6.0-M1
3+
bootVersion=2.6.0-M1

consumer_rabbit_middleware/src/test/java/com/example/ApplicationTests.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,12 @@
1616

1717
package com.example;
1818

19-
2019
import java.util.HashMap;
2120
import java.util.Map;
2221
import java.util.concurrent.TimeUnit;
2322

2423
import javax.annotation.Nullable;
2524

26-
import com.fasterxml.jackson.core.JsonProcessingException;
27-
import com.fasterxml.jackson.databind.ObjectMapper;
2825
import org.assertj.core.api.BDDAssertions;
2926
import org.awaitility.Awaitility;
3027
import org.junit.jupiter.api.Test;
@@ -51,7 +48,7 @@
5148
import org.springframework.test.context.DynamicPropertyRegistry;
5249
import org.springframework.test.context.DynamicPropertySource;
5350

54-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = { TestConfig.class, Application.class }, properties = "stubrunner.amqp.mockConnection=false")
51+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = {TestConfig.class, Application.class}, properties = "stubrunner.amqp.mockConnection=false")
5552
@AutoConfigureStubRunner(ids = "com.example:beer-api-producer-rabbit-middleware", stubsMode = StubRunnerProperties.StubsMode.LOCAL)
5653
@Testcontainers
5754
@ActiveProfiles("test")
@@ -77,7 +74,7 @@ public void contextLoads() {
7774

7875
Awaitility.await().untilAsserted(() -> {
7976
BDDAssertions.then(this.application.storedFoo).isNotNull();
80-
BDDAssertions.then(this.application.storedFoo.getFoo()).contains("example");
77+
BDDAssertions.then(this.application.storedFoo.getFoo()).isEqualTo("example");
8178
});
8279
}
8380
}
@@ -103,7 +100,7 @@ public Message receive(String destination, YamlContract contract) {
103100

104101
@Override
105102
public void send(Message message, String destination, @Nullable YamlContract contract) {
106-
rabbitTemplate.send(destination, message);
103+
rabbitTemplate.send(destination, message);
107104
}
108105

109106
@Override
@@ -112,12 +109,12 @@ public <T> void send(T payload, Map<String, Object> headers, String destination,
112109
MessageProperties messageProperties = new MessageProperties();
113110
newHeaders.forEach(messageProperties::setHeader);
114111
log.info("Sending a message to destination [{}] with routing key", destination);
115-
try {
116-
Message message = MessageBuilder.withBody(new ObjectMapper().writeValueAsBytes(payload)).andProperties(messageProperties).build();
112+
if (payload instanceof String) {
113+
String json = (String) payload;
114+
Message message = MessageBuilder.withBody(json.getBytes(StandardCharsets.UTF_8)).andProperties(messageProperties).build();
117115
send(message, destination, contract);
118-
}
119-
catch (JsonProcessingException e) {
120-
throw new IllegalStateException(e);
116+
} else {
117+
throw new IllegalStateException("Payload is not a String");
121118
}
122119
}
123120
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
org.gradle.daemon=false
22
BOM_VERSION=2021.0.0-SNAPSHOT
3-
bootVersion=2.6.0-M1
3+
bootVersion=2.6.0-M1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
org.gradle.daemon=false
22
BOM_VERSION=2021.0.0-SNAPSHOT
3-
bootVersion=2.6.0-M1
3+
bootVersion=2.6.0-M1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
org.gradle.daemon=false
22
BOM_VERSION=2021.0.0-SNAPSHOT
3-
bootVersion=2.6.0-M1
3+
bootVersion=2.6.0-M1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
org.gradle.daemon=false
22
BOM_VERSION=2021.0.0-SNAPSHOT
3-
bootVersion=2.6.0-M1
3+
bootVersion=2.6.0-M1

0 commit comments

Comments
 (0)