Unit Testing in Flow
JUnit mocks use and other mocking libraries should not be used as they may break when there are version updates. No new mocking libraries should be added to the project.
To help with tests there are many Mock*
classes for use that make the setup for testing simpler.
JUnit tests should not leak settings and changes outside the test execution. This means that any changes to current instances and system properties should be reset after the test execution.
Show code
Example standard names for unit test methods:
Expand code
Running all the tests mvn verify -pl <module-name>
would run all the tests in the specified module.
You can execute tests for single class by running the . Also, for running a single inside a class you can execute mvn -Dtest=<test-class-name>#<test-method-name> test -pl <module-folder-name>
.
For running all the unit tests in the project, you can execute .