This repository is created for education reason.
The technology stack: Java 17, Groovy, Gradle, JUnit 5.9.3, Spock 2.3, Vavr, Assertj, awaitutility, mockito, Static code analyzers (codenarc, checkstyle, PMD, Google Find bugs)
It contains examples of using new features from JUnit 5 vs Spock features. It is possible to find the following examples of comparison:
- Assertions: standard JUnit 5 assertions + hamcrest matchers + assertj vs Spock power assertions
- Exception verifications
- Test life cycles: instance per method, instance per class, order of calling methods
- Nested tests (order of executing tests)
- Parametrized tests: parametrized tests for ints, Strings, any arguments, arguments from CSV file, arguments in CSV format
- Asynchronous verifications: timeout assertions, awaitility framework, async conditions in Spock
- Repeated tests
- Condition executions: IgnoreIf, Requires, assumptions
- Using of mocks: Spock mocks vs mockito