I want to use h2 console for accessing the inmemory database while testing(test debugging). Tests run fine and the h2 database seems to do its job.
To enable the h2 console I followed this How to set H2 Database console url in the Quarkus Application.
Then the console is available when I run the application for normal development. its available under http://localhost:8082/h2/
But when running my tests (with RestAssured) the console is not available. I tried it with breakpoints that only are stopping the thread and also I tried setting a while(true) loop in one of the tests so the test would not finish and then I would try to access the console, but none of it worked.
Is there any additional settings that I need to do for accessing the h2 console when running tests?
in the application.yml I also have the following
"%test":
quarkus:
datasource:
db-kind: h2
jdbc:
driver: org.h2.Driver
url: jdbc:h2:mem:test
also I tried adding the META-INF folder with the web.xml not only under main/resources but also under test/resources. But I am not sure if that is something you would do?
Any idea how to access the h2 console for tests?
Maybe when running tests the servlets are not getting loaded? Or maybe it will run under a different port? I am not really sure what is the problem.
Maybe I need to add a code in the TestProfiles that loads the servlet explicitly? Any idea where and how to that?