Within this module, you'll thoroughly test the Todo application's functionality locally by leveraging Quarkus's continuous testing capabilities. Instead of relying on an external database, we'll utilize Quarkus Dev Services to streamline this process. Before deploying the application to Azure Red Hat OpenShift, we'll also package and execute it locally once more.
Quarkus Continuous Testing is a powerful feature that allows developers to automatically test their applications as they make changes to the code. This helps to ensure that the application remains functional and bug-free throughout the development process.
Key Features of Quarkus Continuous Testing:
- Automatic test execution: Quarkus automatically executes tests whenever changes are made to the code.
- Fast feedback: Tests are run quickly, providing developers with immediate feedback on the impact of their changes.
- Integration with Quarkus Dev Services: Quarkus Continuous Testing can be easily integrated with Quarkus Dev Services, allowing you to test your application against real external dependencies.
- Support for various testing frameworks: Quarkus supports a wide range of testing frameworks, including JUnit, TestNG, and Mockito.
Continuous Testing also offers a multitude of benefits for developers. By automatically executing tests whenever code changes are made, it helps to ensure that applications remain functional and bug-free throughout the development process. This not only improves code quality but also boosts productivity by eliminating the need for manual testing. Additionally, Quarkus Continuous Testing reduces the risk of introducing new bugs and accelerates the development and testing cycle, ultimately leading to faster time-to-market.
- Create a test class: Write a test class using your preferred testing framework.
- Annotate the test class: Annotate the test class with @QuarkusTest to enable Quarkus Continuous Testing.
- Run the application: Start your Quarkus application in development mode.
- Make changes to your code: As you make changes to your code, Quarkus will automatically recompile and rerun your tests.
Here is an example of a test class:
import io.quarkus.test.junit.QuarkusTest;
@QuarkusTest
public class TodoResourceTest {
// Your test methods here
}
Next, you'll dive into the process of applying continuous testing to the Todo application. Following that, we'll package and execute the application using the Quarkus CLI and Java command.