Skip to content

Commit 4397807

Browse files
boaty82garyrussell
authored andcommitted
GH-2366 Fix failing test on Mac
Resolves #2366
1 parent 2480955 commit 4397807

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/ConnectionEventTests.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,20 @@ public void publishEvent(Object event) {
316316

317317
@Test
318318
public void testFailConnect() {
319-
TcpNetClientConnectionFactory ccf = new TcpNetClientConnectionFactory("junkjunk", 1234);
319+
AbstractClientConnectionFactory ccf = new AbstractClientConnectionFactory("junkjunk", 1234) {
320+
321+
@Override
322+
protected boolean isActive() {
323+
return true;
324+
}
325+
326+
@Override
327+
protected TcpConnectionSupport buildNewConnection() throws Exception {
328+
throw new UnknownHostException("Mocking for test ");
329+
}
330+
331+
};
332+
320333
final AtomicReference<ApplicationEvent> failEvent = new AtomicReference<ApplicationEvent>();
321334
ccf.setApplicationEventPublisher(new ApplicationEventPublisher() {
322335

0 commit comments

Comments
 (0)