public class JUnit5Reporter extends java.lang.Object implements Reporter
This Reporter uses reflection to throw the same exceptions that the JUnit 5 framework would send. It is useful when no executable can be found by any CommandReporter but JUnit 5 is on the classpath.
| Constructor and Description |
|---|
JUnit5Reporter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isAvailable()
A
Reporter may not be relevant in all contexts, and they should provide some automated checks validating that they’re actually able to perform what they’re supposed to do in the current execution context (like libraries available in the classpath or Diff / Merge programs available on the computer). |
void |
mismatch(java.nio.file.Path approved,
java.nio.file.Path received)
A
Reporter is called whenever a difference is found while comparing the output of a Program Under Tests and the existing approved files linked to the tests. |
public void mismatch(java.nio.file.Path approved,
java.nio.file.Path received)
ReporterA Reporter is called whenever a difference is found while comparing the output of a Program Under Tests and the existing approved files linked to the tests. That method is the one which will be called by the framework, specifying the approved and received files which present differences.
It is then used to implement the behavior to execute for dealing with that mismatch between both files.
mismatch in interface Reporterapproved - The Path to the approved file (which contains the data reviewed and approved by the developer)received - The Path to the temporary received file (which contains the data generated by the Program Under Tests)java.lang.AssertionError - if the 2 contents do not matchjava.lang.RuntimeException - if something went wrong with reflection calls to JUnit framework (should not happen if you checked isAvailable() first)public boolean isAvailable()
ReporterA Reporter may not be relevant in all contexts, and they should provide some automated checks validating that they’re actually able to perform what they’re supposed to do in the current execution context (like libraries available in the classpath or Diff / Merge programs available on the computer).
This method allows to state if a Reporter should be executed in case any differences are found during the comparison of approved and received files. If it returns false, the Reporter won’t be used.
isAvailable in interface ReporterReporter can be used in the current execution context.Copyright © 2018 Write Them First!. All rights reserved.