Skip to content

Commit

Permalink
[#noissue] Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Oct 14, 2024
1 parent 06584b0 commit 79e5bf5
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public Properties beforeAll() {

Properties properties = new Properties();
properties.setProperty("PORT", port.toString());
System.setProperty("PORT", port.toString());
System.getProperties().putAll(properties);
return properties;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public Properties beforeAll() {
final Integer port = cassandra.getMappedPort(CassandraContainer.CQL_PORT);
Properties properties = new Properties();
properties.setProperty("PORT", port.toString());
System.setProperty("PORT", port.toString());
System.getProperties().putAll(properties);

return properties;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public Properties beforeAll() {

Integer port = elasticsearchContainer.getMappedPort(ESServerContainerFactory.DEFAULT_PORT);
properties.setProperty("PORT", port.toString());
System.setProperty("PORT", port.toString());
System.getProperties().putAll(properties);
return properties;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public Properties beforeAll() {

Integer port = elasticsearchContainer.getMappedPort(ESServerContainerFactory.DEFAULT_PORT);
properties.setProperty("PORT", port.toString());
System.setProperty("PORT", port.toString());

System.getProperties().putAll(properties);
return properties;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ public Properties beforeAll() {
container.withLogConsumer(new LogOutputStream(LOGGER::info));
container.start();

Connection connection = null;
try {
connection = createConnection("localhost:" + container.getFirstMappedPort() + "/sysmaster", "informix", "in4mix");
try (Connection connection = createConnection("localhost:" + container.getFirstMappedPort() + "/sysmaster", "informix", "in4mix")) {
Statement statement = connection.createStatement();

List<String> tableQuery = createTableQuery();
Expand All @@ -59,19 +57,12 @@ public Properties beforeAll() {
}
} catch (Exception e) {
LOGGER.error("Failed to start testcontainer", e);
} finally {
if (connection != null) {
try {
connection.close();
} catch (SQLException ignored) {
}
}
}

Integer port = container.getFirstMappedPort();
Properties properties = new Properties();
properties.setProperty("PORT", port.toString());
System.setProperty("PORT", port.toString());
System.getProperties().putAll(properties);
return properties;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public Properties beforeAll() {
Properties properties = new Properties();
properties.setProperty("PORT", String.valueOf(server.getBrokerPort()));
properties.setProperty("OFFSET", String.valueOf(OFFSET_STORE.getOffset()));
System.setProperty("PORT", String.valueOf(server.getBrokerPort()));
System.setProperty("OFFSET", String.valueOf(OFFSET_STORE.getOffset()));
System.getProperties().putAll(properties);
return properties;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ public Properties beforeAll() {
Properties properties = new Properties();
properties.setProperty("PORT", String.valueOf(port));
properties.setProperty("OFFSET", String.valueOf(OFFSET_STORE.getOffset()));
System.setProperty("OFFSET", String.valueOf(OFFSET_STORE.getOffset()));
System.setProperty("PORT", String.valueOf(port));
System.getProperties().putAll(properties);
return properties;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Properties beforeAll() {

Properties properties = new Properties();
properties.setProperty("PORT", String.valueOf(port));
System.setProperty("PORT", String.valueOf(port));
System.getProperties().putAll(properties);
return properties;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public Properties beforeAll() {
int port = container.getFirstMappedPort();
Properties properties = new Properties();
properties.setProperty("PORT", String.valueOf(port));
System.setProperty("PORT", String.valueOf(port));
System.getProperties().putAll(properties);
return properties;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ public Properties beforeAll() {
Properties properties = new Properties();
properties.setProperty("HOST", redisServer.getHost());
properties.setProperty("PORT", String.valueOf(redisServer.getMappedPort(6379)));
System.setProperty("HOST", redisServer.getHost());
System.setProperty("PORT", String.valueOf(redisServer.getMappedPort(6379)));
System.getProperties().putAll(properties);

return properties;
}
Expand Down

0 comments on commit 79e5bf5

Please sign in to comment.