From 87d21324289d1bcbe4961ba30e6d7e595307cd61 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 31 Jul 2024 00:09:45 +0000 Subject: [PATCH] build(deps): upgrade `vertx` to 4.5.9 --- build.gradle | 2 +- .../internal/deploy/PendingDeployment.java | 17 +++++++++++++---- .../olingo/processor/ProcessorHelperTest.java | 2 ++ .../test/endpoint/openapi/PetStoreTest.java | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 701f9b42..fa35260b 100644 --- a/build.gradle +++ b/build.gradle @@ -39,7 +39,7 @@ repositories { dependencies { // Framework dependencies - def vertx_version = '4.5.7' + def vertx_version = '4.5.9' implementation group: 'io.vertx', name: 'vertx-core', version: vertx_version implementation group: 'io.vertx', name: 'vertx-web', version: vertx_version implementation group: 'io.vertx', name: 'vertx-web-client', version: vertx_version diff --git a/src/main/java/io/neonbee/internal/deploy/PendingDeployment.java b/src/main/java/io/neonbee/internal/deploy/PendingDeployment.java index a6b8a834..61ebdcdb 100644 --- a/src/main/java/io/neonbee/internal/deploy/PendingDeployment.java +++ b/src/main/java/io/neonbee/internal/deploy/PendingDeployment.java @@ -10,11 +10,13 @@ import io.neonbee.NeonBee; import io.neonbee.logging.LoggingFacade; import io.vertx.core.AsyncResult; +import io.vertx.core.Expectation; import io.vertx.core.Future; import io.vertx.core.Handler; import io.vertx.core.Promise; import io.vertx.core.Vertx; import io.vertx.core.impl.ContextInternal; +import io.vertx.core.impl.future.Expect; import io.vertx.core.impl.future.FutureInternal; import io.vertx.core.impl.future.Listener; @@ -55,6 +57,13 @@ public abstract class PendingDeployment extends Deployment implements FutureInte }); } + @Override + public Future expecting(Expectation expectation) { + Expect expect = new Expect(context(), expectation); + this.addListener(expect); + return expect; + } + @Override public final Future undeploy() { Deployable deployable = getDeployable(); @@ -85,6 +94,10 @@ public final Future undeploy() { */ protected abstract Future undeploy(String deploymentId); + private Future mapDeployment() { + return deployFuture.map((Deployment) this); + } + @Override public String getDeploymentId() { return deployFuture.result(); @@ -181,8 +194,4 @@ public void removeListener(Listener listener) { public Future timeout(long delay, TimeUnit unit) { return mapDeployment().timeout(delay, unit); } - - private Future mapDeployment() { - return deployFuture.map((Deployment) this); - } } diff --git a/src/test/java/io/neonbee/endpoint/odatav4/internal/olingo/processor/ProcessorHelperTest.java b/src/test/java/io/neonbee/endpoint/odatav4/internal/olingo/processor/ProcessorHelperTest.java index 032c91d4..a5d1f3f3 100644 --- a/src/test/java/io/neonbee/endpoint/odatav4/internal/olingo/processor/ProcessorHelperTest.java +++ b/src/test/java/io/neonbee/endpoint/odatav4/internal/olingo/processor/ProcessorHelperTest.java @@ -19,6 +19,7 @@ import io.neonbee.entity.EntityWrapper; import io.vertx.core.http.HttpServerRequest; import io.vertx.core.http.impl.HttpServerRequestInternal; +import io.vertx.core.net.HostAndPort; import io.vertx.ext.web.RoutingContext; import io.vertx.ext.web.impl.RouterImpl; import io.vertx.ext.web.impl.RoutingContextImpl; @@ -30,6 +31,7 @@ class ProcessorHelperTest { void transferResponseHint() { HttpServerRequest request = Mockito.mock(HttpServerRequestInternal.class); Mockito.when(request.path()).thenReturn("/path"); + Mockito.when(request.authority()).thenReturn(Mockito.mock(HostAndPort.class)); RouterImpl router = Mockito.mock(RouterImpl.class); Mockito.when(router.getAllowForward()).thenReturn(null); RoutingContext routingContext = new RoutingContextImpl(null, router, request, Set.of()); diff --git a/src/test/java/io/neonbee/test/endpoint/openapi/PetStoreTest.java b/src/test/java/io/neonbee/test/endpoint/openapi/PetStoreTest.java index 7deabd8a..1a80b5ed 100644 --- a/src/test/java/io/neonbee/test/endpoint/openapi/PetStoreTest.java +++ b/src/test/java/io/neonbee/test/endpoint/openapi/PetStoreTest.java @@ -71,7 +71,7 @@ void cycleTest(VertxTestContext testContext) { @DisplayName("should fail when passed parameters are invalid") void validationTest(VertxTestContext testContext) { String expectedErrorMsg = - "Error 400: The value of the request / response body is invalid. Reason: Instance does not have " + "Error 400: The value of the request body is invalid. Reason: Instance does not have " + "required property \"name\""; createPet(new JsonObject().put("invalidParam", PET1_NAME)) .onComplete(testContext.succeeding(resp -> testContext.verify(() -> {