Skip to content

Commit 79c38b0

Browse files
authored
fix: use different channel names in pubsub emulator integration tests (GoogleCloudPlatform#3878)
b/424814598
1 parent f89f202 commit 79c38b0

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/PubSubEmulator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public String resolveParameter(
124124
* operation.
125125
*/
126126
@Override
127-
public void afterAll(ExtensionContext extensionContext) throws Exception {
127+
public void afterAll(ExtensionContext extensionContext) {
128128
findAndDestroyEmulator();
129129
}
130130

@@ -136,7 +136,7 @@ private void findAndDestroyEmulator() {
136136
LOGGER.warn("Emulator process null after tests; nothing to terminate.");
137137
}
138138

139-
// find destory emulator process spawned by gcloud
139+
// find and destroy emulator process spawned by gcloud
140140
if (this.emulatorHostPort == null) {
141141
LOGGER.warn("Host/port null after the test.");
142142
} else {

spring-cloud-gcp-pubsub-stream-binder/src/test/java/com/google/cloud/spring/stream/binder/pubsub/PubSubMessageChannelBinderEmulatorIntegrationTests.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ void testSendAndReceiveWithHeaderMappingsConsumer() throws Exception {
106106
producerProps.getExtension().setAllowedHeaders(new String[]{"firstHeader", "secondHeader"});
107107

108108
BindingProperties outputBindingProperties = createProducerBindingProperties(producerProps);
109-
DirectChannel moduleOutputChannel = createBindableChannel("output", outputBindingProperties);
109+
DirectChannel moduleOutputChannel = createBindableChannel("output-consumer-mapping", outputBindingProperties);
110110

111111
BindingProperties inputBindingProperties = createConsumerBindingProperties(consumerProps);
112-
DirectChannel moduleInputChannel = createBindableChannel("input", inputBindingProperties);
112+
DirectChannel moduleInputChannel = createBindableChannel("input-consumer-mapping", inputBindingProperties);
113113

114114
Binding<MessageChannel> producerBinding = binder.bindProducer(String.format("foo%s0", getDestinationNameDelimiter()),
115115
moduleOutputChannel, producerProps);
116116
Binding<MessageChannel> consumerBinding = binder.bindConsumer(String.format("foo%s0", getDestinationNameDelimiter()),
117-
"test-group", moduleInputChannel,
117+
"test-group-consumer", moduleInputChannel,
118118
consumerProps);
119119

120120
Message<?> message = MessageBuilder.withPayload("insert some random stuff here")
@@ -124,7 +124,7 @@ void testSendAndReceiveWithHeaderMappingsConsumer() throws Exception {
124124
// Let the consumer actually bind to the producer before sending a msg
125125
binderBindUnbindLatency();
126126
CountDownLatch latch = new CountDownLatch(1);
127-
AtomicReference<Message<byte[]>> inboundMessageRef = new AtomicReference<Message<byte[]>>();
127+
AtomicReference<Message<byte[]>> inboundMessageRef = new AtomicReference<>();
128128
moduleInputChannel.subscribe(message1 -> {
129129
try {
130130
inboundMessageRef.set((Message<byte[]>) message1);
@@ -159,15 +159,15 @@ void testSendAndReceiveWithHeaderMappingsProducer() throws Exception {
159159
producerProps.getExtension().setAllowedHeaders(new String[]{"secondHeader"});
160160

161161
BindingProperties outputBindingProperties = createProducerBindingProperties(producerProps);
162-
DirectChannel moduleOutputChannel = createBindableChannel("output", outputBindingProperties);
162+
DirectChannel moduleOutputChannel = createBindableChannel("output-producer-mapping", outputBindingProperties);
163163

164164
BindingProperties inputBindingProperties = createConsumerBindingProperties(consumerProps);
165-
DirectChannel moduleInputChannel = createBindableChannel("input", inputBindingProperties);
165+
DirectChannel moduleInputChannel = createBindableChannel("input-producer-mapping", inputBindingProperties);
166166

167167
Binding<MessageChannel> producerBinding = binder.bindProducer(String.format("foo%s0", getDestinationNameDelimiter()),
168168
moduleOutputChannel, producerProps);
169169
Binding<MessageChannel> consumerBinding = binder.bindConsumer(String.format("foo%s0", getDestinationNameDelimiter()),
170-
"test-group", moduleInputChannel,
170+
"test-group-producer", moduleInputChannel,
171171
consumerProps);
172172

173173
Message<?> message = MessageBuilder.withPayload("insert some random stuff here")
@@ -177,7 +177,7 @@ void testSendAndReceiveWithHeaderMappingsProducer() throws Exception {
177177
// Let the consumer actually bind to the producer before sending a msg
178178
binderBindUnbindLatency();
179179
CountDownLatch latch = new CountDownLatch(1);
180-
AtomicReference<Message<byte[]>> inboundMessageRef = new AtomicReference<Message<byte[]>>();
180+
AtomicReference<Message<byte[]>> inboundMessageRef = new AtomicReference<>();
181181
moduleInputChannel.subscribe(message1 -> {
182182
try {
183183
inboundMessageRef.set((Message<byte[]>) message1);

0 commit comments

Comments
 (0)