Skip to content

Commit 611676d

Browse files
authored
Fix DebeziumIO testWrongHost trying to connect real external address (#31365)
1 parent 98b5d5b commit 611676d

File tree

1 file changed

+13
-20
lines changed

1 file changed

+13
-20
lines changed

sdks/java/io/debezium/src/test/java/org/apache/beam/io/debezium/DebeziumReadSchemaTransformTest.java

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -188,26 +188,19 @@ public void testWrongPort() {
188188
}
189189

190190
@Test
191-
public void testWrongHost() throws Exception {
191+
public void testWrongHost() {
192192
Pipeline readPipeline = Pipeline.create();
193-
Exception ex =
194-
assertThrows(
195-
Exception.class,
196-
() -> {
197-
PCollectionRowTuple.empty(readPipeline)
198-
.apply(
199-
makePtransform(
200-
userName,
201-
password,
202-
database,
203-
databaseContainer.getMappedPort(port),
204-
"23.128.129.130"))
205-
.get("output");
206-
});
207-
Throwable lowestCause = ex.getCause();
208-
while (lowestCause.getCause() != null) {
209-
lowestCause = lowestCause.getCause();
210-
}
211-
assertThat(lowestCause.getMessage(), Matchers.containsString("Connection refused"));
193+
assertThrows(
194+
Exception.class,
195+
() ->
196+
PCollectionRowTuple.empty(readPipeline)
197+
.apply(
198+
makePtransform(
199+
userName,
200+
password,
201+
database,
202+
databaseContainer.getMappedPort(port),
203+
"169.254.254.254"))
204+
.get("output"));
212205
}
213206
}

0 commit comments

Comments
 (0)