GH-2366 Fix failing test on Mac

Resolves https://github.com/spring-projects/spring-integration/issues/2366
This commit is contained in:
Kiel Boatman
2018-02-18 18:08:07 +00:00
committed by Gary Russell
parent 24809557fb
commit 4397807a57

View File

@@ -316,7 +316,20 @@ public class ConnectionEventTests {
@Test
public void testFailConnect() {
TcpNetClientConnectionFactory ccf = new TcpNetClientConnectionFactory("junkjunk", 1234);
AbstractClientConnectionFactory ccf = new AbstractClientConnectionFactory("junkjunk", 1234) {
@Override
protected boolean isActive() {
return true;
}
@Override
protected TcpConnectionSupport buildNewConnection() throws Exception {
throw new UnknownHostException("Mocking for test ");
}
};
final AtomicReference<ApplicationEvent> failEvent = new AtomicReference<ApplicationEvent>();
ccf.setApplicationEventPublisher(new ApplicationEventPublisher() {