R - Reason Codes
These output codes are associated with checks performed on your Java code by Diffblue Cover and highlight code issues that prevent tests being created.
There are no fields that could be asserted on. Add getters or make the fields package-private.
Please check that the class is available on your test runtime classpath. See our documentation for further guidance.
A static initializer threw an exception while trying to load a class. Make sure static initializers can be executed without throwing exceptions.
Make sure all classnames are accessible from their targetPackage, for example by making them public.
Diffblue Cover was unable to construct an instance of
someClass
. Ensure there is a package-visible constructor or factory method that does not throw an exception for the class under test. If such a method is already present but Diffblue Cover does not find it, it can be specified using custom rules for inputs: custom-inputs
See Working with code R008 for further troubleshooting of this issue.Diffblue Cover's default sandboxing policy disallowed test writing in order to prevent your code from damaging your system environment. Please see Working with code R011.
Diffblue Cover ran code in your project that tried to load a JNI library, violating the default security policy. See Java Native Interface to resolve this issue.
Diffblue Cover tried to run the arrange/act section, but the method under test threw an error. Add constructors or factory methods that make it easier to construct fully initialized objects. Please see Working with code R013.
The method under test could not be found in the execution trace. The trace file was only partially loaded because an error was found while loading it. Please record your application again with the Replay agent of your current installation of Cover.
The method under test is not called in recorded execution trace. Record your program again and provide program inputs that trigger at least one call of the method under test.
Please ensure that temporary files are deleted in the method under test.
Diffblue Cover detected Spring on the classpath, but failed to load critical components while building the Spring context. Make sure these components can be loaded.
Failed to create Spring context. Check to see if there are any missing environment variables or system properties. For detailed and further troubleshooting please see Working with code R026.
Failed to create Spring context due to missing beans. Check to see if there are any missing environment variables or system properties. Also missing beans could be defined in Spring profiles that aren't used for test generation. Otherwise, please contact Diffblue Support with details of the entire output message and the source code of the class under test.
Try extending CrudRepository with concrete type parameters, or if the class should not be considered a repository then annotate the class with the
@NoRepositoryBean
annotation.Diffblue Cover was only able to write tests that are time-sensitive. The assertions don't pass when run at an alternate date, time, and timezone. Try refactoring the method to take a
java.time.Clock
instance so that the time can be parameterized during testing. See Working with code R031 for details.Only skeleton tests have been created for this method, as requested by the user. These should be completed manually, as needed.
Some classes in the Spring context have @Value annotation that Diffblue Cover can't resolve. Usually variables for such annotations are provided in
*.properties
files. Please check src/main/resources
and src/test/resources
. The default names for the files are application.properties
and application-test.properties
. If you use named Spring profiles please use application-<profile name>.properties
files.Diffblue Cover needs to run a number of construction steps to create a test. If the number of steps allowed when setting
--fuzzing-iterations=N
parameter is not enough then Diffblue Cover stops with no tests written. In this case try to allow more iterations by setting N
to a higher value.Mockito was unable to create a static mock for a class. Please review the underlying cause in the output message or log.
Diffblue Cover was unable to construct an instance of the class under test because a step in the arrange section threw an exception.
Diffblue Cover was unable to construct an instance.
Diffblue Cover failed to create a parameter for the constructor or factory method call.
Diffblue Cover was unable to construct an instance.
No suitable constructor or factory method found. Please check that the class under test has a non-private constructor or factory method.
Diffblue Cover was unable to test an instance of an enum as no constants are defined.
Diffblue Cover was unable to write a test that does not get into a potentially unbounded loop.
Last modified 23d ago