0

I'm trying to test a JakartaEE application with Arquillian in Maven. Since the productive application should be running on Payara Micro, I chose the Payara Micro Remote dependency for the communication with the remote server:

<dependencies>
    <dependency>
        <groupId>org.jboss.arquillian.junit</groupId>
        <artifactId>arquillian-junit-container</artifactId>
        <version>1.6.0.Final</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>fish.payara.arquillian</groupId>
        <artifactId>payara-micro-remote</artifactId>
        <version>2.2</version>
        <scope>test</scope>
    /dependency>
</dependencies>

When I executed the tests, I got the following error:

[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.325 s <<< FAILURE! - in com.mycompany.SomeTestClass
[ERROR] com.mycompany.SomeTestClass  Time elapsed: 1.325 s  <<< ERROR!
java.lang.IllegalArgumentException: Deployment failed. Payara Micro Deployer at http://localhost:8080/micro-deployer returned 404

I also tried deploying Payara Micro Deployer to the remote Payara Micro Server like follows:

<plugin>
    <groupId>fish.payara.maven.plugins</groupId>
    <artifactId>payara-micro-maven-plugin</artifactId>
    <version>1.0.7</version>
    <configuration>
        <daemon>true</daemon>
        <commandLineOptions>
            <commandLineOption>
                <key>--deployFromGAV</key>
                <value>"fish.payara.arquillian,payara-micro-deployer,2.2"</value>
            </commandLineOption>
        </commandLineOptions>
    </configuration>
    <!-- ...some cother settings... -->
</plugin>

But this resulted in

[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.34 s <<< FAILURE! - in com.mycompany.SomeTestClass
[ERROR] com.mycompany.SomeTestClass  Time elapsed: 1.34 s  <<< ERROR!
java.lang.IllegalArgumentException: Deployment failed. Payara Micro Deployer at http://localhost:8080/micro-deployer returned 403

What am I doing wrong? Is there any description or example project on how to get Arquillian with Payara Micro Remote working?

The Payara Micro version I'm using is 5.194.

Thank you in advance!

l_mcqueen
  • 55
  • 6

1 Answers1

0

After checking the Payara Micro's deployed paths, which were

GET     /payara-micro-deployer/application.wadl
DELETE  /payara-micro-deployer/application/{name}
PUT     /payara-micro-deployer/application/{name}

and digging into the source code of Payara Micro Remote connector's configuration (https://github.com/payara/ecosystem-arquillian-connectors/blob/master/payara-micro-remote/src/main/java/fish/payara/arquillian/container/payaramicro/remote/PayaraMicroRemoteContainerConfiguration.java)

    /**
     * Get path payara-micro-deployer resides at.
     * @return
     */
    public String getDeployerContextPath() {
        return deployerContextPath;
    }

I found the solution.

I had to configure Payara Micro's deployment path in the arquillian.xml as follows:

<configuration>
    <property name="deployerContextPath">/payara-micro-deployer</property>
</configuration>
l_mcqueen
  • 55
  • 6