Skip to content

Commit

Permalink
Update to Vert.x 4.5.1 also update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mcweba committed Jan 15, 2024
1 parent 5799d7c commit ab8b749
Show file tree
Hide file tree
Showing 39 changed files with 308 additions and 239 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import java.util.Set;
import java.util.concurrent.TimeUnit;

import static com.jayway.awaitility.Awaitility.await;
import static org.awaitility.Awaitility.await;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.mockito.Matchers.anyLong;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
* @author https://github.com/mcweba [Marc-Andre Weber]
*/
public class DummyHttpServerRequest implements FastFailHttpServerRequest {
public class DummyHttpServerRequest extends FastFailHttpServerRequest {

private Charset paramsCharset = StandardCharsets.UTF_8;
private MultiMap params;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,205 +27,215 @@
* methods you need to mock.
*
*/
public interface FastFailHttpServerRequest extends HttpServerRequest {
public abstract class FastFailHttpServerRequest extends HttpServerRequestInternal {

String msg = "Mock: Override this method to mock your expected behaviour.";


default HttpServerRequest exceptionHandler(Handler<Throwable> handler) {
public HttpServerRequest exceptionHandler(Handler<Throwable> handler) {
throw new UnsupportedOperationException( msg );
}

default HttpServerRequest handler(Handler<Buffer> handler) {
public HttpServerRequest handler(Handler<Buffer> handler) {
throw new UnsupportedOperationException( msg );
}

default HttpServerRequest pause() {
public HttpServerRequest pause() {
throw new UnsupportedOperationException( msg );
}

default HttpServerRequest resume() {
public HttpServerRequest resume() {
throw new UnsupportedOperationException( msg );
}

default HttpServerRequest fetch(long amount) {
public HttpServerRequest fetch(long amount) {
throw new UnsupportedOperationException( msg );
}

default HttpServerRequest endHandler(Handler<Void> endHandler) {
public HttpServerRequest endHandler(Handler<Void> endHandler) {
throw new UnsupportedOperationException( msg );
}

default HttpVersion version() {
public HttpVersion version() {
throw new UnsupportedOperationException( msg );
}

default HttpMethod method() {
public HttpMethod method() {
throw new UnsupportedOperationException( msg );
}

default String rawMethod() {
public String rawMethod() {
throw new UnsupportedOperationException( msg );
}

default boolean isSSL() {
public boolean isSSL() {
throw new UnsupportedOperationException( msg );
}

default @Nullable String scheme() {
public @Nullable String scheme() {
throw new UnsupportedOperationException( msg );
}

default String uri() {
public String uri() {
throw new UnsupportedOperationException( msg );
}

default @Nullable String path() {
public @Nullable String path() {
throw new UnsupportedOperationException( msg );
}

default @Nullable String query() {
public @Nullable String query() {
throw new UnsupportedOperationException( msg );
}

default @Nullable String host() {
public @Nullable String host() {
throw new UnsupportedOperationException( msg );
}

default long bytesRead() {
public long bytesRead() {
throw new UnsupportedOperationException( msg );
}

default HttpServerResponse response() {
public HttpServerResponse response() {
throw new UnsupportedOperationException( msg );
}

default MultiMap headers() {
public MultiMap headers() {
throw new UnsupportedOperationException( msg );
}

default @Nullable String getHeader(String headerName) {
public @Nullable String getHeader(String headerName) {
throw new UnsupportedOperationException( msg );
}

default String getHeader(CharSequence headerName) {
public String getHeader(CharSequence headerName) {
throw new UnsupportedOperationException( msg );
}

default MultiMap params() {
public MultiMap params() {
throw new UnsupportedOperationException( msg );
}

default @Nullable String getParam(String paramName) {
public @Nullable String getParam(String paramName) {
throw new UnsupportedOperationException( msg );
}

default SocketAddress remoteAddress() {
public SocketAddress remoteAddress() {
throw new UnsupportedOperationException( msg );
}

default SocketAddress localAddress() {
public SocketAddress localAddress() {
throw new UnsupportedOperationException( msg );
}

default SSLSession sslSession() {
public SSLSession sslSession() {
throw new UnsupportedOperationException( msg );
}

default X509Certificate[] peerCertificateChain() throws SSLPeerUnverifiedException {
public X509Certificate[] peerCertificateChain() throws SSLPeerUnverifiedException {
throw new UnsupportedOperationException( msg );
}

default String absoluteURI() {
public String absoluteURI() {
throw new UnsupportedOperationException( msg );
}

default NetSocket netSocket() {
public NetSocket netSocket() {
throw new UnsupportedOperationException( msg );
}

default HttpServerRequest setExpectMultipart(boolean expect) {
public HttpServerRequest setExpectMultipart(boolean expect) {
throw new UnsupportedOperationException( msg );
}

default boolean isExpectMultipart() {
public boolean isExpectMultipart() {
throw new UnsupportedOperationException( msg );
}

default HttpServerRequest uploadHandler(@Nullable Handler<HttpServerFileUpload> uploadHandler) {
public HttpServerRequest uploadHandler(@Nullable Handler<HttpServerFileUpload> uploadHandler) {
throw new UnsupportedOperationException( msg );
}

default MultiMap formAttributes() {
public MultiMap formAttributes() {
throw new UnsupportedOperationException( msg );
}

default @Nullable String getFormAttribute(String attributeName) {
public @Nullable String getFormAttribute(String attributeName) {
throw new UnsupportedOperationException( msg );
}

default ServerWebSocket upgrade() {
public ServerWebSocket upgrade() {
throw new UnsupportedOperationException( msg );
}

default boolean isEnded() {
public boolean isEnded() {
throw new UnsupportedOperationException( msg );
}

default HttpServerRequest customFrameHandler(Handler<HttpFrame> handler) {
public HttpServerRequest customFrameHandler(Handler<HttpFrame> handler) {
throw new UnsupportedOperationException( msg );
}

default HttpConnection connection() {
public HttpConnection connection() {
throw new UnsupportedOperationException( msg );
}

default HttpServerRequest streamPriorityHandler(Handler<StreamPriority> handler) {
public HttpServerRequest streamPriorityHandler(Handler<StreamPriority> handler) {
throw new UnsupportedOperationException( msg );
}


default Future<Buffer> body() {
public Future<Buffer> body() {
throw new UnsupportedOperationException( msg );
}


default Future<Void> end() {
public Future<Void> end() {
throw new UnsupportedOperationException( msg );
}


default Future<NetSocket> toNetSocket() {
public Future<NetSocket> toNetSocket() {
throw new UnsupportedOperationException( msg );
}


default Future<ServerWebSocket> toWebSocket() {
public Future<ServerWebSocket> toWebSocket() {
throw new UnsupportedOperationException( msg );
}


default DecoderResult decoderResult() {
public DecoderResult decoderResult() {
throw new UnsupportedOperationException( msg );
}


default @Nullable Cookie getCookie(String name) {
public @Nullable Cookie getCookie(String name) {
throw new UnsupportedOperationException( msg );
}


default @Nullable Cookie getCookie(String name, String domain, String path) {
public @Nullable Cookie getCookie(String name, String domain, String path) {
throw new UnsupportedOperationException( msg );
}


default Set<Cookie> cookies(String name) {
public Set<Cookie> cookies(String name) {
throw new UnsupportedOperationException( msg );
}


default Set<Cookie> cookies() {
public Set<Cookie> cookies() {
throw new UnsupportedOperationException( msg );
}

@Override
public Context context() {
throw new UnsupportedOperationException( msg );
}

@Override
public Object metric() {
throw new UnsupportedOperationException( msg );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,9 @@

import io.netty.handler.codec.http.QueryStringDecoder;
import io.vertx.codegen.annotations.Nullable;
import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.MultiMap;
import io.vertx.core.Promise;
import io.vertx.core.Vertx;
import io.vertx.core.*;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.http.Cookie;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.http.HttpClientResponse;
import io.vertx.core.http.HttpConnection;
import io.vertx.core.http.HttpMethod;
import io.vertx.core.http.HttpServerRequest;
import io.vertx.core.http.HttpServerResponse;
import io.vertx.core.http.HttpVersion;
import io.vertx.core.http.*;
import io.vertx.core.http.impl.headers.HeadersMultiMap;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
Expand All @@ -25,12 +13,7 @@
import io.vertx.core.net.SocketAddress;
import io.vertx.core.net.impl.SocketAddressImpl;
import io.vertx.ext.auth.User;
import io.vertx.ext.web.FileUpload;
import io.vertx.ext.web.LanguageHeader;
import io.vertx.ext.web.ParsedHeaderValues;
import io.vertx.ext.web.Route;
import io.vertx.ext.web.RoutingContext;
import io.vertx.ext.web.Session;
import io.vertx.ext.web.*;
import org.slf4j.Logger;

import javax.net.ssl.SSLSession;
Expand All @@ -40,7 +23,6 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.function.Function;

import static org.slf4j.LoggerFactory.getLogger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.swisspush.gateleen.core.http.DummyHttpServerResponse;
import org.swisspush.gateleen.core.storage.MockResourceStorage;

import static com.jayway.awaitility.Awaitility.await;
import static org.awaitility.Awaitility.await;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.equalTo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.swisspush.gateleen.core.lock.impl;

import com.jayway.awaitility.Duration;
import io.vertx.core.Future;
import io.vertx.core.Vertx;
import io.vertx.core.net.NetClientOptions;
Expand All @@ -21,7 +20,9 @@
import redis.clients.jedis.Jedis;
import redis.clients.jedis.exceptions.JedisConnectionException;

import static com.jayway.awaitility.Awaitility.await;
import java.time.Duration;

import static org.awaitility.Awaitility.await;
import static java.util.concurrent.TimeUnit.MILLISECONDS;

/**
Expand Down Expand Up @@ -249,6 +250,6 @@ public void testReleaseLockRespectingOwnership(TestContext context){
}

private void waitMaxUntilExpired(String key, long expireMs){
await().pollInterval(50, MILLISECONDS).atMost(new Duration(expireMs, MILLISECONDS)).until(() -> !jedis.exists(key));
await().pollInterval(50, MILLISECONDS).atMost(Duration.ofMillis(expireMs)).until(() -> !jedis.exists(key));
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.swisspush.gateleen.core.lock.lua;

import com.jayway.awaitility.Duration;
import java.time.Duration;
import io.vertx.ext.unit.junit.VertxUnitRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -10,7 +10,7 @@
import java.util.Collections;
import java.util.List;

import static com.jayway.awaitility.Awaitility.await;
import static org.awaitility.Awaitility.await;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
Expand Down Expand Up @@ -201,6 +201,6 @@ private Object evalScriptReleaseLock(String lock, String token){
}

private void waitMaxUntilExpired(String key, long expireMs){
await().pollInterval(50, MILLISECONDS).atMost(new Duration(expireMs, MILLISECONDS)).until(() -> !jedis.exists(key));
await().pollInterval(50, MILLISECONDS).atMost(Duration.ofMillis(expireMs)).until(() -> !jedis.exists(key));
}
}
Loading

0 comments on commit ab8b749

Please sign in to comment.