Skip to content

Commit

Permalink
[MODINVOSTO-187] Remove unused import and rename static attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
Saba-Zedginidze-EPAM committed Nov 7, 2024
1 parent b419790 commit 6b43675
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/test/java/org/folio/rest/impl/AuditOutboxAPITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

import org.junit.jupiter.api.Test;

import io.restassured.http.ContentType;

public class AuditOutboxAPITest extends TestBase {

public static final String AUDIT_OUTBOX_ENDPOINT = "/invoice-storage/audit-outbox/process";
Expand Down
17 changes: 9 additions & 8 deletions src/test/java/org/folio/rest/impl/StorageTestSuite.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ public class StorageTestSuite {
private static final int port = NetworkUtils.nextFreePort();
public static final Header URL_TO_HEADER = new Header("X-Okapi-Url-to", "http://localhost:" + port);
private static TenantJob tenantJob;
public static EmbeddedKafkaCluster kafkaCluster;

public static EmbeddedKafkaCluster KAFKA_CLUSTER;
public static final String KAFKA_ENV_VALUE = "test-env";
private static final String KAFKA_HOST = "KAFKA_HOST";
private static final String KAFKA_PORT = "KAFKA_PORT";
private static final String KAFKA_ENV = "ENV";
private static final String OKAPI_URL_KEY = "OKAPI_URL";
public static final int mockPort = NetworkUtils.nextFreePort();
public static final int MOCK_KAFKA_PORT = NetworkUtils.nextFreePort();


private StorageTestSuite() {}
Expand Down Expand Up @@ -99,14 +100,14 @@ public static void before() throws InterruptedException, ExecutionException, Tim
vertx = Vertx.vertx();

log.info("Starting kafka cluster");
kafkaCluster = EmbeddedKafkaCluster.provisionWith(defaultClusterConfig());
kafkaCluster.start();
String[] hostAndPort = kafkaCluster.getBrokerList().split(":");
KAFKA_CLUSTER = EmbeddedKafkaCluster.provisionWith(defaultClusterConfig());
KAFKA_CLUSTER.start();
String[] hostAndPort = KAFKA_CLUSTER.getBrokerList().split(":");
System.setProperty(KAFKA_HOST, hostAndPort[0]);
System.setProperty(KAFKA_PORT, hostAndPort[1]);
System.setProperty(KAFKA_ENV, KAFKA_ENV_VALUE);
System.setProperty(OKAPI_URL_KEY, "http://localhost:" + mockPort);
log.info("Kafka cluster started with broker list: {}", kafkaCluster.getBrokerList());
System.setProperty(OKAPI_URL_KEY, "http://localhost:" + MOCK_KAFKA_PORT);
log.info("Kafka cluster started with broker list: {}", KAFKA_CLUSTER.getBrokerList());

log.info("Starting container database");
PostgresClient.setPostgresTester(new PostgresTesterContainer());
Expand All @@ -122,7 +123,7 @@ public static void before() throws InterruptedException, ExecutionException, Tim
@AfterAll
public static void after() throws InterruptedException, ExecutionException, TimeoutException {
log.info("Delete tenant");
kafkaCluster.stop();
KAFKA_CLUSTER.stop();
deleteTenant(tenantJob, TENANT_HEADER);

CompletableFuture<String> undeploymentComplete = new CompletableFuture<>();
Expand Down

0 comments on commit 6b43675

Please sign in to comment.