Skip to content
This repository was archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
Make SI Pub/Sub IT run in Cloud Pub/Sub (#685)
Browse files Browse the repository at this point in the history
A previous commit had made this change, but a posterior one with a bad
merge broke it.
As a result, it's not possible to build locally, where the emulator
is not running.
  • Loading branch information
joaoandremartins authored May 17, 2018
1 parent 706333f commit 72d891b
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ public class PubSubChannelAdaptersIntegrationTests {
GcpContextAutoConfiguration.class,
GcpPubSubAutoConfiguration.class))
.withUserConfiguration(
PubSubChannelAdaptersIntegrationTests.IntegrationConfiguration.class)
.withPropertyValues("spring.cloud.gcp.pubsub.emulator-host=${PUBSUB_EMULATOR_HOST}");
PubSubChannelAdaptersIntegrationTests.IntegrationConfiguration.class);

@BeforeClass
public static void enableTests() {
Expand All @@ -92,7 +91,8 @@ public void sendAndReceiveMessage() {
headers.put("sleep", "lift your skinny fists");

context.getBean("inputChannel", MessageChannel.class).send(
MessageBuilder.createMessage("I am a message.", new MessageHeaders(headers)));
MessageBuilder.createMessage("I am a message.",
new MessageHeaders(headers)));

Message<?> message =
context.getBean("outputChannel", PollableChannel.class).receive(5000);
Expand Down Expand Up @@ -152,16 +152,17 @@ public void sendAndReceiveMessageManualAck() {
@Test
public void sendAndReceiveMessagePublishCallback() {
this.contextRunner.run(context -> {
ListenableFutureCallback<String> callbackSpy = Mockito.spy(new ListenableFutureCallback<String>() {
@Override
public void onFailure(Throwable ex) {
ListenableFutureCallback<String> callbackSpy = Mockito.spy(
new ListenableFutureCallback<String>() {
@Override
public void onFailure(Throwable ex) {

}
}

@Override
public void onSuccess(String result) {
@Override
public void onSuccess(String result) {

}
}
});
context.getBean(PubSubMessageHandler.class).setPublishCallback(callbackSpy);
context.getBean("inputChannel", MessageChannel.class).send(
Expand Down

0 comments on commit 72d891b

Please sign in to comment.