1.8.0
Migration Info:
Note
When upgrading from a version prior to1.8.0
, instead of depending onsnapshot-tests-core
you should now
either depend onsnapshot-tests-junit5
orsnapshot-tests-junit4
.
This will become mandatory with the next major version!Check the resp. section in the README!
All Changes:
- #20: Make
Snapshot
a top-level type inde.skuzzle.test.snapshot
and deprecatede.skuzzle.test.snapshot.SnapshotDsl.Snapshot
- #52: Test methods that contain at least on
disabled
assertion and no failed assertions will properly be marked as 'skipped' by the test framework - #54: Add support for JUnit4
- #58: Include paths to initially created snapshot files in assertion-failed message
- Officially support Java 17
- Move JUnit5 support into separate module
- Build against JUnit
5.9.2
(coming from5.9.1
) - Add
ContextFiles
class which groups the paths to all generated files - Deprecate
SnapshotTestResult.targetFile()
,SnapshotTestResult.actualResultFile()
andSnapshotTestResult.rawActualResultFile()
in favor ofSnapshotTestResult.contextFiles()
- Add
disabledBecause(String)
terminal DSL operation. The string can be used to leave an informative message to readers so they know why the assertion is disabled - Improve formatting of orphaned snapshot warning
- Streamline internal implementation
- Provide new reference documentation at https://skuzzle.github.io/snapshot-tests/reference/1.8.0
Reference Documentation
Reference documentation for this release: https://skuzzle.github.io/snapshot-tests/reference/1.8.0
BOM Artifact
Manages the versions of all modules in case you are using multiple in your project
<dependency>
<groupId>de.skuzzle.test</groupId>
<artifactId>snapshot-tests-bom</artifactId>
<version>1.8.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
testImplementation(platform("de.skuzzle.test:snapshot-tests-bom:1.8.0"))
Artifacts
Choose a test framework
ℹ️ All options include support for plain text snapshots.
If you are using JUnit5:
<dependency>
<groupId>de.skuzzle.test</groupId>
<artifactId>snapshot-tests-junit5</artifactId>
<version>1.8.0</version>
<scope>test</scope>
</dependency>
testImplementation 'de.skuzzle.test:snapshot-tests-junit5:1.8.0'
testImplementation("de.skuzzle.test:snapshot-tests-junit5:1.8.0")
If you are using JUnit4:
<dependency>
<groupId>de.skuzzle.test</groupId>
<artifactId>snapshot-tests-junit4</artifactId>
<version>1.8.0</version>
<scope>test</scope>
</dependency>
testImplementation 'de.skuzzle.test:snapshot-tests-junit4:1.8.0'
testImplementation("de.skuzzle.test:snapshot-tests-junit4:1.8.0")
Choose a snapshot format (optional)
Show supported snapshot format artifacts
If you want JSON based snapshots:
<dependency>
<groupId>de.skuzzle.test</groupId>
<artifactId>snapshot-tests-jackson</artifactId>
<version>1.8.0</version>
<scope>test</scope>
</dependency>
testImplementation 'de.skuzzle.test:snapshot-tests-jackson:1.8.0'
testImplementation("de.skuzzle.test:snapshot-tests-jackson:1.8.0")
If you want XML based snapshots using jaxb and javax.xml
legacy namespaces:
<dependency>
<groupId>de.skuzzle.test</groupId>
<artifactId>snapshot-tests-jaxb</artifactId>
<version>1.8.0</version>
<scope>test</scope>
</dependency>
testImplementation 'de.skuzzle.test:snapshot-tests-jaxb:1.8.0'
testImplementation("de.skuzzle.test:snapshot-tests-jaxb:1.8.0")
If you want XML based snapshots using jaxb new jakarta.xml
namespaces:
<dependency>
<groupId>de.skuzzle.test</groupId>
<artifactId>snapshot-tests-jaxb-jakarta</artifactId>
<version>1.8.0</version>
<scope>test</scope>
</dependency>
testImplementation 'de.skuzzle.test:snapshot-tests-jaxb-jakarta:1.8.0'
testImplementation("de.skuzzle.test:snapshot-tests-jaxb-jakarta:1.8.0")
If you want HTML based snapshots:
<dependency>
<groupId>de.skuzzle.test</groupId>
<artifactId>snapshot-tests-html</artifactId>
<version>1.8.0</version>
<scope>test</scope>
</dependency>
testImplementation 'de.skuzzle.test:snapshot-tests-html:1.8.0'
testImplementation("de.skuzzle.test:snapshot-tests-html:1.8.0")
Additional utilities
Show utility artifacts
Directory Params
<dependency>
<groupId>de.skuzzle.test</groupId>
<artifactId>snapshot-tests-directory-params</artifactId>
<version>1.8.0</version>
<scope>test</scope>
</dependency>
testImplementation 'de.skuzzle.test:snapshot-tests-directory-params:1.8.0'
testImplementation("de.skuzzle.test:snapshot-tests-directory-params:1.8.0")
Object normalization (
<dependency>
<groupId>de.skuzzle.test</groupId>
<artifactId>snapshot-tests-normalize</artifactId>
<version>1.8.0</version>
<scope>test</scope>
</dependency>
testImplementation 'de.skuzzle.test:snapshot-tests-normalize:1.8.0'
testImplementation("de.skuzzle.test:snapshot-tests-normalize:1.8.0")