From c5e66ec65cdf27d09c71025b56184ff3e7769362 Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Sun, 16 Apr 2017 13:33:31 -0400 Subject: [PATCH] Fix Promise->Mono Test Name and Beans --- .../configuration/EnableIntegrationTests.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java index 1d4dd14b3e..b0c9ba525f 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -634,7 +634,7 @@ public class EnableIntegrationTests { } @Test - public void testPromiseGateway() throws Exception { + public void testMonoGateway() throws Exception { final AtomicReference> ref = new AtomicReference>(); final CountDownLatch consumeLatch = new CountDownLatch(1); @@ -649,7 +649,7 @@ public class EnableIntegrationTests { }); - assertTrue(consumeLatch.await(2, TimeUnit.SECONDS)); + assertTrue(consumeLatch.await(0, TimeUnit.SECONDS)); // runs on same thread List integers = ref.get(); assertEquals(5, integers.size()); @@ -1097,7 +1097,7 @@ public class EnableIntegrationTests { } @Bean - public DirectChannel promiseChannel() { + public DirectChannel monoChannel() { return new DirectChannel(); } @@ -1350,7 +1350,7 @@ public class EnableIntegrationTests { public void invalidBridgeAnnotationMethod(Object payload) {}*/ @Override - @ServiceActivator(inputChannel = "promiseChannel") + @ServiceActivator(inputChannel = "monoChannel") public Integer multiply(Integer value) { return value * 2; } @@ -1382,7 +1382,7 @@ public class EnableIntegrationTests { @Async void sendAsync(String payload); - @Gateway(requestChannel = "promiseChannel") + @Gateway(requestChannel = "monoChannel") Mono multiply(Integer value); } @@ -1637,11 +1637,13 @@ public class EnableIntegrationTests { this.regex = regex; } + @Override public boolean matches(Object o) { return ((String) o).matches(regex); } + @Override public void describeTo(Description description) { description.appendText("matches regex="); }