diff --git a/src/main/java/org/folio/inventory/DataImportConsumerVerticle.java b/src/main/java/org/folio/inventory/DataImportConsumerVerticle.java index b6764a42b..2f4576302 100644 --- a/src/main/java/org/folio/inventory/DataImportConsumerVerticle.java +++ b/src/main/java/org/folio/inventory/DataImportConsumerVerticle.java @@ -56,15 +56,12 @@ import io.vertx.core.Future; import io.vertx.core.Promise; import io.vertx.core.http.HttpClient; -import io.vertx.core.http.HttpClientOptions; import io.vertx.core.json.JsonObject; public class DataImportConsumerVerticle extends AbstractVerticle { private static final Logger LOGGER = LogManager.getLogger(DataImportConsumerVerticle.class); - private static final int DEFAULT_HTTP_TIMEOUT_IN_MILLISECONDS = 3000; - private static final List EVENT_TYPES = List.of( DI_INVENTORY_HOLDING_CREATED, DI_INVENTORY_HOLDING_MATCHED, @@ -108,8 +105,7 @@ public void start(Promise startPromise) { LOGGER.info(format("kafkaConfig: %s", kafkaConfig)); EventManager.registerKafkaEventPublisher(kafkaConfig, vertx, maxDistributionNumber); - HttpClientOptions params = new HttpClientOptions().setConnectTimeout(DEFAULT_HTTP_TIMEOUT_IN_MILLISECONDS); - HttpClient client = vertx.createHttpClient(params); + HttpClient client = vertx.createHttpClient(); Storage storage = Storage.basedUpon(vertx, config, client); String profileSnapshotExpirationTime = getCacheEnvVariable(config, "inventory.profile-snapshot-cache.expiration.time.seconds"); diff --git a/src/test/java/org/folio/inventory/dataimport/cache/JobProfileSnapshotCacheTest.java b/src/test/java/org/folio/inventory/dataimport/cache/JobProfileSnapshotCacheTest.java index 01b762696..6a73732a0 100644 --- a/src/test/java/org/folio/inventory/dataimport/cache/JobProfileSnapshotCacheTest.java +++ b/src/test/java/org/folio/inventory/dataimport/cache/JobProfileSnapshotCacheTest.java @@ -25,7 +25,6 @@ import io.vertx.core.Future; import io.vertx.core.Vertx; -import io.vertx.core.http.HttpClientOptions; import io.vertx.core.json.Json; import io.vertx.ext.unit.Async; import io.vertx.ext.unit.TestContext; @@ -39,7 +38,7 @@ public class JobProfileSnapshotCacheTest { private final Vertx vertx = Vertx.vertx(); private final ProfileSnapshotCache profileSnapshotCache = new ProfileSnapshotCache(vertx, - vertx.createHttpClient(new HttpClientOptions().setConnectTimeout(3000)), 3600); + vertx.createHttpClient(), 3600); @Rule public WireMockRule mockServer = new WireMockRule( diff --git a/src/test/java/org/folio/inventory/dataimport/cache/MappingMetadataCacheTest.java b/src/test/java/org/folio/inventory/dataimport/cache/MappingMetadataCacheTest.java index 94a43960c..ffb4451b0 100644 --- a/src/test/java/org/folio/inventory/dataimport/cache/MappingMetadataCacheTest.java +++ b/src/test/java/org/folio/inventory/dataimport/cache/MappingMetadataCacheTest.java @@ -22,7 +22,6 @@ import io.vertx.core.Future; import io.vertx.core.Vertx; -import io.vertx.core.http.HttpClientOptions; import io.vertx.core.json.Json; import io.vertx.ext.unit.Async; import io.vertx.ext.unit.TestContext; @@ -36,7 +35,7 @@ public class MappingMetadataCacheTest { private final Vertx vertx = Vertx.vertx(); private final MappingMetadataCache mappingMetadataCache = new MappingMetadataCache(vertx, - vertx.createHttpClient(new HttpClientOptions().setConnectTimeout(3000)), 3600); + vertx.createHttpClient(), 3600); @Rule public WireMockRule mockServer = new WireMockRule( diff --git a/src/test/java/org/folio/inventory/dataimport/consumers/DataImportKafkaHandlerTest.java b/src/test/java/org/folio/inventory/dataimport/consumers/DataImportKafkaHandlerTest.java index 3d9e4eb24..10b6f2c09 100644 --- a/src/test/java/org/folio/inventory/dataimport/consumers/DataImportKafkaHandlerTest.java +++ b/src/test/java/org/folio/inventory/dataimport/consumers/DataImportKafkaHandlerTest.java @@ -9,7 +9,6 @@ import io.vertx.core.Future; import io.vertx.core.Vertx; import io.vertx.core.http.HttpClient; -import io.vertx.core.http.HttpClientOptions; import io.vertx.core.json.Json; import io.vertx.core.json.JsonObject; import io.vertx.ext.unit.Async; @@ -133,7 +132,7 @@ public void setUp() { .maxRequestSize(1048576) .build(); - HttpClient client = vertx.createHttpClient(new HttpClientOptions().setConnectTimeout(3000)); + HttpClient client = vertx.createHttpClient(); dataImportKafkaHandler = new DataImportKafkaHandler(vertx, mockedStorage, client, new ProfileSnapshotCache(vertx, client, 3600), kafkaConfig, new MappingMetadataCache(vertx, client, 3600)); diff --git a/src/test/java/org/folio/inventory/dataimport/handlers/actions/CreateInstanceEventHandlerTest.java b/src/test/java/org/folio/inventory/dataimport/handlers/actions/CreateInstanceEventHandlerTest.java index 3fd62d712..5e0e99a77 100644 --- a/src/test/java/org/folio/inventory/dataimport/handlers/actions/CreateInstanceEventHandlerTest.java +++ b/src/test/java/org/folio/inventory/dataimport/handlers/actions/CreateInstanceEventHandlerTest.java @@ -10,7 +10,6 @@ import io.vertx.core.Future; import io.vertx.core.Vertx; -import io.vertx.core.http.HttpClientOptions; import io.vertx.core.json.Json; import io.vertx.core.json.JsonObject; import org.apache.http.HttpStatus; @@ -169,7 +168,7 @@ public void setUp() throws IOException { Vertx vertx = Vertx.vertx(); createInstanceEventHandler = new CreateInstanceEventHandler(storage, new PrecedingSucceedingTitlesHelper(context -> mockedClient), new MappingMetadataCache(vertx, - vertx.createHttpClient(new HttpClientOptions().setConnectTimeout(3000)), 3600), + vertx.createHttpClient(), 3600), instanceIdStorageService); diff --git a/src/test/java/org/folio/inventory/dataimport/handlers/actions/ReplaceInstanceEventHandlerTest.java b/src/test/java/org/folio/inventory/dataimport/handlers/actions/ReplaceInstanceEventHandlerTest.java index 51c57bcc6..eff6a34d7 100644 --- a/src/test/java/org/folio/inventory/dataimport/handlers/actions/ReplaceInstanceEventHandlerTest.java +++ b/src/test/java/org/folio/inventory/dataimport/handlers/actions/ReplaceInstanceEventHandlerTest.java @@ -9,11 +9,9 @@ import com.google.common.collect.Lists; import io.vertx.core.Vertx; -import io.vertx.core.http.HttpClientOptions; import io.vertx.core.json.Json; import io.vertx.core.json.JsonArray; import io.vertx.core.json.JsonObject; -import scala.concurrent.Promise; import org.apache.http.HttpStatus; import org.folio.ActionProfile; @@ -90,7 +88,6 @@ import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.atLeast; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -178,7 +175,7 @@ public void setUp() throws IOException { Vertx vertx = Vertx.vertx(); replaceInstanceEventHandler = new ReplaceInstanceEventHandler(storage, precedingSucceedingTitlesHelper, new MappingMetadataCache(vertx, - vertx.createHttpClient(new HttpClientOptions().setConnectTimeout(3000)), 3600)); + vertx.createHttpClient(), 3600)); doAnswer(invocationOnMock -> {