- java.lang.Object
-
- de.skuzzle.test.snapshots.SnapshotTestResult
-
@API(status=EXPERIMENTAL) public final class SnapshotTestResult extends Object
Result details of a single snapshot assertion.- Since:
- 0.0.2
- Author:
- Simon Taddiken
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSnapshotTestResult.SnapshotStatusInformation about the creation of a single snapshot file.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteSnapshot()Deletes the snapshot file.Optional<Throwable>failure()The exception with which the snapshot assertion failed if any.static SnapshotTestResultforFailedTest(Path targetFile, SnapshotFile snapshot, Throwable failure)static SnapshotTestResultof(Path targetFile, SnapshotTestResult.SnapshotStatus status, SnapshotFile snapshot)SnapshotFileserializedSnapshot()The snapshot.SnapshotTestResult.SnapshotStatusstatus()Whether snapshot has been created/updated or asserted.PathtargetFile()The snapshot file.
-
-
-
Method Detail
-
forFailedTest
public static SnapshotTestResult forFailedTest(Path targetFile, SnapshotFile snapshot, Throwable failure)
-
of
public static SnapshotTestResult of(Path targetFile, SnapshotTestResult.SnapshotStatus status, SnapshotFile snapshot)
-
targetFile
public Path targetFile()
The snapshot file.- Returns:
- The snapshot file.
-
status
public SnapshotTestResult.SnapshotStatus status()
Whether snapshot has been created/updated or asserted.- Returns:
- Whether snapshot has been created/updated or asserted.
-
serializedSnapshot
public SnapshotFile serializedSnapshot()
The snapshot.- Returns:
- The serialized snapshot.
-
failure
public Optional<Throwable> failure()
The exception with which the snapshot assertion failed if any.- Returns:
- The failure.
-
deleteSnapshot
public void deleteSnapshot() throws IOExceptionDeletes the snapshot file.- Throws:
IOException- if an I/O error occurs
-
-