lundi 27 avril 2020

Testing JakartaEE applications with Arquillian Payara Micro Remote

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>
        <!-- ...some configurations... -->
        <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!

Aucun commentaire:

Enregistrer un commentaire