From 48cd2c682aef42f92e57a823e10c9fddb0929fed Mon Sep 17 00:00:00 2001 From: Rui Han Date: Wed, 28 Feb 2024 17:47:00 +0800 Subject: [PATCH] Update to Quarkus 3 --- pom.xml | 14 +++++++--- .../util/gateway/AdminResource.java | 16 ++++++------ .../util/gateway/ProxyResource.java | 16 ++++-------- .../util/gateway/cache/CacheHandler.java | 10 +++---- .../cache/strategy/DefaultCacheStrategy.java | 2 +- .../strategy/PrefixTrimCacheStrategy.java | 2 +- .../gateway/config/ProxyConfiguration.java | 6 ++--- .../mapper/UnhandledThrowableHandler.java | 8 +++--- ...handledWebApplicationExceptionHandler.java | 8 +++--- .../gateway/interceptor/ExceptionHandler.java | 2 +- .../ExceptionHandlerInterceptor.java | 8 +++--- .../metrics/health/HeapHealthCheck.java | 4 +-- .../gateway/metrics/health/JvmHealthInfo.java | 4 +-- .../metrics/health/ThreadsHealthCheck.java | 4 +-- .../metrics/jfr/FlightRecorderFilter.java | 11 ++++---- .../metrics/jfr/FlightRecorderMetrics.java | 4 +-- .../schedule/RefreshProxyConfiguration.java | 4 +-- .../util/gateway/services/AdminService.java | 6 ++--- .../util/gateway/services/Classifier.java | 6 ++--- .../util/gateway/services/ProxyService.java | 8 +++--- .../util/gateway/util/OtelAdapter.java | 4 +-- .../gateway/util/ProxyStreamingOutput.java | 2 +- .../util/gateway/util/WebClientAdapter.java | 2 +- src/main/resources/application.yaml | 14 +++++----- .../util/gateway/NativeProxyResourceIT.java | 26 ------------------- .../util/gateway/util/OtelAdapterTest.java | 11 +++----- src/test/resources/application.yaml | 7 ++--- 27 files changed, 91 insertions(+), 118 deletions(-) delete mode 100644 src/test/java/org/commonjava/util/gateway/NativeProxyResourceIT.java diff --git a/pom.xml b/pom.xml index 986548e..342347a 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ org.commonjava service-parent - 2 + 5-SNAPSHOT org.commonjava.util gateway @@ -98,7 +98,7 @@ io.quarkus - quarkus-opentelemetry-exporter-otlp + quarkus-opentelemetry io.quarkus @@ -120,6 +120,14 @@ org.apache.commons commons-lang3 + + commons-io + commons-io + + + commons-codec + commons-codec + @@ -130,7 +138,7 @@ - io.quarkus + io.quarkus.platform quarkus-maven-plugin diff --git a/src/main/java/org/commonjava/util/gateway/AdminResource.java b/src/main/java/org/commonjava/util/gateway/AdminResource.java index 39c78d8..daeaa8e 100644 --- a/src/main/java/org/commonjava/util/gateway/AdminResource.java +++ b/src/main/java/org/commonjava/util/gateway/AdminResource.java @@ -20,14 +20,14 @@ import io.vertx.core.json.JsonObject; import org.commonjava.util.gateway.services.AdminService; -import javax.inject.Inject; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; - -import static javax.ws.rs.core.MediaType.APPLICATION_JSON; -import static javax.ws.rs.core.MediaType.TEXT_PLAIN; +import jakarta.inject.Inject; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.Context; + +import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON; +import static jakarta.ws.rs.core.MediaType.TEXT_PLAIN; @Path( "/proxy" ) public class AdminResource diff --git a/src/main/java/org/commonjava/util/gateway/ProxyResource.java b/src/main/java/org/commonjava/util/gateway/ProxyResource.java index 877a2fb..973c23d 100644 --- a/src/main/java/org/commonjava/util/gateway/ProxyResource.java +++ b/src/main/java/org/commonjava/util/gateway/ProxyResource.java @@ -17,20 +17,14 @@ import io.smallrye.mutiny.Uni; import io.vertx.core.http.HttpServerRequest; +import jakarta.ws.rs.*; import org.commonjava.util.gateway.services.ProxyService; -import org.jboss.resteasy.annotations.jaxrs.PathParam; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.inject.Inject; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.HEAD; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; +import jakarta.inject.Inject; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.Response; import java.io.InputStream; import static org.commonjava.util.gateway.util.ServiceUtils.pathWithParams; @@ -44,7 +38,7 @@ public class ProxyResource ProxyService proxyService; @HEAD - public Uni head( @PathParam( "path" ) String path, final @Context HttpServerRequest request ) + public Uni head(@PathParam( "path" ) String path, final @Context HttpServerRequest request ) throws Exception { logger.debug( "Head resource: {}", path ); diff --git a/src/main/java/org/commonjava/util/gateway/cache/CacheHandler.java b/src/main/java/org/commonjava/util/gateway/cache/CacheHandler.java index 06210ee..3bebbe4 100644 --- a/src/main/java/org/commonjava/util/gateway/cache/CacheHandler.java +++ b/src/main/java/org/commonjava/util/gateway/cache/CacheHandler.java @@ -27,10 +27,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.core.Response; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -43,7 +43,7 @@ import static java.lang.System.currentTimeMillis; import static java.nio.charset.Charset.defaultCharset; -import static javax.ws.rs.core.Response.Status.OK; +import static jakarta.ws.rs.core.Response.Status.OK; import static org.apache.commons.lang3.StringUtils.isNotBlank; @ApplicationScoped diff --git a/src/main/java/org/commonjava/util/gateway/cache/strategy/DefaultCacheStrategy.java b/src/main/java/org/commonjava/util/gateway/cache/strategy/DefaultCacheStrategy.java index 97dd3aa..e010bf6 100644 --- a/src/main/java/org/commonjava/util/gateway/cache/strategy/DefaultCacheStrategy.java +++ b/src/main/java/org/commonjava/util/gateway/cache/strategy/DefaultCacheStrategy.java @@ -20,7 +20,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.enterprise.inject.Alternative; +import jakarta.enterprise.inject.Alternative; import java.io.File; import java.util.regex.Pattern; diff --git a/src/main/java/org/commonjava/util/gateway/cache/strategy/PrefixTrimCacheStrategy.java b/src/main/java/org/commonjava/util/gateway/cache/strategy/PrefixTrimCacheStrategy.java index 9f9f08e..97add66 100644 --- a/src/main/java/org/commonjava/util/gateway/cache/strategy/PrefixTrimCacheStrategy.java +++ b/src/main/java/org/commonjava/util/gateway/cache/strategy/PrefixTrimCacheStrategy.java @@ -20,7 +20,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.enterprise.inject.Alternative; +import jakarta.enterprise.inject.Alternative; import java.io.File; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/src/main/java/org/commonjava/util/gateway/config/ProxyConfiguration.java b/src/main/java/org/commonjava/util/gateway/config/ProxyConfiguration.java index 879846b..fa63957 100644 --- a/src/main/java/org/commonjava/util/gateway/config/ProxyConfiguration.java +++ b/src/main/java/org/commonjava/util/gateway/config/ProxyConfiguration.java @@ -25,9 +25,9 @@ import org.slf4j.LoggerFactory; import org.yaml.snakeyaml.Yaml; -import javax.annotation.PostConstruct; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; diff --git a/src/main/java/org/commonjava/util/gateway/exception/mapper/UnhandledThrowableHandler.java b/src/main/java/org/commonjava/util/gateway/exception/mapper/UnhandledThrowableHandler.java index ea62046..451b167 100644 --- a/src/main/java/org/commonjava/util/gateway/exception/mapper/UnhandledThrowableHandler.java +++ b/src/main/java/org/commonjava/util/gateway/exception/mapper/UnhandledThrowableHandler.java @@ -19,10 +19,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; /** * This default mapper allows any exception to be captured ensuring a ResponseContextFilter is always called. diff --git a/src/main/java/org/commonjava/util/gateway/exception/mapper/UnhandledWebApplicationExceptionHandler.java b/src/main/java/org/commonjava/util/gateway/exception/mapper/UnhandledWebApplicationExceptionHandler.java index 834dae4..0a12181 100644 --- a/src/main/java/org/commonjava/util/gateway/exception/mapper/UnhandledWebApplicationExceptionHandler.java +++ b/src/main/java/org/commonjava/util/gateway/exception/mapper/UnhandledWebApplicationExceptionHandler.java @@ -19,10 +19,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; /** * This WebApplicationException handler will check for a HTTP response status diff --git a/src/main/java/org/commonjava/util/gateway/interceptor/ExceptionHandler.java b/src/main/java/org/commonjava/util/gateway/interceptor/ExceptionHandler.java index f19da7b..438f971 100644 --- a/src/main/java/org/commonjava/util/gateway/interceptor/ExceptionHandler.java +++ b/src/main/java/org/commonjava/util/gateway/interceptor/ExceptionHandler.java @@ -15,7 +15,7 @@ */ package org.commonjava.util.gateway.interceptor; -import javax.interceptor.InterceptorBinding; +import jakarta.interceptor.InterceptorBinding; import java.lang.annotation.Retention; import java.lang.annotation.Target; diff --git a/src/main/java/org/commonjava/util/gateway/interceptor/ExceptionHandlerInterceptor.java b/src/main/java/org/commonjava/util/gateway/interceptor/ExceptionHandlerInterceptor.java index 289f674..4956bf9 100644 --- a/src/main/java/org/commonjava/util/gateway/interceptor/ExceptionHandlerInterceptor.java +++ b/src/main/java/org/commonjava/util/gateway/interceptor/ExceptionHandlerInterceptor.java @@ -20,10 +20,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.interceptor.AroundInvoke; -import javax.interceptor.Interceptor; -import javax.interceptor.InvocationContext; -import javax.ws.rs.core.Response; +import jakarta.interceptor.AroundInvoke; +import jakarta.interceptor.Interceptor; +import jakarta.interceptor.InvocationContext; +import jakarta.ws.rs.core.Response; @Interceptor @ExceptionHandler diff --git a/src/main/java/org/commonjava/util/gateway/metrics/health/HeapHealthCheck.java b/src/main/java/org/commonjava/util/gateway/metrics/health/HeapHealthCheck.java index e094e69..158309b 100644 --- a/src/main/java/org/commonjava/util/gateway/metrics/health/HeapHealthCheck.java +++ b/src/main/java/org/commonjava/util/gateway/metrics/health/HeapHealthCheck.java @@ -19,8 +19,8 @@ import org.eclipse.microprofile.health.HealthCheckResponse; import org.eclipse.microprofile.health.Liveness; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; import java.util.Optional; import static org.eclipse.microprofile.health.HealthCheckResponse.Status.UP; diff --git a/src/main/java/org/commonjava/util/gateway/metrics/health/JvmHealthInfo.java b/src/main/java/org/commonjava/util/gateway/metrics/health/JvmHealthInfo.java index d119ec5..8f66aab 100644 --- a/src/main/java/org/commonjava/util/gateway/metrics/health/JvmHealthInfo.java +++ b/src/main/java/org/commonjava/util/gateway/metrics/health/JvmHealthInfo.java @@ -15,8 +15,8 @@ */ package org.commonjava.util.gateway.metrics.health; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Singleton; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Singleton; import java.lang.management.ManagementFactory; import java.lang.management.ThreadInfo; import java.lang.management.ThreadMXBean; diff --git a/src/main/java/org/commonjava/util/gateway/metrics/health/ThreadsHealthCheck.java b/src/main/java/org/commonjava/util/gateway/metrics/health/ThreadsHealthCheck.java index 3b79851..6bbbc49 100644 --- a/src/main/java/org/commonjava/util/gateway/metrics/health/ThreadsHealthCheck.java +++ b/src/main/java/org/commonjava/util/gateway/metrics/health/ThreadsHealthCheck.java @@ -19,8 +19,8 @@ import org.eclipse.microprofile.health.HealthCheckResponse; import org.eclipse.microprofile.health.Liveness; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; import java.util.Optional; import static org.eclipse.microprofile.health.HealthCheckResponse.Status.UP; diff --git a/src/main/java/org/commonjava/util/gateway/metrics/jfr/FlightRecorderFilter.java b/src/main/java/org/commonjava/util/gateway/metrics/jfr/FlightRecorderFilter.java index 5a24893..c9a7e10 100644 --- a/src/main/java/org/commonjava/util/gateway/metrics/jfr/FlightRecorderFilter.java +++ b/src/main/java/org/commonjava/util/gateway/metrics/jfr/FlightRecorderFilter.java @@ -20,11 +20,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerRequestFilter; -import javax.ws.rs.container.ContainerResponseContext; -import javax.ws.rs.container.ContainerResponseFilter; -import javax.ws.rs.ext.Provider; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerRequestFilter; +import jakarta.ws.rs.container.ContainerResponseContext; +import jakarta.ws.rs.container.ContainerResponseFilter; +import jakarta.ws.rs.ext.Provider; import java.io.IOException; /** @@ -104,5 +104,6 @@ private String getMethodName( ContainerRequestContext context ) } private static final String METHOD_NAME = ResourceMethodInvoker.class.getName(); + private static final Logger logger = LoggerFactory.getLogger( FlightRecorderFilter.class.getName() ); } diff --git a/src/main/java/org/commonjava/util/gateway/metrics/jfr/FlightRecorderMetrics.java b/src/main/java/org/commonjava/util/gateway/metrics/jfr/FlightRecorderMetrics.java index a7634c0..ad29ff4 100644 --- a/src/main/java/org/commonjava/util/gateway/metrics/jfr/FlightRecorderMetrics.java +++ b/src/main/java/org/commonjava/util/gateway/metrics/jfr/FlightRecorderMetrics.java @@ -19,8 +19,8 @@ import jdk.jfr.FlightRecorder; import org.commonjava.util.gateway.metrics.jfr.events.JaxRSEvent; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.event.Observes; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.event.Observes; @ApplicationScoped public class FlightRecorderMetrics diff --git a/src/main/java/org/commonjava/util/gateway/schedule/RefreshProxyConfiguration.java b/src/main/java/org/commonjava/util/gateway/schedule/RefreshProxyConfiguration.java index 513d70d..1c786f2 100644 --- a/src/main/java/org/commonjava/util/gateway/schedule/RefreshProxyConfiguration.java +++ b/src/main/java/org/commonjava/util/gateway/schedule/RefreshProxyConfiguration.java @@ -18,8 +18,8 @@ import io.quarkus.scheduler.Scheduled; import org.commonjava.util.gateway.config.ProxyConfiguration; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; import java.util.concurrent.TimeUnit; @ApplicationScoped diff --git a/src/main/java/org/commonjava/util/gateway/services/AdminService.java b/src/main/java/org/commonjava/util/gateway/services/AdminService.java index ff5291f..6b0db44 100644 --- a/src/main/java/org/commonjava/util/gateway/services/AdminService.java +++ b/src/main/java/org/commonjava/util/gateway/services/AdminService.java @@ -21,9 +21,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.PostConstruct; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; import java.io.IOException; import java.io.InputStream; import java.lang.management.ManagementFactory; diff --git a/src/main/java/org/commonjava/util/gateway/services/Classifier.java b/src/main/java/org/commonjava/util/gateway/services/Classifier.java index 56811f6..68fdc58 100644 --- a/src/main/java/org/commonjava/util/gateway/services/Classifier.java +++ b/src/main/java/org/commonjava/util/gateway/services/Classifier.java @@ -28,9 +28,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.PostConstruct; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; diff --git a/src/main/java/org/commonjava/util/gateway/services/ProxyService.java b/src/main/java/org/commonjava/util/gateway/services/ProxyService.java index 9923623..af48d00 100644 --- a/src/main/java/org/commonjava/util/gateway/services/ProxyService.java +++ b/src/main/java/org/commonjava/util/gateway/services/ProxyService.java @@ -27,14 +27,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.ws.rs.core.Response; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.ws.rs.core.Response; import java.io.InputStream; import static io.vertx.core.http.HttpMethod.HEAD; import static io.vertx.core.http.impl.HttpUtils.normalizePath; -import static javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR; +import static jakarta.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR; import static org.commonjava.util.gateway.services.ProxyConstants.FORBIDDEN_HEADERS; @ApplicationScoped diff --git a/src/main/java/org/commonjava/util/gateway/util/OtelAdapter.java b/src/main/java/org/commonjava/util/gateway/util/OtelAdapter.java index 089dca2..06590dc 100644 --- a/src/main/java/org/commonjava/util/gateway/util/OtelAdapter.java +++ b/src/main/java/org/commonjava/util/gateway/util/OtelAdapter.java @@ -24,7 +24,7 @@ import okhttp3.Request; import org.eclipse.microprofile.config.inject.ConfigProperty; -import javax.enterprise.context.ApplicationScoped; +import jakarta.enterprise.context.ApplicationScoped; @ApplicationScoped public class OtelAdapter @@ -33,7 +33,7 @@ public class OtelAdapter rb.header( key, value ); }; - @ConfigProperty( name = "quarkus.opentelemetry.enabled" ) + @ConfigProperty( name = "quarkus.otel.enabled" ) Boolean enabled; public Span newClientSpan( String adapterName, String name ) diff --git a/src/main/java/org/commonjava/util/gateway/util/ProxyStreamingOutput.java b/src/main/java/org/commonjava/util/gateway/util/ProxyStreamingOutput.java index b17285b..27cc8e5 100644 --- a/src/main/java/org/commonjava/util/gateway/util/ProxyStreamingOutput.java +++ b/src/main/java/org/commonjava/util/gateway/util/ProxyStreamingOutput.java @@ -23,7 +23,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.core.StreamingOutput; +import jakarta.ws.rs.core.StreamingOutput; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; diff --git a/src/main/java/org/commonjava/util/gateway/util/WebClientAdapter.java b/src/main/java/org/commonjava/util/gateway/util/WebClientAdapter.java index a0f4926..c094bee 100644 --- a/src/main/java/org/commonjava/util/gateway/util/WebClientAdapter.java +++ b/src/main/java/org/commonjava/util/gateway/util/WebClientAdapter.java @@ -41,7 +41,7 @@ import java.time.Duration; import java.util.concurrent.atomic.AtomicLong; -import static javax.ws.rs.core.HttpHeaders.HOST; +import static jakarta.ws.rs.core.HttpHeaders.HOST; public class WebClientAdapter { diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 84048be..dfd1ca7 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -6,16 +6,18 @@ quarkus: limits: max-body-size: 500M - opentelemetry: + otel: enabled: true - tracer: + traces: enabled: true # reflect sampling on collector - resource-attributes: sampler_ratio=0.05 + #resource-attributes: sampler_ratio=0.05 sampler: - ratio: 0.05 - exporter: - otlp: + ~: traceidratio + arg: 0.05 + exporter: + otlp: + traces: # This is for sending to something like opentelemetry-collector # endpoint: http://localhost:4317 diff --git a/src/test/java/org/commonjava/util/gateway/NativeProxyResourceIT.java b/src/test/java/org/commonjava/util/gateway/NativeProxyResourceIT.java deleted file mode 100644 index e6fbb8b..0000000 --- a/src/test/java/org/commonjava/util/gateway/NativeProxyResourceIT.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/service-parent) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.commonjava.util.gateway; - -import io.quarkus.test.junit.NativeImageTest; - -@NativeImageTest -public class NativeProxyResourceIT - extends ProxyResourceTest -{ - - // Execute the same tests but in native mode. -} \ No newline at end of file diff --git a/src/test/java/org/commonjava/util/gateway/util/OtelAdapterTest.java b/src/test/java/org/commonjava/util/gateway/util/OtelAdapterTest.java index dd1373a..5d0a8b3 100644 --- a/src/test/java/org/commonjava/util/gateway/util/OtelAdapterTest.java +++ b/src/test/java/org/commonjava/util/gateway/util/OtelAdapterTest.java @@ -17,7 +17,6 @@ import io.opentelemetry.api.trace.Span; import io.quarkus.test.junit.QuarkusTest; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -26,15 +25,11 @@ @QuarkusTest class OtelAdapterTest { - OtelAdapter otelAdapter; - - @BeforeEach - void setUp() { - otelAdapter = new OtelAdapter(); - } @Test void shouldReturnNoopSpanWhenDisabled() { + OtelAdapter otelAdapter = new OtelAdapter(); + //Given otelAdapter.enabled = false; @@ -47,6 +42,8 @@ void shouldReturnNoopSpanWhenDisabled() { @Test void shouldReturnPropagatableSpanWhenDisabled() { + OtelAdapter otelAdapter = new OtelAdapter(); + //Given otelAdapter.enabled = true; diff --git a/src/test/resources/application.yaml b/src/test/resources/application.yaml index 27cbd29..6436877 100644 --- a/src/test/resources/application.yaml +++ b/src/test/resources/application.yaml @@ -2,12 +2,9 @@ quarkus: http: port: 8080 - read-timeout: 30m + read-timeout: 15m limits: - max-body-size: 500M - - package: - uber-jar: true + max-body-size: 1024M # Logging (disable console on prod) log: