0

Trying to test the native application image in quarkus. My native application is already built and I want to test its functionality.

My test have 2 annotations.

@QuarkusIntegrationTest
@QuarkusTestResource(NativeTestResources.class)

NativeTestResources implements QuarkusTestResourceLifecycleManager create a postgres container in it and then in the start method I set the properties

    public Map<String, String> start() {
        DATABASE.start();
      
       return Map.ofEntries(entry("quarkus.datasource.jdbc.url", DATABASE.getJdbcUrl()),
                             entry("quarkus.datasource.username", DATABASE.getUsername()),
                             entry("quarkus.datasource.db-kind", "postgresql"),
                             entry("quarkus.datasource.password", DATABASE.getPassword()));
    } 

and when starting the test I see that the test container has started

> Database runningjdbc:postgresql://localhost:49320/cos?loggerLevel=OFF&currentSchema=cos

but a few lines after i see my app start with diffrent database port

> "/home/cos/build/cos-runner -Dquarkus.http.port=8081 -Dquarkus.http.ssl-port=8444 -Dtest.url=http://localhost:8081 -Dquarkus.log.file.path=/build/target/quarkus.log -Dquarkus.log.file.enable=true -Dquarkus.datasource.password=quarkus -Dquarkus.datasource.db-kind=postgresql -Dquarkus.datasource.jdbc.url=jdbc:postgresql://localhost:49318/default?loggerLevel=OFF -Dquarkus.datasource.username=quarkus"

What am i doing wrong?



0 Answers0