Integrating JUnit Tests for WaveMaker Application
Overview
JUnit is a unit testing framework for the Java programming language. JUnit has been important in the development of test-driven development. These tests are required whether imported services are working as expected or not, before proceeding to run/deployment of the application. This document demonstrates how to integrate JUnit tests in an application developed by WaveMaker RAD.
Goals
- Integrate JUnit tests in the WaveMaker application
- Writing sample test cases for services.
Prerequisites
- IDE (IntelliJ IDEA, Eclipse)
- WaveMaker Application
- Git
- Maven
Integrating JUnit Tests into App
Configuration
- Export the WaveMaker application as a zip file.
- Import this zip file into IDE (Use WaveMaker workspace sync plugin).
- Add the following dependencies in pom.xml file under the dependencies tag.
- Create a file with name project-springapp-test.xml in src/test/resources folder
- Add below snippet to the file
- Go to folder src/test/java and create a package namely com/{appName}/test/core
- Add a file with name BaseTest.java
- Add code snippet to the file
Writing Test Cases
- Now start writing test classes under src/test/java package with a class extending BaseTest and with annotation @Test
- Code snippet for a sample test
See Also
How to send emails using Java Service
How to implement forgot password feature using Java Service
How to schedule a Java Service
How to accomplish Pre-Post Processing for a DB Service APIs