blogs.oracle.com blogs.oracle.com

Unit Testing Helidon Like A Pro using Mockito

Writing JUnit5 unit tests in Helidon is easy with the usage of helidon-microprofile-tests-junit5 dependency. It starts a separate Helidon microprofile server for you to run your tests using @HelidonTest annotation.  But testing your services (which includes beans which accesses your database layer) is not so straightforward as we need to mock the data access beans without having it so start firing database connections whether H2 or...