diff --git a/gateleen-cache/src/test/java/org/swisspush/gateleen/cache/storage/RedisCacheStorageTest.java b/gateleen-cache/src/test/java/org/swisspush/gateleen/cache/storage/RedisCacheStorageTest.java index 14beb5e33..25bdb8919 100644 --- a/gateleen-cache/src/test/java/org/swisspush/gateleen/cache/storage/RedisCacheStorageTest.java +++ b/gateleen-cache/src/test/java/org/swisspush/gateleen/cache/storage/RedisCacheStorageTest.java @@ -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; diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/DummyHttpServerRequest.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/DummyHttpServerRequest.java index 10ddd7371..0f1343aa4 100644 --- a/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/DummyHttpServerRequest.java +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/DummyHttpServerRequest.java @@ -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; diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/FastFailHttpServerRequest.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/FastFailHttpServerRequest.java index 278614af6..cb86b8ae9 100644 --- a/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/FastFailHttpServerRequest.java +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/FastFailHttpServerRequest.java @@ -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 handler) { + public HttpServerRequest exceptionHandler(Handler handler) { throw new UnsupportedOperationException( msg ); } - default HttpServerRequest handler(Handler handler) { + public HttpServerRequest handler(Handler 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 endHandler) { + public HttpServerRequest endHandler(Handler 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 uploadHandler) { + public HttpServerRequest uploadHandler(@Nullable Handler 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 handler) { + public HttpServerRequest customFrameHandler(Handler handler) { throw new UnsupportedOperationException( msg ); } - default HttpConnection connection() { + public HttpConnection connection() { throw new UnsupportedOperationException( msg ); } - default HttpServerRequest streamPriorityHandler(Handler handler) { + public HttpServerRequest streamPriorityHandler(Handler handler) { throw new UnsupportedOperationException( msg ); } - default Future body() { + public Future body() { throw new UnsupportedOperationException( msg ); } - default Future end() { + public Future end() { throw new UnsupportedOperationException( msg ); } - default Future toNetSocket() { + public Future toNetSocket() { throw new UnsupportedOperationException( msg ); } - default Future toWebSocket() { + public Future 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 cookies(String name) { + public Set cookies(String name) { throw new UnsupportedOperationException( msg ); } - default Set cookies() { + public Set cookies() { + throw new UnsupportedOperationException( msg ); + } + + @Override + public Context context() { + throw new UnsupportedOperationException( msg ); + } + + @Override + public Object metric() { throw new UnsupportedOperationException( msg ); } } diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/LocalHttpClientRequest.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/LocalHttpClientRequest.java index 3ae803547..4bc9060ca 100644 --- a/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/LocalHttpClientRequest.java +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/LocalHttpClientRequest.java @@ -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; @@ -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; @@ -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; diff --git a/gateleen-core/src/test/java/org/swisspush/gateleen/core/configuration/ConfigurationResourceManagerTest.java b/gateleen-core/src/test/java/org/swisspush/gateleen/core/configuration/ConfigurationResourceManagerTest.java index 24af3c429..64f041e07 100644 --- a/gateleen-core/src/test/java/org/swisspush/gateleen/core/configuration/ConfigurationResourceManagerTest.java +++ b/gateleen-core/src/test/java/org/swisspush/gateleen/core/configuration/ConfigurationResourceManagerTest.java @@ -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; diff --git a/gateleen-core/src/test/java/org/swisspush/gateleen/core/lock/impl/RedisBasedLockTest.java b/gateleen-core/src/test/java/org/swisspush/gateleen/core/lock/impl/RedisBasedLockTest.java index 6ff78e046..d0f0e2a32 100644 --- a/gateleen-core/src/test/java/org/swisspush/gateleen/core/lock/impl/RedisBasedLockTest.java +++ b/gateleen-core/src/test/java/org/swisspush/gateleen/core/lock/impl/RedisBasedLockTest.java @@ -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; @@ -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; /** @@ -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)); } } diff --git a/gateleen-core/src/test/java/org/swisspush/gateleen/core/lock/lua/ReleaseLockLuaScriptTests.java b/gateleen-core/src/test/java/org/swisspush/gateleen/core/lock/lua/ReleaseLockLuaScriptTests.java index 153f35385..a00dab468 100644 --- a/gateleen-core/src/test/java/org/swisspush/gateleen/core/lock/lua/ReleaseLockLuaScriptTests.java +++ b/gateleen-core/src/test/java/org/swisspush/gateleen/core/lock/lua/ReleaseLockLuaScriptTests.java @@ -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; @@ -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; @@ -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)); } } diff --git a/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/HookHandlerTest.java b/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/HookHandlerTest.java index eb522b61d..2b415844d 100644 --- a/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/HookHandlerTest.java +++ b/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/HookHandlerTest.java @@ -814,6 +814,16 @@ public Set removeCookies(String name, boolean invalidate) { } }; return new FastFailHttpServerRequest() { + @Override + public Context context() { + return null; + } + + @Override + public Object metric() { + return null; + } + @Override public HttpMethod method() { return method; diff --git a/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/ReducedPropagationManagerTest.java b/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/ReducedPropagationManagerTest.java index 3eda4e42c..8ed123d14 100644 --- a/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/ReducedPropagationManagerTest.java +++ b/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/ReducedPropagationManagerTest.java @@ -62,7 +62,7 @@ public void setUp() { public void testStartExpiredQueueProcessingInitiallyDisabled(TestContext context) { Mockito.when(reducedPropagationStorage.removeExpiredQueues(anyLong())) .thenReturn(Future.succeededFuture(MultiType.EMPTY_MULTI)); - verify(reducedPropagationStorage, timeout(1000).never()).removeExpiredQueues(anyLong()); + verify(reducedPropagationStorage, after(1000).never()).removeExpiredQueues(anyLong()); } @Test @@ -72,7 +72,7 @@ public void testStartExpiredQueueProcessing(TestContext context) { Mockito.when(reducedPropagationStorage.removeExpiredQueues(anyLong())) .thenReturn(Future.succeededFuture(MultiType.EMPTY_MULTI)); manager.startExpiredQueueProcessing(10); - verify(reducedPropagationStorage, timeout(110).atLeast(10)).removeExpiredQueues(anyLong()); + verify(reducedPropagationStorage, timeout(150).atLeast(10)).removeExpiredQueues(anyLong()); } @Test @@ -82,7 +82,7 @@ public void testExpiredQueueProcessingNotExecutedWhenLocked(TestContext context) Mockito.when(reducedPropagationStorage.removeExpiredQueues(anyLong())) .thenReturn(Future.succeededFuture(MultiType.EMPTY_MULTI)); manager.startExpiredQueueProcessing(10); - verify(reducedPropagationStorage, timeout(110).never()).removeExpiredQueues(anyLong()); + verify(reducedPropagationStorage, after(110).never()).removeExpiredQueues(anyLong()); } @Test @@ -126,7 +126,7 @@ public void testProcessIncomingRequestWithAddQueueStorageError(TestContext conte context.assertEquals(queue, queuesCaptor.getValue()); //verify queue request has not been stored to storage - verify(reducedPropagationStorage, timeout(1000).never()).storeQueueRequest(anyString(), any(JsonObject.class)); + verify(reducedPropagationStorage, after(1000).never()).storeQueueRequest(anyString(), any(JsonObject.class)); }); } @@ -275,7 +275,7 @@ public void testProcessIncomingRequestStartingExistingTimer(TestContext context) context.assertEquals(queue, queuesCaptor.getValue()); //verify queue request has not been stored to storage - verify(reducedPropagationStorage, timeout(1000).never()).storeQueueRequest(anyString(), any(JsonObject.class)); + verify(reducedPropagationStorage, after(1000).never()).storeQueueRequest(anyString(), any(JsonObject.class)); }); } @@ -311,7 +311,7 @@ public void testExpiredQueueProcessingGetQueueRequestFailure(TestContext context context.assertEquals("boom: getQueueRequest failed", event.result().body().getString(MESSAGE)); verify(reducedPropagationStorage, timeout(1000).times(1)).getQueueRequest(eq(expiredQueue)); - verify(reducedPropagationStorage, timeout(1000).never()).removeQueueRequest(anyString()); + verify(reducedPropagationStorage, after(1000).never()).removeQueueRequest(anyString()); verifyZeroInteractions(requestQueue); async.complete(); @@ -330,7 +330,7 @@ public void testExpiredQueueProcessingGetQueueRequestReturnsNull(TestContext con context.assertEquals("stored queue request for queue 'myExpiredQueue' is null", event.result().body().getString(MESSAGE)); verify(reducedPropagationStorage, timeout(1000).times(1)).getQueueRequest(eq(expiredQueue)); - verify(reducedPropagationStorage, timeout(1000).never()).removeQueueRequest(anyString()); + verify(reducedPropagationStorage, after(1000).never()).removeQueueRequest(anyString()); verifyZeroInteractions(requestQueue); async.complete(); @@ -354,9 +354,9 @@ public void testExpiredQueueProcessingDeleteAllQueueItemsOfManagerQueueFailure(T verify(reducedPropagationStorage, timeout(1000).times(1)).getQueueRequest(eq(expiredQueue)); verify(requestQueue, timeout(1000).times(1)).deleteAllQueueItems(eq(managerQueue), eq(false)); - verify(requestQueue, timeout(1000).never()).enqueueFuture(any(), any()); - verify(reducedPropagationStorage, timeout(1000).never()).removeQueueRequest(anyString()); - verify(requestQueue, timeout(1000).never()).deleteAllQueueItems(eq(expiredQueue), eq(true)); + verify(requestQueue, after(1000).never()).enqueueFuture(any(), any()); + verify(reducedPropagationStorage, after(1000).never()).removeQueueRequest(anyString()); + verify(requestQueue, after(1000).never()).deleteAllQueueItems(eq(expiredQueue), eq(true)); async.complete(); }); @@ -379,9 +379,9 @@ public void testExpiredQueueProcessingInvalidStoredQueueRequest(TestContext cont verify(reducedPropagationStorage, timeout(1000).times(1)).getQueueRequest(eq(expiredQueue)); verify(requestQueue, timeout(1000).times(1)).deleteAllQueueItems(eq(managerQueue), eq(false)); - verify(requestQueue, timeout(1000).never()).enqueueFuture(any(), any()); - verify(reducedPropagationStorage, timeout(1000).never()).removeQueueRequest(anyString()); - verify(requestQueue, timeout(1000).never()).deleteAllQueueItems(eq(expiredQueue), eq(true)); + verify(requestQueue, after(1000).never()).enqueueFuture(any(), any()); + verify(reducedPropagationStorage, after(1000).never()).removeQueueRequest(anyString()); + verify(requestQueue, after(1000).never()).deleteAllQueueItems(eq(expiredQueue), eq(true)); async.complete(); }); @@ -409,8 +409,8 @@ public void testExpiredQueueProcessingEnqueueIntoManagerQueueFailure(TestContext verify(requestQueue, timeout(1000).times(1)).deleteAllQueueItems(eq(managerQueue), eq(false)); verify(requestQueue, timeout(1000).times(1)).enqueueFuture(any(), eq(managerQueue)); - verify(reducedPropagationStorage, timeout(1000).never()).removeQueueRequest(anyString()); - verify(requestQueue, timeout(1000).never()).deleteAllQueueItems(eq(expiredQueue), eq(true)); + verify(reducedPropagationStorage, after(1000).never()).removeQueueRequest(anyString()); + verify(requestQueue, after(1000).never()).deleteAllQueueItems(eq(expiredQueue), eq(true)); async.complete(); }); diff --git a/gateleen-kafka/src/test/java/org/swisspush/gateleen/kafka/KafkaHandlerTest.java b/gateleen-kafka/src/test/java/org/swisspush/gateleen/kafka/KafkaHandlerTest.java index b90f945b1..502367176 100644 --- a/gateleen-kafka/src/test/java/org/swisspush/gateleen/kafka/KafkaHandlerTest.java +++ b/gateleen-kafka/src/test/java/org/swisspush/gateleen/kafka/KafkaHandlerTest.java @@ -28,7 +28,7 @@ import java.util.Map; import java.util.regex.Pattern; -import static com.jayway.awaitility.Awaitility.await; +import static org.awaitility.Awaitility.await; import static java.util.concurrent.TimeUnit.SECONDS; import static org.hamcrest.Matchers.equalTo; import static org.mockito.Matchers.eq; diff --git a/gateleen-logging/src/test/java/org/swisspush/gateleen/logging/DefaultLogAppenderRepositoryTest.java b/gateleen-logging/src/test/java/org/swisspush/gateleen/logging/DefaultLogAppenderRepositoryTest.java index a6c30c0e8..52605e0f7 100644 --- a/gateleen-logging/src/test/java/org/swisspush/gateleen/logging/DefaultLogAppenderRepositoryTest.java +++ b/gateleen-logging/src/test/java/org/swisspush/gateleen/logging/DefaultLogAppenderRepositoryTest.java @@ -9,8 +9,8 @@ import org.junit.Test; import org.junit.runner.RunWith; -import static com.jayway.awaitility.Awaitility.await; -import static com.jayway.awaitility.Duration.TWO_SECONDS; +import static org.awaitility.Awaitility.await; +import static org.awaitility.Durations.TWO_SECONDS; import static org.hamcrest.CoreMatchers.equalTo; import static org.swisspush.gateleen.logging.LoggingResourceManager.UPDATE_ADDRESS; diff --git a/gateleen-monitoring/src/test/java/org/swisspush/gateleen/monitoring/MonitoringHandlerTest.java b/gateleen-monitoring/src/test/java/org/swisspush/gateleen/monitoring/MonitoringHandlerTest.java index 3790f0e88..41f6483d5 100644 --- a/gateleen-monitoring/src/test/java/org/swisspush/gateleen/monitoring/MonitoringHandlerTest.java +++ b/gateleen-monitoring/src/test/java/org/swisspush/gateleen/monitoring/MonitoringHandlerTest.java @@ -1,6 +1,5 @@ package org.swisspush.gateleen.monitoring; -import com.jayway.awaitility.Duration; import io.vertx.core.Handler; import io.vertx.core.MultiMap; import io.vertx.core.Vertx; @@ -22,7 +21,8 @@ import java.util.Map; import java.util.concurrent.Callable; -import static com.jayway.awaitility.Awaitility.await; +import static org.awaitility.Awaitility.await; +import static org.awaitility.Durations.TWO_SECONDS; /** @@ -127,7 +127,7 @@ public void testWriteRequestPerRuleMonitoringToStorage(){ request.addHeader(PROPERTY_NAME, "my_value_123"); mh.updateRequestPerRuleMonitoring(request, "a_fancy_rule"); - await().atMost(Duration.TWO_SECONDS).until(storageContainsData("my_value_123.a_fancy_rule")); + await().atMost(TWO_SECONDS).until(storageContainsData("my_value_123.a_fancy_rule")); } private Callable storageContainsData(String valueToLookFor) { diff --git a/gateleen-player/pom.xml b/gateleen-player/pom.xml index 465edb93f..59fd10873 100644 --- a/gateleen-player/pom.xml +++ b/gateleen-player/pom.xml @@ -25,6 +25,10 @@ com.google.guava guava + + commons-io + commons-io + com.jayway.jsonpath json-path @@ -36,7 +40,7 @@ - com.jayway.awaitility + org.awaitility awaitility test diff --git a/gateleen-player/src/main/java/org/swisspush/gateleen/player/player/Client.java b/gateleen-player/src/main/java/org/swisspush/gateleen/player/player/Client.java index ff1e32034..753f802d3 100644 --- a/gateleen-player/src/main/java/org/swisspush/gateleen/player/player/Client.java +++ b/gateleen-player/src/main/java/org/swisspush/gateleen/player/player/Client.java @@ -1,6 +1,8 @@ package org.swisspush.gateleen.player.player; +import org.json.JSONException; import org.json.JSONObject; +import org.apache.commons.io.IOUtils; import org.slf4j.LoggerFactory; import org.springframework.http.*; import org.springframework.http.client.ClientHttpResponse; @@ -12,6 +14,7 @@ import org.springframework.web.client.RestTemplate; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -38,7 +41,11 @@ protected boolean supports(Class aClass) { @Override protected JSONObject readInternal(Class clazz, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException { - return new JSONObject(inputMessage.getBody()); + try { + return new JSONObject(IOUtils.toString(inputMessage.getBody(), StandardCharsets.UTF_8)); + } catch (JSONException e) { + throw new IOException(e); + } } @Override diff --git a/gateleen-player/src/test/java/org/swisspush/gateleen/player/CollectorTest.java b/gateleen-player/src/test/java/org/swisspush/gateleen/player/CollectorTest.java index f5698e471..b77459b5b 100644 --- a/gateleen-player/src/test/java/org/swisspush/gateleen/player/CollectorTest.java +++ b/gateleen-player/src/test/java/org/swisspush/gateleen/player/CollectorTest.java @@ -1,7 +1,6 @@ package org.swisspush.gateleen.player; import com.google.common.collect.FluentIterable; -import com.jayway.awaitility.Duration; import org.junit.Ignore; import org.junit.Test; import org.swisspush.gateleen.player.exchange.Exchange; @@ -15,7 +14,8 @@ import java.util.Iterator; import static com.google.common.base.Predicates.equalTo; -import static com.jayway.awaitility.Awaitility.await; +import static org.awaitility.Awaitility.await; +import static org.awaitility.Durations.FIVE_SECONDS; import static org.swisspush.gateleen.player.exchange.Exchange.*; /** @@ -35,7 +35,7 @@ public void testEventBusCollector() throws Exception { setExchangeHandler(new ExchangeHandler(){ @Override public boolean after(final Exchange exchange, final FluentIterable tailOutputLog) { - await().atMost(Duration.FIVE_SECONDS).until(() -> !tailOutputLog.filter(request(header("x-request-id", + await().atMost(FIVE_SECONDS).until(() -> !tailOutputLog.filter(request(header("x-request-id", equalTo(exchange.getRequest().getHeaders().get("x-request-id").get(0))))).isEmpty()); return true; } diff --git a/gateleen-playground/src/main/java/org/swisspush/gateleen/playground/Server.java b/gateleen-playground/src/main/java/org/swisspush/gateleen/playground/Server.java index fef85f11e..6decb174b 100755 --- a/gateleen-playground/src/main/java/org/swisspush/gateleen/playground/Server.java +++ b/gateleen-playground/src/main/java/org/swisspush/gateleen/playground/Server.java @@ -1,9 +1,6 @@ package org.swisspush.gateleen.playground; -import io.vertx.core.AbstractVerticle; -import io.vertx.core.Future; -import io.vertx.core.Handler; -import io.vertx.core.Vertx; +import io.vertx.core.*; import io.vertx.core.http.HttpClient; import io.vertx.core.http.HttpClientOptions; import io.vertx.core.http.HttpServer; diff --git a/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/QueueCircuitBreakerImplTest.java b/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/QueueCircuitBreakerImplTest.java index f9b95b308..2e8ac2c62 100644 --- a/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/QueueCircuitBreakerImplTest.java +++ b/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/QueueCircuitBreakerImplTest.java @@ -122,7 +122,7 @@ public void testLockingForPeriodicTimersSuccess(TestContext context) { ArgumentCaptor lockArguments = ArgumentCaptor.forClass(String.class); Mockito.verify(lock, timeout(1100).times(3)).acquireLock(lockArguments.capture(), Matchers.anyString(), Matchers.anyLong()); - Mockito.verify(lock, timeout(1100).never()).releaseLock(Matchers.anyString(), Matchers.anyString()); + Mockito.verify(lock, after(1100).never()).releaseLock(Matchers.anyString(), Matchers.anyString()); List lockValues = lockArguments.getAllValues(); context.assertTrue(lockValues.contains(QueueCircuitBreakerImpl.OPEN_TO_HALF_OPEN_TASK_LOCK)); diff --git a/gateleen-runconfig/src/main/java/org/swisspush/gateleen/runconfig/RunConfig.java b/gateleen-runconfig/src/main/java/org/swisspush/gateleen/runconfig/RunConfig.java index c5e9c593d..97f4a5766 100755 --- a/gateleen-runconfig/src/main/java/org/swisspush/gateleen/runconfig/RunConfig.java +++ b/gateleen-runconfig/src/main/java/org/swisspush/gateleen/runconfig/RunConfig.java @@ -434,6 +434,8 @@ public static JsonObject buildRedisquesConfig() { .processorAddress(Address.queueProcessorAddress()) .httpRequestHandlerEnabled(true) .httpRequestHandlerPort(7015) + .redisReconnectAttempts(-1) + .redisPoolRecycleTimeoutMs(-1) .build() .asJsonObject(); } @@ -445,6 +447,8 @@ public static JsonObject buildStorageConfig() { return new ModuleConfiguration() .storageType(ModuleConfiguration.StorageType.redis) .storageAddress(Address.storageAddress() + "-main") + .redisReconnectAttempts(-1) + .redisPoolRecycleTimeoutMs(-1) .asJsonObject(); } diff --git a/gateleen-test/pom.xml b/gateleen-test/pom.xml index 35d04a63f..586950500 100644 --- a/gateleen-test/pom.xml +++ b/gateleen-test/pom.xml @@ -156,7 +156,7 @@ - com.jayway.awaitility + org.awaitility awaitility diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/TestUtils.java b/gateleen-test/src/test/java/org/swisspush/gateleen/TestUtils.java index efc604d82..5e71c2d76 100644 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/TestUtils.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/TestUtils.java @@ -1,7 +1,6 @@ package org.swisspush.gateleen; import com.google.common.collect.ImmutableMap; -import com.jayway.awaitility.Duration; import io.vertx.core.json.JsonArray; import io.vertx.core.json.JsonObject; import org.slf4j.Logger; @@ -15,8 +14,9 @@ import java.util.Set; import java.util.regex.Pattern; -import static com.jayway.awaitility.Awaitility.await; +import static org.awaitility.Awaitility.await; import static io.restassured.RestAssured.*; +import static org.awaitility.Durations.FIVE_SECONDS; import static org.hamcrest.CoreMatchers.equalTo; public class TestUtils { @@ -197,7 +197,7 @@ public static JsonObject createRoutingRule(ImmutableMap String.valueOf(when().get(request).getStatusCode()), equalTo(String.valueOf(statusCode))); } diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/core/resource/CopyResourceTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/core/resource/CopyResourceTest.java index 4b1e9ad6f..51625d02c 100644 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/core/resource/CopyResourceTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/core/resource/CopyResourceTest.java @@ -2,7 +2,6 @@ import org.swisspush.gateleen.AbstractTest; import org.swisspush.gateleen.TestUtils; -import com.jayway.awaitility.Duration; import io.restassured.RestAssured; import io.vertx.core.json.JsonObject; import io.vertx.ext.unit.Async; @@ -11,11 +10,12 @@ import org.junit.Test; import org.junit.runner.RunWith; +import java.time.Duration; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; -import static com.jayway.awaitility.Awaitility.await; +import static org.awaitility.Awaitility.await; import static io.restassured.RestAssured.*; import static org.hamcrest.CoreMatchers.equalTo; @@ -200,6 +200,6 @@ public String createCopyTaskBody(String source, String destination, Map when().get(requestUrl).getStatusCode(), equalTo(statusCode)); + await().atMost(Duration.ofSeconds(2)).until(() -> when().get(requestUrl).getStatusCode(), equalTo(statusCode)); } } diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/core/storage/ExpirationTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/core/storage/ExpirationTest.java index e59cb5174..9c80d3304 100644 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/core/storage/ExpirationTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/core/storage/ExpirationTest.java @@ -11,9 +11,9 @@ import java.util.concurrent.TimeUnit; -import static com.jayway.awaitility.Awaitility.await; -import static com.jayway.awaitility.Duration.FIVE_SECONDS; +import static org.awaitility.Awaitility.await; import static io.restassured.RestAssured.*; +import static org.awaitility.Durations.FIVE_SECONDS; import static org.hamcrest.CoreMatchers.equalTo; @RunWith(VertxUnitRunner.class) diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/expansion/ExpandDeltaTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/expansion/ExpandDeltaTest.java index 87ef0e56a..5cead4ca3 100644 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/expansion/ExpandDeltaTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/expansion/ExpandDeltaTest.java @@ -19,9 +19,9 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; -import static com.jayway.awaitility.Awaitility.await; -import static com.jayway.awaitility.Duration.TEN_SECONDS; +import static org.awaitility.Awaitility.await; import static io.restassured.RestAssured.*; +import static org.awaitility.Durations.TEN_SECONDS; import static org.hamcrest.CoreMatchers.*; import static org.hamcrest.Matchers.greaterThan; import static org.junit.Assert.assertNotNull; diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/expansion/ExpandZipTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/expansion/ExpandZipTest.java index f71e21d75..68c38e850 100644 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/expansion/ExpandZipTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/expansion/ExpandZipTest.java @@ -2,7 +2,6 @@ import org.swisspush.gateleen.AbstractTest; import org.swisspush.gateleen.TestUtils; -import com.jayway.awaitility.Duration; import io.restassured.response.Response; import io.vertx.core.buffer.Buffer; import io.vertx.core.json.JsonObject; @@ -16,8 +15,9 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; -import static com.jayway.awaitility.Awaitility.await; +import static org.awaitility.Awaitility.await; import static io.restassured.RestAssured.*; +import static org.awaitility.Durations.FIVE_SECONDS; import static org.hamcrest.CoreMatchers.*; /** @@ -215,6 +215,6 @@ private void init() { * @param statusCode */ private void checkGETStatusCodeWithAwait(final String request, final Integer statusCode) { - await().atMost(Duration.FIVE_SECONDS).until(() -> String.valueOf(when().get(request).getStatusCode()), equalTo(String.valueOf(statusCode))); + await().atMost(FIVE_SECONDS).until(() -> String.valueOf(when().get(request).getStatusCode()), equalTo(String.valueOf(statusCode))); } } diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/hook/HookPersistenceTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/hook/HookPersistenceTest.java index 133465266..f8ec12bb0 100644 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/hook/HookPersistenceTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/hook/HookPersistenceTest.java @@ -2,7 +2,6 @@ import org.swisspush.gateleen.AbstractTest; import org.swisspush.gateleen.TestUtils; -import com.jayway.awaitility.Duration; import io.restassured.RestAssured; import io.vertx.core.json.JsonObject; import io.vertx.ext.unit.Async; @@ -11,8 +10,9 @@ import org.junit.Test; import org.junit.runner.RunWith; -import static com.jayway.awaitility.Awaitility.await; +import static org.awaitility.Awaitility.await; import static io.restassured.RestAssured.*; +import static org.awaitility.Durations.FIVE_SECONDS; import static org.hamcrest.CoreMatchers.equalTo; /** @@ -380,7 +380,7 @@ public void testHookCleanupRoutes(TestContext context) { * @param statusCode */ private void checkGETStatusCodeWithAwait(final String request, final Integer statusCode) { - await().atMost(Duration.FIVE_SECONDS).until(() -> { + await().atMost(FIVE_SECONDS).until(() -> { System.out.println(request); return String.valueOf(RestAssured.get(request).getStatusCode()); }, equalTo(String.valueOf(statusCode))); diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/hook/HookQueueingStrategiesTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/hook/HookQueueingStrategiesTest.java index 96f30def3..c09efccce 100644 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/hook/HookQueueingStrategiesTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/hook/HookQueueingStrategiesTest.java @@ -1,12 +1,12 @@ package org.swisspush.gateleen.hook; import com.google.common.collect.ImmutableMap; -import com.jayway.awaitility.Awaitility; import io.restassured.RestAssured; import io.vertx.core.json.JsonObject; import io.vertx.ext.unit.Async; import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.junit.VertxUnitRunner; +import org.awaitility.Awaitility; import org.junit.Test; import org.junit.runner.RunWith; import org.swisspush.gateleen.AbstractTest; @@ -157,7 +157,7 @@ public void testReducedPropagationQueueingStrategy(TestContext context) { // after 5s an unlocked manager queue with a single queue item should exist and the original queue should be empty // and its lock should have been deleted - Awaitility.await().until(() -> when().get("pushnotification/queuing/queues/").then().assertThat().body("queues", hasItem(managerQueue))); + Awaitility.await().untilAsserted(() -> when().get("pushnotification/queuing/queues/").then().assertThat().body("queues", hasItem(managerQueue))); given().urlEncodingEnabled(true).when().get("pushnotification/queuing/queues/" + managerQueue) .then().assertThat() .body(managerQueue, hasSize(1)); @@ -192,7 +192,7 @@ public void testReducedPropagationQueueingStrategy(TestContext context) { // after another 5s the unlocked manager queue with a single queue item should still exist and the original queue should be empty // and its lock should have been deleted TestUtils.waitSomeTime(5); - Awaitility.await().until(() -> when().get("pushnotification/queuing/queues/").then().assertThat().body("queues", hasItem(managerQueue))); + Awaitility.await().untilAsserted(() -> when().get("pushnotification/queuing/queues/").then().assertThat().body("queues", hasItem(managerQueue))); given().urlEncodingEnabled(true).when().get("pushnotification/queuing/queues/" + managerQueue) .then().assertThat() .body(managerQueue, hasSize(1)); diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/hook/ListenerTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/hook/ListenerTest.java index 89a234233..2ef58ec1b 100755 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/hook/ListenerTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/hook/ListenerTest.java @@ -3,8 +3,7 @@ import com.github.tomakehurst.wiremock.client.WireMock; import com.github.tomakehurst.wiremock.junit.WireMockRule; import com.google.common.collect.ImmutableMap; -import com.jayway.awaitility.Awaitility; -import com.jayway.awaitility.Duration; +import org.awaitility.Awaitility; import io.restassured.RestAssured; import io.restassured.http.Header; import io.restassured.http.Headers; @@ -24,8 +23,10 @@ import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.stubbing.Scenario.STARTED; -import static com.jayway.awaitility.Awaitility.await; +import static org.awaitility.Awaitility.await; import static io.restassured.RestAssured.*; +import static org.awaitility.Durations.FIVE_SECONDS; +import static org.awaitility.Durations.TEN_SECONDS; import static org.hamcrest.CoreMatchers.*; @@ -649,7 +650,7 @@ public void testDeadLock(TestContext context) { delete(url); given().body(body).put(url); System.out.println(index); - Awaitility.given().ignoreExceptions().await().atMost(Duration.FIVE_SECONDS).until( + Awaitility.given().ignoreExceptions().await().atMost(FIVE_SECONDS).until( () -> RestAssured.get(target + "/atest").then().extract().jsonPath().getString("name"), is("test")); } @@ -926,7 +927,7 @@ private void checkPUTStatusCode(String requestUrl, String body, int statusCode, * @param statusCode */ private void checkGETStatusCodeWithAwait(final String request, final Integer statusCode) { - await().atMost(Duration.FIVE_SECONDS).until(() -> String.valueOf(when().get(request).getStatusCode()), equalTo(String.valueOf(statusCode))); + await().atMost(FIVE_SECONDS).until(() -> String.valueOf(when().get(request).getStatusCode()), equalTo(String.valueOf(statusCode))); } /** @@ -937,6 +938,6 @@ private void checkGETStatusCodeWithAwait(final String request, final Integer sta * @param body */ private void checkGETBodyWithAwait(final String requestUrl, final String body) { - await().atMost(Duration.TEN_SECONDS).until(() -> when().get(requestUrl).then().extract().body().asString(), equalTo(body)); + await().atMost(TEN_SECONDS).until(() -> when().get(requestUrl).then().extract().body().asString(), equalTo(body)); } } diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/hook/RouteTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/hook/RouteTest.java index 85bbf6aa8..14db93c52 100644 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/hook/RouteTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/hook/RouteTest.java @@ -1,8 +1,7 @@ package org.swisspush.gateleen.hook; import com.google.common.collect.ImmutableMap; -import com.jayway.awaitility.Awaitility; -import com.jayway.awaitility.Duration; +import org.awaitility.Awaitility; import io.restassured.RestAssured; import io.restassured.http.Header; import io.restassured.http.Headers; @@ -20,6 +19,8 @@ import java.util.regex.Pattern; import static io.restassured.RestAssured.*; +import static org.awaitility.Durations.TEN_SECONDS; +import static org.awaitility.Durations.TWO_SECONDS; import static org.hamcrest.CoreMatchers.containsString; /** @@ -108,8 +109,7 @@ public void testRouteWithStaticHeaders(TestContext context) { TestUtils.registerRoute(requestUrl, target, methods, staticHeaders); // - - Awaitility.given().await().atMost(Duration.TWO_SECONDS).until(() -> + Awaitility.given().await().atMost(TWO_SECONDS).untilAsserted(() -> when().get(routedResource).then().assertThat() .statusCode(200) .body(containsString("x-test1")) @@ -148,7 +148,7 @@ public void testRouteWithMatchingHeadersFilter(TestContext context) { String body2 = "{ \"name\" : \"routePathTest\"}"; given().headers(Headers.headers(new Header("x-foo", "A"))).body(body2).put(routedResource).then().assertThat().statusCode(200); - Awaitility.given().await().atMost(Duration.TEN_SECONDS).until(() -> { + Awaitility.given().await().atMost(TEN_SECONDS).untilAsserted(() -> { given().headers(Headers.headers(new Header("x-foo", "A"))).when().get(routedResource).then().assertThat().body(containsString(body2)); when().get(checkTarget).then().assertThat().body(containsString(body2)); }); @@ -183,7 +183,7 @@ public void testRouteWithValidPath(TestContext context) { String body2 = "{ \"name\" : \"routePathTest\"}"; given().body(body2).put(routedResource).then().assertThat().statusCode(200); - Awaitility.given().await().atMost(Duration.TWO_SECONDS).until(() -> { + Awaitility.given().await().atMost(TWO_SECONDS).untilAsserted(() -> { when().get(routedResource).then().assertThat().body(containsString(body2)); when().get(checkTarget).then().assertThat().body(containsString(body2)); }); @@ -224,7 +224,7 @@ public void testRoute(TestContext context) { */ String body1 = "{ \"name\" : \"routeTest 1\"}"; given().body(body1).put(routedResource).then().assertThat().statusCode(200); - Awaitility.given().await().atMost(Duration.TWO_SECONDS).until(() -> { + Awaitility.given().await().atMost(TWO_SECONDS).untilAsserted(() -> { when().get(routedResource).then().assertThat().body(containsString(body1)); when().get(checkTarget).then().assertThat().statusCode(404); }); @@ -246,7 +246,7 @@ public void testRoute(TestContext context) { */ String body2 = "{ \"name\" : \"routeTest 2\"}"; given().body(body2).put(routedResource).then().assertThat().statusCode(200); - Awaitility.given().await().atMost(Duration.TWO_SECONDS).until(() -> { + Awaitility.given().await().atMost(TWO_SECONDS).untilAsserted(() -> { when().get(routedResource).then().assertThat().body(containsString(body2)); when().get(checkTarget).then().assertThat().body(containsString(body2)); }); @@ -258,7 +258,7 @@ public void testRoute(TestContext context) { * ------- */ delete(routedResource).then().assertThat().statusCode(200); - Awaitility.given().await().atMost(Duration.TWO_SECONDS).until(() -> { + Awaitility.given().await().atMost(TWO_SECONDS).untilAsserted(() -> { when().get(routedResource).then().assertThat().statusCode(404); when().get(checkTarget).then().assertThat().statusCode(404); }); @@ -279,7 +279,7 @@ public void testRoute(TestContext context) { */ String body3 = "{ \"name\" : \"routeTest 3\"}"; given().body(body3).put(routedResource).then().assertThat().statusCode(200); - Awaitility.given().await().atMost(Duration.TWO_SECONDS).until(() -> { + Awaitility.given().await().atMost(TWO_SECONDS).untilAsserted(() -> { when().get(routedResource).then().assertThat().body(containsString(body3)); when().get(checkTarget).then().assertThat().statusCode(404); delete(routedResource); @@ -316,7 +316,7 @@ public void testRouteWithTranslateStatus(TestContext context) { TestUtils.registerRoute(requestUrl, target, methods); // since no translateStatus was defined, the resource should not be found and return a 404 - Awaitility.given().await().atMost(Duration.TWO_SECONDS).until(() -> + Awaitility.given().await().atMost(TWO_SECONDS).untilAsserted(() -> when().get(routedResource).then().assertThat() .statusCode(404) ); @@ -327,7 +327,7 @@ public void testRouteWithTranslateStatus(TestContext context) { TestUtils.registerRoute(requestUrl, target, methods, null, true, false, translateStatus); // with translateStatus defined, the response status code should have changed from 404 to 405 - Awaitility.given().await().atMost(Duration.TWO_SECONDS).until(() -> + Awaitility.given().await().atMost(TWO_SECONDS).untilAsserted(() -> when().get(routedResource).then().assertThat() .statusCode(405) ); diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/hookjs/HookJsSteps.java b/gateleen-test/src/test/java/org/swisspush/gateleen/hookjs/HookJsSteps.java index e7682c273..4f655fec2 100644 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/hookjs/HookJsSteps.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/hookjs/HookJsSteps.java @@ -8,7 +8,6 @@ package org.swisspush.gateleen.hookjs; -import com.jayway.awaitility.Duration; import io.restassured.RestAssured; import io.restassured.http.ContentType; import cucumber.api.java.After; @@ -22,7 +21,8 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; -import static com.jayway.awaitility.Awaitility.given; +import static org.awaitility.Awaitility.given; +import static org.awaitility.Durations.TWO_SECONDS; import static org.hamcrest.core.IsEqual.equalTo; public class HookJsSteps { @@ -45,7 +45,7 @@ public void chromeHasBeenStarted() throws Throwable { @And("^the hook-js UI is displayed$") public void theHookJsUIIsDisplayed() throws Throwable { webDriver.get(PLAYGROUND_URL + "/hooktest.html"); - given().await().atMost(Duration.TWO_SECONDS).until(() -> + given().await().atMost(TWO_SECONDS).until(() -> webDriver.findElement(By.xpath("/html/body/div/div/div/div[1]")).getText(), equalTo("Hook JS Demo") ); @@ -59,7 +59,7 @@ public void weClickOnTheButton(String buttonId) throws Throwable { @Then("^we see the message \"([^\"]*)\" at position (\\d+)$") public void weSeeTheMessageAtPosition(String message, int indexOfMessage) throws Throwable { - given().await().atMost(Duration.TWO_SECONDS).until(() -> + given().await().atMost(TWO_SECONDS).until(() -> webDriver.findElement(By.xpath("//*[@id=\"hookjs messages\"]/li[" + indexOfMessage + "]")).getText(), equalTo(message)); @@ -67,7 +67,7 @@ public void weSeeTheMessageAtPosition(String message, int indexOfMessage) throws @Then("^we see no message at position (\\d+)$") public void weSeeNoMessageAtPosition(int indexOfMessage) throws Throwable { - given().await().atMost(Duration.TWO_SECONDS).until(() -> + given().await().atMost(TWO_SECONDS).until(() -> webDriver.findElements(By.xpath("//*[@id=\"hookjs messages\"]/li[" + indexOfMessage + "]")).size(), equalTo(0)); } diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/queue/QueueTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/queue/QueueTest.java index a5b0278de..de9f8007d 100644 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/queue/QueueTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/queue/QueueTest.java @@ -12,11 +12,11 @@ import java.util.Set; -import static com.jayway.awaitility.Awaitility.await; -import static com.jayway.awaitility.Duration.*; +import static org.awaitility.Awaitility.await; import static io.restassured.RestAssured.*; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; +import static org.awaitility.Durations.*; import static org.hamcrest.CoreMatchers.*; @RunWith(VertxUnitRunner.class) diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/queue/expiry/ResourceQueueExpiryTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/queue/expiry/ResourceQueueExpiryTest.java index 87ac60615..06f3c173f 100644 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/queue/expiry/ResourceQueueExpiryTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/queue/expiry/ResourceQueueExpiryTest.java @@ -1,6 +1,5 @@ package org.swisspush.gateleen.queue.expiry; -import com.jayway.awaitility.Duration; import io.restassured.RestAssured; import io.vertx.ext.unit.Async; import io.vertx.ext.unit.TestContext; @@ -13,9 +12,9 @@ import java.util.HashMap; import java.util.Map; -import static com.jayway.awaitility.Awaitility.await; -import static com.jayway.awaitility.Duration.TEN_SECONDS; +import static org.awaitility.Awaitility.await; import static io.restassured.RestAssured.*; +import static org.awaitility.Durations.*; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.hasItem; @@ -45,7 +44,7 @@ public void initRestAssured() { * @param body */ private void checkGETBodyWithAwait(final String requestUrl, final String body) { - await().atMost(Duration.FIVE_SECONDS).until(() -> when().get(requestUrl).then().extract().body().asString(), equalTo(body)); + await().atMost(FIVE_SECONDS).until(() -> when().get(requestUrl).then().extract().body().asString(), equalTo(body)); } /** @@ -127,7 +126,7 @@ public void testQueueExpiry(TestContext context) { // ---- // wait 2 seconds - await().timeout(Duration.TWO_SECONDS); + await().timeout(TWO_SECONDS); // check if the two items are in the queue when().get("queuing/queues/").then().assertThat().body("queues", hasItem("gateleen-queue-expiry-test-discard")); @@ -188,7 +187,7 @@ public void testQueueExpiryOverride_requestIsExpired_beforeRegularExpiryTime(Tes given().headers(headers).body(discardedBody).when().put(discardedRequestUrl); // wait 2 seconds - await().timeout(Duration.TWO_SECONDS); + await().timeout(TWO_SECONDS); // check if item is still in queue - yes when().get("queuing/queues/").then().assertThat().body("queues", hasItem(name)); @@ -236,7 +235,7 @@ public void testQueueExpiryOverride_requestIsNotExpired_regularResourceExpiry(Te given().headers(headers).body(discardedBody).when().put(discardedRequestUrl); // wait 2 seconds - await().timeout(Duration.TWO_SECONDS); + await().timeout(TWO_SECONDS); // check if item is still in queue - yes when().get("queuing/queues/").then().assertThat().body("queues", hasItem(name)); diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/routing/RequestHopValidationTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/routing/RequestHopValidationTest.java index 967e42935..daef24e78 100644 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/routing/RequestHopValidationTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/routing/RequestHopValidationTest.java @@ -1,8 +1,7 @@ package org.swisspush.gateleen.routing; import com.google.common.collect.ImmutableMap; -import com.jayway.awaitility.Awaitility; -import com.jayway.awaitility.Duration; +import org.awaitility.Awaitility; import io.restassured.RestAssured; import io.vertx.core.json.JsonObject; import io.vertx.ext.unit.Async; @@ -14,6 +13,7 @@ import org.swisspush.gateleen.TestUtils; import static io.restassured.RestAssured.*; +import static org.awaitility.Durations.ONE_SECOND; import static org.hamcrest.CoreMatchers.*; import static org.hamcrest.core.IsEqual.equalTo; import static org.swisspush.gateleen.core.util.HttpRequestHeader.X_HOPS; @@ -81,19 +81,19 @@ public void testRequestHopValidationLimitExceeded(TestContext context) { when().get("/loop/4/resource").then().assertThat().statusCode(200); // get the test data via looping rules - Awaitility.given().await().atMost(Duration.ONE_SECOND).until(() -> + Awaitility.given().await().atMost(ONE_SECOND).untilAsserted(() -> when().get("/loop/1/resource").then().assertThat() .statusCode(500) .statusLine(containsString("Request hops limit exceeded")) .body(containsString(buildLimitExceededMessage(2))) ); - Awaitility.given().await().atMost(Duration.ONE_SECOND).until(() -> + Awaitility.given().await().atMost(ONE_SECOND).untilAsserted(() -> when().get("/loop/2/resource").then().assertThat() .statusCode(500) .statusLine(containsString("Request hops limit exceeded")) .body(containsString(buildLimitExceededMessage(2))) ); - Awaitility.given().await().atMost(Duration.ONE_SECOND).until(() -> + Awaitility.given().await().atMost(ONE_SECOND).untilAsserted(() -> when().get("/loop/3/resource").then().assertThat() .statusCode(200) .body(not(containsString(buildLimitExceededMessage(2)))) @@ -206,14 +206,14 @@ public void testRequestHopValidationWithLimitZero(TestContext context) { with().body("{\"request.hops.limit\":0}").put(ROUTING_CONFIG).then().assertThat().statusCode(200); // prepare test data - Awaitility.given().await().atMost(Duration.ONE_SECOND).until(() -> + Awaitility.given().await().atMost(ONE_SECOND).untilAsserted(() -> with().body("{\"someKey\":"+System.currentTimeMillis()+"}").put("/loop/4/resource").then().assertThat() .statusCode(500) .statusLine(containsString("Request hops limit exceeded")) .body(containsString(buildLimitExceededMessage(0))) ); - Awaitility.given().await().atMost(Duration.ONE_SECOND).until(() -> + Awaitility.given().await().atMost(ONE_SECOND).untilAsserted(() -> when().get("/loop/4/resource").then().assertThat() .statusCode(500) .statusLine(containsString("Request hops limit exceeded")) @@ -241,7 +241,7 @@ public void testRequestHopValidationManualHeaderValue(TestContext context) { TestUtils.putRoutingRules(rules); // configure request hops limit to 10 - Awaitility.given().await().atMost(Duration.ONE_SECOND).until(() -> + Awaitility.given().await().atMost(ONE_SECOND).untilAsserted(() -> with().body("{\"request.hops.limit\":10}").put(ROUTING_CONFIG).then().assertThat().statusCode(200) ); validateRoutingConfig(true, 10); diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/routing/RuleUpdateTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/routing/RuleUpdateTest.java index f87673fce..881f72464 100644 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/routing/RuleUpdateTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/routing/RuleUpdateTest.java @@ -7,7 +7,11 @@ import io.vertx.core.buffer.Buffer; import io.vertx.core.http.HttpServer; import io.vertx.core.http.HttpServerResponse; +import io.vertx.ext.unit.Async; +import io.vertx.ext.unit.TestContext; +import io.vertx.ext.unit.junit.VertxUnitRunner; import org.junit.*; +import org.junit.runner.RunWith; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -23,6 +27,7 @@ import static java.nio.charset.StandardCharsets.ISO_8859_1; import static java.nio.charset.StandardCharsets.UTF_8; +@RunWith(VertxUnitRunner.class) public class RuleUpdateTest { private static final Logger logger = LoggerFactory.getLogger(RuleUpdateTest.class); @@ -56,7 +61,8 @@ public RuleUpdateTest() { } @BeforeClass - public static void mockServerIsRunning() throws IOException, InterruptedException { + public static void mockServerIsRunning(TestContext context) throws IOException, InterruptedException { + Async async = context.async(); RestAssured.port = port; RestAssured.registerParser("application/json; charset=utf-8", Parser.JSON); RestAssured.defaultParser = Parser.JSON; @@ -78,12 +84,19 @@ public static void mockServerIsRunning() throws IOException, InterruptedExceptio writeDataToResponse(rsp, largeResource, buf, vBuf); // write first part of data, and this will trigger the drainHandler rsp.drainHandler(event -> writeDataToResponse(rsp, largeResource, buf, vBuf)); }); - httpServer.listen(upstreamPort, upstreamHost); + httpServer.listen(upstreamPort, upstreamHost, event -> { + if (event.succeeded()) { + async.complete(); + } else { + context.fail("Server not listening on port " + upstreamPort); + } + }); logger.info("Mock httpServer.listen( {}, \"{}\")", upstreamPort, upstreamHost); // Then register that server as a static route. putCustomUpstreamRoute(); // Give it some time to properly initialize. Thread.sleep(42); + async.awaitSuccess(); } private static boolean writeDataToResponse(HttpServerResponse rsp, InputStream largeResource, byte[] buf, Buffer vBuf) { diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/scheduler/SchedulerTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/scheduler/SchedulerTest.java index 5d491b1db..6ebd3dbce 100644 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/scheduler/SchedulerTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/scheduler/SchedulerTest.java @@ -12,7 +12,7 @@ import java.util.Calendar; import java.util.Date; -import static com.jayway.awaitility.Awaitility.await; +import static org.awaitility.Awaitility.await; import static io.restassured.RestAssured.*; import static java.util.concurrent.TimeUnit.SECONDS; import static org.hamcrest.Matchers.*; diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/user/RoleProfileTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/user/RoleProfileTest.java index 159ce462e..8e45c5298 100644 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/user/RoleProfileTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/user/RoleProfileTest.java @@ -2,7 +2,6 @@ import org.swisspush.gateleen.AbstractTest; import org.swisspush.gateleen.TestUtils; -import com.jayway.awaitility.Duration; import io.restassured.RestAssured; import io.restassured.response.Response; import io.vertx.ext.unit.Async; @@ -11,10 +10,11 @@ import org.junit.Test; import org.junit.runner.RunWith; -import java.util.concurrent.TimeUnit; +import java.time.Duration; -import static com.jayway.awaitility.Awaitility.await; +import static org.awaitility.Awaitility.await; import static io.restassured.RestAssured.*; +import static org.awaitility.Durations.FIVE_SECONDS; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.nullValue; @@ -90,7 +90,7 @@ public void testUpdateRoleProfileGetUserWithTheSameRole(TestContext context) thr // we have to wait here, cause the role profile needs to be published over the vert.x bus RestAssured.requestSpecification.basePath("/server/users/v1"); - await().atMost(new Duration(8, TimeUnit.SECONDS)).until(() -> given().header("x-rp-grp", "z-gateleen-known-role,z-gateleen-admin").when().get("known-user/profile").then().extract().body().jsonPath().getString("foo"), equalTo(roleProfilePropertyValue)); + await().atMost(Duration.ofSeconds(8)).until(() -> given().header("x-rp-grp", "z-gateleen-known-role,z-gateleen-admin").when().get("known-user/profile").then().extract().body().jsonPath().getString("foo"), equalTo(roleProfilePropertyValue)); async.complete(); } @@ -106,7 +106,7 @@ public void testUpdateRoleProfileGetUserWithAnotherRole(TestContext context) thr // we have to wait here, cause the role profile needs to be published over the vert.x bus RestAssured.requestSpecification.basePath("/server/users/v1"); - await().atMost(new Duration(5, TimeUnit.SECONDS)).until(() -> given().header("x-rp-grp", "z-gateleen-admin").when().get("known-user/profile").then().extract().body().jsonPath().getString("foo"), nullValue()); + await().atMost(FIVE_SECONDS).until(() -> given().header("x-rp-grp", "z-gateleen-admin").when().get("known-user/profile").then().extract().body().jsonPath().getString("foo"), nullValue()); async.complete(); } @@ -157,7 +157,7 @@ public void testAddRoleProfileGetUserProfileAndPutItThenDeleteRoleProfileAndGetT // we have to wait here, cause the role profile needs to be published over the vert.x bus System.out.println("get the known-user profile, after deletion of known-role profile"); RestAssured.requestSpecification.basePath("/server/users/v1"); - await().atMost(new Duration(5, TimeUnit.SECONDS)).until(() -> given().header("x-rp-grp", "z-gateleen-known-role,z-gateleen-admin").when().get("known-user/profile").then().extract().body().jsonPath().getString("foo"), nullValue()); + await().atMost(FIVE_SECONDS).until(() -> given().header("x-rp-grp", "z-gateleen-known-role,z-gateleen-admin").when().get("known-user/profile").then().extract().body().jsonPath().getString("foo"), nullValue()); async.complete(); } diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/user/UserProfileTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/user/UserProfileTest.java index a739bc34b..6fb577b3e 100644 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/user/UserProfileTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/user/UserProfileTest.java @@ -1,7 +1,6 @@ package org.swisspush.gateleen.user; import org.swisspush.gateleen.AbstractTest; -import com.jayway.awaitility.Duration; import io.restassured.RestAssured; import io.restassured.response.Response; import io.vertx.core.json.JsonObject; @@ -13,8 +12,9 @@ import java.util.concurrent.TimeUnit; -import static com.jayway.awaitility.Awaitility.await; +import static org.awaitility.Awaitility.await; import static io.restassured.RestAssured.*; +import static org.awaitility.Durations.FIVE_SECONDS; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.nullValue; @@ -118,7 +118,7 @@ public void testAddAllAllowedAttributesAndOneNotAllowedAttribute(TestContext con // we have to wait here, cause the role profile needs to be published over the vert.x bus System.out.println("get the known-user profile, after deletion of known-role profile"); RestAssured.requestSpecification.basePath("/server/users/v1"); - await().atMost(new Duration(5, TimeUnit.SECONDS)).until(() -> given().header("x-rp-grp", "z-gateleen-known-role,z-gateleen-admin").when().get("known-user/profile").then().extract().body().jsonPath().getString("attrSetByClient"), nullValue()); + await().atMost(FIVE_SECONDS).until(() -> given().header("x-rp-grp", "z-gateleen-known-role,z-gateleen-admin").when().get("known-user/profile").then().extract().body().jsonPath().getString("attrSetByClient"), nullValue()); given().header("x-rp-grp", "z-gateleen-known-role,z-gateleen-admin").when().get("known-user/profile").then().assertThat().body("username", equalTo("username")).body("personalNumber", equalTo(testPersonalNumber)).body("mail", equalTo("mail")).body("department", equalTo("department")).body("lang", equalTo("lang")).body("tour", equalTo("tour")).body("zip", equalTo("zip")) .body("context", equalTo("context")).body("contextIsDefault", equalTo("contextIsDefault")).body("passkeyChanged", equalTo("passkeyChanged")).body("volumeBeep", equalTo("volumeBeep")).body("torchMode", equalTo("torchMode")).body("spn", equalTo("spn")); diff --git a/gateleen-testhelper/pom.xml b/gateleen-testhelper/pom.xml index f97dfc63e..61a466534 100644 --- a/gateleen-testhelper/pom.xml +++ b/gateleen-testhelper/pom.xml @@ -26,7 +26,7 @@ vertx-unit - com.jayway.awaitility + org.awaitility awaitility diff --git a/gateleen-validation/src/test/java/org/swisspush/gateleen/validation/mocks/HttpServerRequestMock.java b/gateleen-validation/src/test/java/org/swisspush/gateleen/validation/mocks/HttpServerRequestMock.java index 6d1e86e24..b2ce1b07e 100755 --- a/gateleen-validation/src/test/java/org/swisspush/gateleen/validation/mocks/HttpServerRequestMock.java +++ b/gateleen-validation/src/test/java/org/swisspush/gateleen/validation/mocks/HttpServerRequestMock.java @@ -1,6 +1,7 @@ package org.swisspush.gateleen.validation.mocks; import io.vertx.codegen.annotations.Nullable; +import io.vertx.core.Context; import io.vertx.core.Handler; import io.vertx.core.MultiMap; import io.vertx.core.buffer.Buffer; @@ -18,7 +19,7 @@ * * @author https://github.com/mcweba [Marc-Andre Weber] */ -public class HttpServerRequestMock implements FastFailHttpServerRequest { +public class HttpServerRequestMock extends FastFailHttpServerRequest { private String bodyContent; @@ -217,4 +218,13 @@ public HttpServerRequest exceptionHandler(Handler handler) { throw new UnsupportedOperationException(); } + @Override + public Context context() { + throw new UnsupportedOperationException(); + } + + @Override + public Object metric() { + throw new UnsupportedOperationException(); + } } diff --git a/pom.xml b/pom.xml index a3caa0344..38aef7661 100644 --- a/pom.xml +++ b/pom.xml @@ -51,10 +51,41 @@ localhost 7012 /usr/local/bin/chromedriver + 1.5.8 + 4.2.0 + 2.15.1 + 3.14.0 + 1.3.0 + 1.16.0 + 1.2.6 + 0.3 + 1.10 + 33.0.0-jre + 2.2 + 2.17.2 + 2.19.0 + 2.16.1 + 3.7.0 + 9.4.53.v20231009 + 7.0.2 + 0.1.1 + 4.13.2 + 20231013 + 2.4.10 + 2.12.6 + 2.6.0 + 1.10.19 + 3.0.0 + 0.1.15 + 4.4.0 + 3.1.0 + 3.1.1 + 5.3.27 + 2.0.10 + 2.3.2 4.5.1 4.5.1 - 2.15.0 - 5.3.27 + 1.58 @@ -285,57 +316,62 @@ org.slf4j slf4j-api - 2.0.1 + ${slf4j.version} com.google.guava guava - 32.0.0-jre + ${guava.version} com.networknt json-schema-validator - 0.1.15 + ${networknt.version} commons-codec commons-codec - 1.15 + ${commons-codec.version} + + + commons-io + commons-io + ${commons-io.version} com.floreysoft jmte - 7.0.0 + ${jmte.version} org.apache.logging.log4j log4j-api - 2.17.2 + ${log4j.version} org.apache.logging.log4j log4j-core - 2.17.2 + ${log4j.version} org.apache.logging.log4j log4j-slf4j2-impl - 2.19.0 + ${log4j-slf4j2.version} org.swisspush redisques - 3.1.0-SNAPSHOT + ${redisques.version} org.swisspush rest-storage - 3.1.0-SNAPSHOT + ${rest-storage.version} org.quartz-scheduler quartz - 2.3.2 + ${quartz.version} @@ -344,34 +380,29 @@ ${vertx.version} - com.jayway.awaitility + org.awaitility awaitility - 1.6.5 + ${awaitility.version} org.mockito mockito-core - 1.9.5 + ${mockito.version} junit junit - 4.13.1 + ${junit.version} redis.clients jedis - 3.7.0 + ${jedis.version} org.hamcrest - hamcrest-core - 1.3 - - - org.hamcrest - hamcrest-all - 1.3 + hamcrest + ${hamcrest.version} org.springframework @@ -398,39 +429,39 @@ org.json json - 20231013 + ${json.version} joda-time joda-time - 2.10.13 + ${joda.version} com.jayway.jsonpath json-path - 2.6.0 + ${jsonpath.version} io.rest-assured rest-assured - 4.4.0 - - - net.minidev - json-smart - 2.4.10 + ${rest-assured.version} + + + + + - - org.glassfish.tyrus.bundles - tyrus-standalone-client-jdk - 1.10 - + + + + + org.eclipse.jetty.websocket websocket-client - 9.3.0.M2 + ${jetty-websocket.version} @@ -452,67 +483,67 @@ uk.co.datumedge hamcrest-json - 0.2 + ${datumedge.version} commons-logging commons-logging - 1.2 + ${commons-logging.version} org.slf4j slf4j-simple - 2.0.1 + ${slf4j.version} org.swisspush mod-metrics - 3.0.0 + ${mod-metrics.version} org.apache.commons commons-lang3 - 3.12.0 - - - org.slf4j - slf4j-log4j - 2.0.1 + ${commons-lang3.version} + + + + + org.webjars angularjs - 1.5.8 + ${angularjs.version} com.github.tomakehurst wiremock - 1.56 + ${wiremock.version} info.cukes cucumber-java test - 1.2.6 + ${cucumber.version} info.cukes cucumber-junit test - 1.2.6 + ${cucumber.version} com.bazaarvoice.jolt jolt-core - 0.1.1 + ${jolt.version} com.bazaarvoice.jolt json-utils - 0.1.1 + ${jolt.version}