Thanks for your interensting question. Do you run your tests against localhost?
Otherwise if you run your app in Payara Micro, you can even run Arquillian against Payara Embedded by the help of Payara Server Embedded Arquillian Container Adapter - it's the most simple way of getting Arquillian work with Payara. Watch https://hantsy.github.io/ for a comparision between the Payara Arquillian adapters and their configuration - watch the simple embedded configuration.
There is an Open Github Issue with the Payara Embedded Adapter regarding Java's module system Jigsaw and slow shutdown of the Arquillian Deployment. Workarounds are listet there.
I migrate old Java EE apps with global installation application servers to Jakarata EE Payara Micro apps which leads to having a simple bootRun analogue with IDE integration:
build.gradle
plugins {
...
id 'fish.payara.micro-gradle-plugin' version '...'
...
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
test {
...
jvmArgs = [
'--add-opens', 'java.base/sun.net.www.protocol.jar=ALL-UNNAMED',
...
]
}
payaraMicro {
payaraVersion = '...'
...
}
dependencies {
...
testImplementation("org.jboss.arquillian.junit5:arquillian-junit5-container:1.9.4.Final")
testImplementation("fish.payara.arquillian:arquillian-payara-server-embedded:3.1")
testRuntimeOnly("fish.payara.extras:payara-embedded-all:6.2025.4")
...
}
arquillian.xml
<?xml version="1.0"?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://jboss.org/schema/arquillian"
xsi:schemaLocation="http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<container qualifier="payara-embedded" default="true">
<configuration>
<property name="resourcesXml">src/test/resources/glassfish-resources.xml</property>
</configuration>
</container>
</arquillian>
glassfish-resources.xml
<!DOCTYPE resources PUBLIC
"-//GlassFish.org//DTD GlassFish Application Server 3.1
Resource Definitions//EN"
"http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
// TODO datasource definition
</resources>