Skip to content

Commit

Permalink
Fix DebeziumIO testWrongHost trying to connect real external address (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Abacn authored May 22, 2024
1 parent 98b5d5b commit 611676d
Showing 1 changed file with 13 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,26 +188,19 @@ public void testWrongPort() {
}

@Test
public void testWrongHost() throws Exception {
public void testWrongHost() {
Pipeline readPipeline = Pipeline.create();
Exception ex =
assertThrows(
Exception.class,
() -> {
PCollectionRowTuple.empty(readPipeline)
.apply(
makePtransform(
userName,
password,
database,
databaseContainer.getMappedPort(port),
"23.128.129.130"))
.get("output");
});
Throwable lowestCause = ex.getCause();
while (lowestCause.getCause() != null) {
lowestCause = lowestCause.getCause();
}
assertThat(lowestCause.getMessage(), Matchers.containsString("Connection refused"));
assertThrows(
Exception.class,
() ->
PCollectionRowTuple.empty(readPipeline)
.apply(
makePtransform(
userName,
password,
database,
databaseContainer.getMappedPort(port),
"169.254.254.254"))
.get("output"));
}
}

0 comments on commit 611676d

Please sign in to comment.