Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
version: "3.8"
services:
db:
container_name: db
image: postgres:14.4
image: postgres:18.1
restart: always
environment:
- POSTGRES_DB=postgres
Expand All @@ -13,7 +12,7 @@ services:

wiremock:
container_name: wiremock
image: wiremock/wiremock:3.0.0-1
image: wiremock/wiremock:3.13.2
ports:
- "8888:8080"
command: [ "--async-response-enabled=true", "--no-request-journal" ]
Expand Down
44 changes: 23 additions & 21 deletions dropwizard-app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'java'
id 'application'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'com.gradleup.shadow' version '9.2.1'
}

group = 'bitxon.dropwizard'
Expand All @@ -18,45 +18,47 @@ repositories {
}

dependencies {
implementation project(":common-api")
implementation enforcedPlatform("io.dropwizard:dropwizard-bom:4.0.12")
implementation project(':common-api')
implementation enforcedPlatform('io.dropwizard:dropwizard-bom:5.0.0')
implementation 'io.dropwizard:dropwizard-core'
implementation 'io.dropwizard:dropwizard-client'
implementation 'io.dropwizard:dropwizard-validation'
implementation 'io.dropwizard:dropwizard-hibernate'
implementation 'org.mapstruct:mapstruct:1.5.3.Final'
implementation 'org.mapstruct:mapstruct:1.6.3'

annotationProcessor 'org.projectlombok:lombok:1.18.36'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.3.Final'
annotationProcessor 'org.projectlombok:lombok:1.18.42'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.6.3'

compileOnly 'org.projectlombok:lombok:1.18.36'
compileOnly 'org.projectlombok:lombok:1.18.42'

runtimeOnly 'org.postgresql:postgresql:42.7.5'
runtimeOnly 'org.postgresql:postgresql:42.7.8'

testImplementation 'io.dropwizard:dropwizard-testing'
testImplementation project(":common-wiremock")
testImplementation 'org.wiremock:wiremock:3.2.0'
testImplementation 'com.google.code.findbugs:jsr305:3.0.2' //TODO research - dep should be transitive from wiremock
testImplementation 'org.testcontainers:testcontainers:1.20.4'
testImplementation 'org.testcontainers:junit-jupiter:1.20.4'
testImplementation 'org.testcontainers:postgresql:1.20.4'
testImplementation 'org.assertj:assertj-core:3.27.3'
testImplementation 'io.rest-assured:rest-assured:5.5.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation project(':common-wiremock')
testImplementation platform('org.testcontainers:testcontainers-bom:2.0.2')
testImplementation 'org.wiremock:wiremock:3.13.2'
testImplementation 'org.testcontainers:testcontainers'
testImplementation 'org.testcontainers:testcontainers-junit-jupiter'
testImplementation 'org.testcontainers:testcontainers-postgresql'
testImplementation 'org.assertj:assertj-core:3.27.6'
testImplementation 'io.rest-assured:rest-assured:5.5.6'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.junit.jupiter:junit-jupiter-params'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

test {
useJUnitPlatform()
}

mainClassName = 'bitxon.dropwizard.DropwizardApplication'
application {
mainClass = 'bitxon.dropwizard.DropwizardApplication'
}

jar {
manifest {
attributes 'Main-Class': mainClassName
attributes 'Build-Jdk-Spec': sourceCompatibility
attributes 'Main-Class': application.mainClass
attributes 'Build-Jdk-Spec': java.sourceCompatibility
attributes 'Class-Path': sourceSets.main.runtimeClasspath.collect { it.name }.join(' ')
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ public void initialize(final Bootstrap<DropwizardConfiguration> bootstrap) {
bootstrap.setConfigurationSourceProvider(new ClasspathOrFileConfigurationSourceProvider());

bootstrap.addBundle(hibernate);

// TODO remove when Dropwizard 5 will release a fix with proper registration of Jackson's polymorphic subtypes
bootstrap.getObjectMapper().registerSubtypes(
io.dropwizard.jetty.HttpConnectorFactory.class,
io.dropwizard.jetty.HttpsConnectorFactory.class
);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

abstract class AbstractDropwizardTest {

static PostgreSQLContainer DB = (PostgreSQLContainer) new PostgreSQLContainer(DockerImageName.parse("postgres").withTag("14.4"))
static PostgreSQLContainer DB = (PostgreSQLContainer) new PostgreSQLContainer("postgres:18.1")
.withDatabaseName("testdb")
.withUsername("postgres")
.withPassword("postgres")
.withInitScript("sql/db-test-data.sql");
static GenericContainer WIREMOCK = new GenericContainer("wiremock/wiremock:3.0.0-1")
static GenericContainer WIREMOCK = new GenericContainer("wiremock/wiremock:3.13.2")
.withExposedPorts(8080)
.withCopyFileToContainer(MountableFile.forClasspathResource("stubs"), "/home/wiremock")
.waitingFor(Wait
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
6 changes: 4 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down Expand Up @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
13 changes: 7 additions & 6 deletions loadtest/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
plugins {
id 'java'
id 'io.gatling.gradle' version '3.11.4'
id 'io.gatling.gradle' version '3.14.9'
}

group = 'bitxon'
version = '1.0-SNAPSHOT'
sourceCompatibility = '17'

repositories {
mavenCentral()
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

dependencies {
gatling
repositories {
mavenCentral()
}

gatling {
Expand Down
18 changes: 9 additions & 9 deletions loadtest/src/gatling/resources/gatling.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gatling {
#rawFileBodiesInMemoryMaxSize = 10240 # Max bite size of raw files to be cached in memory
#pebbleFileBodiesCacheMaxCapacity = 200 # Cache size for request body Pebble templates, set to 0 to disable
#feederAdaptiveLoadModeThreshold = 100 # File size threshold (in MB). Below load eagerly in memory, above use batch mode with default buffer size
#shutdownTimeout = 10000 # Milliseconds to wait for the actor system to shutdown
#shutdownTimeout = 10000 # Milliseconds to wait for the engine to shutdown
extract {
regex {
#cacheMaxCapacity = 200 # Cache size for the compiled regexes, set to 0 to disable caching
Expand All @@ -37,7 +37,7 @@ gatling {
netty {
#useNativeTransport = true # if Netty Linux native transport should be used instead of Java NIO
#useIoUring = false # if io_uring should be used instead of epoll if available
#allocator = "pooled" # switch to unpooled for unpooled ByteBufAllocator
#allocator = "pooled" # force the ByteBufAllocator, possible values are pooled, unpooled and adaptive
#maxThreadLocalCharBufferSize = 200000 # Netty's default is 16k
}
ssl {
Expand All @@ -64,15 +64,15 @@ gatling {
}
}
charting {
#maxPlotPerSeries = 1000 # Number of points per graph in Gatling reports
#maxPlotPerSeries = 1000 # Number of points per chart in Gatling reports
#useGroupDurationMetric = false # Switch group timings from cumulated response time to group duration.
indicators {
#lowerBound = 800 # Lower bound for the requests' response time to track in the reports and the console summary
#higherBound = 1200 # Higher bound for the requests' response time to track in the reports and the console summary
#percentile1 = 50 # Value for the 1st percentile to track in the reports, the console summary and Graphite
#percentile2 = 75 # Value for the 2nd percentile to track in the reports, the console summary and Graphite
#percentile3 = 95 # Value for the 3rd percentile to track in the reports, the console summary and Graphite
#percentile4 = 99 # Value for the 4th percentile to track in the reports, the console summary and Graphite
#percentile1 = 50 # Value for the 1st percentile to track in the reports and the console summary
#percentile2 = 75 # Value for the 2nd percentile to track in the reports and the console summary
#percentile3 = 95 # Value for the 3rd percentile to track in the reports and the console summary
#percentile4 = 99 # Value for the 4th percentile to track in the reports and the console summary
}
}
http {
Expand All @@ -82,7 +82,7 @@ gatling {
#warmUpUrl = "https://gatling.io" # The URL to use to warm-up the HTTP stack (blank means disabled)
#pooledConnectionIdleTimeout = 60000 # Timeout in millis for a connection to stay idle in the pool
#requestTimeout = 60000 # Timeout in millis for performing an HTTP request
#enableHostnameVerification = false # When set to true, enable hostname verification: SSLEngine.setHttpsEndpointIdentificationAlgorithm("HTTPS")
#enableHostnameVerification = false # When set to true, enable hostname verification: SSLEngine#setEndpointIdentificationAlgorithm("HTTPS")
dns {
#queryTimeout = 5000 # Timeout in millis of each DNS query in millis
#maxQueriesPerResolve = 6 # Maximum allowed number of DNS queries for a given name resolution
Expand All @@ -92,7 +92,7 @@ gatling {
#replyTimeoutScanPeriod = 1000 # scan period for timed out reply messages
}
data {
#writers = [console, file] # The list of DataWriters to which Gatling write simulation data (currently supported : console, file, graphite)
#writers = [console, file] # The list of DataWriters to which Gatling write simulation data (currently supported : console, file)
#utcDateTime = true # Print date-times with the UTC zone instead of the System's default
console {
#light = false # When set to true, displays a light version without detailed request stats
Expand Down
22 changes: 16 additions & 6 deletions micronaut-app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id("com.github.johnrengelman.shadow") version "8.1.1"
id("io.micronaut.application") version "4.4.4"
id("io.micronaut.test-resources") version "4.4.4"
id("io.micronaut.aot") version "4.4.4"
id("com.gradleup.shadow") version "9.2.1"
id("io.micronaut.application") version "4.6.1"
id("io.micronaut.test-resources") version "4.6.1"
id("io.micronaut.aot") version "4.6.1"
}

group = 'bitxon.micronaut'
Expand All @@ -24,6 +24,7 @@ dependencies {
annotationProcessor("org.mapstruct:mapstruct-processor:1.5.3.Final")
annotationProcessor("io.micronaut.data:micronaut-data-processor")
annotationProcessor("io.micronaut:micronaut-http-validation")
annotationProcessor("io.micronaut.validation:micronaut-validation-processor")
implementation("io.micronaut:micronaut-http-client")
implementation("io.micronaut:micronaut-jackson-databind")
implementation("io.micronaut:micronaut-management")
Expand All @@ -44,7 +45,12 @@ dependencies {
testImplementation("org.testcontainers:postgresql")
testImplementation("org.testcontainers:testcontainers")
testImplementation project(":common-wiremock")
testImplementation("org.wiremock:wiremock:3.2.0")
testImplementation("org.wiremock:wiremock:3.13.2")
testImplementation 'org.eclipse.jetty:jetty-servlet:11.0.26' // wiremock dependency conflict workaround
testImplementation 'org.eclipse.jetty:jetty-servlets:11.0.26' // wiremock dependency conflict workaround
testImplementation 'org.eclipse.jetty:jetty-webapp:11.0.26' // wiremock dependency conflict workaround
testImplementation 'org.eclipse.jetty.http2:http2-server:11.0.26' // wiremock dependency conflict workaround
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

application {
Expand All @@ -53,7 +59,7 @@ application {

graalvmNative.toolchainDetection = false
micronaut {
version("4.7.4")
version("4.10.3")
runtime("netty")
testRuntime("junit5")
processing {
Expand All @@ -74,3 +80,7 @@ micronaut {
}
}

tasks.named("dockerfileNative") {
jdkVersion = "21"
}

Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
abstract class AbstractMicronautTest implements TestPropertyProvider {

static PostgreSQLContainer DB = (PostgreSQLContainer) new PostgreSQLContainer(DockerImageName.parse("postgres").withTag("14.4"))
static PostgreSQLContainer DB = (PostgreSQLContainer) new PostgreSQLContainer("postgres:18.1")
.withDatabaseName("testdb")
.withUsername("postgres")
.withPassword("postgres")
.withInitScript("sql/db-test-data.sql");
static GenericContainer WIREMOCK = new GenericContainer("wiremock/wiremock:3.0.0-1")
static GenericContainer WIREMOCK = new GenericContainer("wiremock/wiremock:3.13.2")
.withExposedPorts(8080)
.withCopyFileToContainer(MountableFile.forClasspathResource("stubs"), "/home/wiremock")
.waitingFor(Wait
Expand Down
6 changes: 3 additions & 3 deletions quarkus-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

1. Build
- `gradle clean build` (Slim jar)
- `gradle clean build -Dquarkus.package.type=uber-jar` (Fat Jar)
- `gradle clean build -Dquarkus.package.jar.type=uber-jar` (Fat Jar)
2. Start application
- `java -jar quarkus-app/build/quarkus-app/quarkus-run.jar` (Slim jar)
- `java -jar quarkus-app/build/quarkus-app-1.0-SNAPSHOT-runner.jar` (Fat Jar)
Expand All @@ -25,12 +25,12 @@

You can create a native executable using:
```shell script
./gradlew build -Dquarkus.package.type=native
gradle build -Dquarkus.native.enabled=true -Dquarkus.package.jar.enabled=false
```

Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
```shell script
./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true
gradle build -Dquarkus.native.enabled=true -Dquarkus.native.container-build=true -Dquarkus.package.jar.enabled=false
```

You can then execute your native executable with: `./build/quarkus-app-1.0-SNAPSHOT-runner`
Expand Down
Loading