LogoLogo
diffblue.comFree trial
  • Discover Diffblue Cover
  • Get Started
    • What is Diffblue Cover?
    • Get started
      • Free trial
      • Get started - Cover Plugin
      • Get started - Cover CLI
      • Get started - Cover Pipeline
      • Get started - Cover Reports
    • Specs & Reqs
    • Reference Deployments
    • Licensing
      • Online license activation
      • Offline license activation
      • Diffblue License Manager
    • Update Cover
    • FAQs
    • Diffblue Learning
      • Get started
        • Just the basics
        • Free trial
        • Cover Plugin (IDE)
        • Cover CLI (Command Line)
      • Developer
        • Unit tests (IDE)
        • Unit tests (CLI)
        • Test coverage
      • DevOps
        • GitHub
        • GitLab
        • Other CI
      • Administrator
        • Admin - IntelliJ
        • Admin - CLI
        • Admin - Reports
      • Test coverage
        • Developer
        • Senior developer
        • Cover Reports Administrator
  • EVALUATION & ONBOARDING
    • Proof of Value
    • Jumpstart
      • Prerequisites for onboarding
      • Phase 1: Up and running
        • Module 1: Create your Cover unit test baseline
        • Module 2: Cover Pipeline CI integration
      • Phase 2: Developer productivity
        • Module 3: Getting started using Cover
        • Module 4: Introduction to Cover Reports
      • Phase 3: Advanced topics
        • Module 5: Speed up your test execution
        • Module 6: Getting more from Cover
  • Features
    • Cover Plugin
      • Writing tests
        • Gutter icons
        • Menu options
        • Run configurations
        • Cover Plugin tool window
        • Test Review
        • Test examples
        • Creating partial tests
        • Creating skeleton tests
        • Covering all enum values
        • Test insertion order
        • Diffblue Sandbox
        • Environment Check Cache
      • Project configuration
        • General dependencies
        • Test framework dependencies
      • Cover Plugin settings
        • Test Naming
        • Test Formatting
        • Spring configuration options
        • Method Annotations
        • Test Directory
        • Reset Cover Plugin settings
      • Cover Plugin admin
        • Core Maintenance
        • Cover Plugin toolbar menu
        • Cover Plugin status bar widget
        • Telemetry
        • Memory management
        • Using SonarQube with Cover Plugin
        • Log files
        • Troubleshooting
    • Cover CLI
      • Writing tests
        • Command summary
        • Test examples
        • Creating partial tests
        • Customizing test inputs
        • Customizing test setup
        • Test naming
        • Test formatting
        • Test insertion order
        • Patch files
        • Diffblue Sandbox
        • Operational behaviors
        • Test validation
      • Project configuration
        • Preflight checks
        • General dependencies
        • Test framework dependencies
        • Compiling your project successfully
          • Building a Maven project
          • Building a Gradle project
        • Configuring Cover to work with your project's build system
          • Quick guide
          • Configuration file in detail
          • Getting Started with Ant Projects
          • Default configuration
        • Mocking using Mockito
        • Spring profiles
        • Runtime environment
      • Commands & Arguments
        • Environment configuration for CI
        • Packages, classes, and methods
        • Quoting command line arguments
        • Argument files
      • Cover CLI admin
        • Core Maintenance
        • Telemetry
        • Memory management
        • Using Cover CLI in Eclipse
        • Using SonarQube with Cover CLI
        • Log files
        • Troubleshooting
      • Environment Configuration
    • Cover Pipeline
      • Cover Pipeline for CI
        • Quick Start - General
        • Quick Start - Jenkins
        • Quick Start - Azure Pipelines
        • Quick Start - AWS Codebuild
        • Integrating Diffblue Cover into CI on pull requests
        • Installation - VMs or CI run
      • Cover Pipeline for GitLab
        • Introduction
        • Installation and initial setup
        • GitLab workflow
        • Configuration
        • Troubleshooting
        • Related topics
      • Cover Pipeline for GitHub
        • Introduction
        • Installation and initial setup
        • GitHub workflow
        • Configuration
        • Troubleshooting
        • Related topics
    • Cover Reports
      • Cover Reports Contributor
        • Java project config (JaCoCo)
        • Generate and upload reports bundles
        • Authenticated uploads
      • Cover Reports User
        • Navigation
        • Dashboards
        • Telemetry data
        • Export API
        • Considerations
      • Cover Reports Administrator
        • Install and update Cover Reports
        • Configuration options
        • Database backup
        • SSO with Cover Reports
        • Uninstall Cover Reports
    • Cover Optimize
      • Get started - Cover Optimize
      • Cover Optimize & Gradle
      • Cover Optimize & Maven
      • Patch files
    • Cover Refactor
      • Get started - Cover Refactor
    • Cover Annotations
      • Mocking Annotations
      • Custom Input Annotations
      • Interesting Value Annotations
    • Output Codes
      • E - Environment Codes
      • L - License Codes
      • R - Reason Codes
      • T - Testability Codes
      • V - Validation Codes
      • Working with output codes
        • Working with code E020
        • Working with codes E057 to E065
        • Working with code E085
        • Working with code R005
        • Working with code R006
        • Working with code R008
        • Working with code R011
        • Working with code R012
        • Working with code R013
        • Working with code R026
        • Working with code R031
        • Working with code V003
    • Tutorials
      • How to measure test quality
      • How to improve code coverage
      • How to test a new feature
      • How to find regressions
      • How to use Diffblue Cover in test driven development (TDD)
      • How to write tests for Kotlin projects
      • Examples of tests created by Diffblue Cover
      • Best practices for testing private methods
  • Updates & Upgrades
    • Update Cover
    • Cover Editions
    • What's new
    • Release archive
      • 2025-05-01
      • 2025-04-02
      • 2025-04-01
      • 2025-03-02
      • 2025-03-01
      • 2025-02-02
      • 2025-02-01
      • 2025-01-02
      • 2025-01-01
      • 2024-12-02
      • 2024-12-01
      • 2024-11-02
      • 2024-11-01
      • 2024-10-02
      • 2024-10-01
      • 2024-09-02
      • 2024-09-01
      • 2024-08-02
      • 2024-08-01
      • 2024-07-04
      • 2024-07-03
      • 2024-07-01
      • 2024-06-02
      • 2024-06-01
      • 2024-05-02
      • 2024-05-01
      • 2024-04-02
      • 2024-04-01
      • 2024-03-02
      • 2024-03-01
      • 2024-02-02
      • 2024-02-01
      • 2024-01-02
      • 2024-01-01
      • 2023-12-02
      • 2023-12-01
      • 2023-11-03
      • 2023-11-02
      • 2023-11-01
      • 2023-10-02
      • 2023-10-01
      • 2023-09-02
      • 2023-09-01
      • 2023-08-02
      • 2023-08-01
      • 2023-07-03
      • 2023-07-02
      • 2023-07-01
      • 2023-06-02
      • 2023-06-01
      • 2023-05-02
      • 2023-05-01
      • 2023-04-02
      • 2023-04-01
      • 2023-03-02
      • 2023-03-01
      • 2023-02-02
      • 2023-02-01
      • 2023-01-02
      • 2023-01-01
      • 2022-12-02
      • 2022-12-01
      • 2022-11-02
      • 2022-11-01
      • 2022-10-03
      • 2022-10-02
      • 2022-10-01
      • 2022-09-02
      • 2022-09-01
      • 2022-08-05
      • 2022-08-03
      • 2022-08-02
      • 2022-08-01
      • 2022-07-02
      • 2022-07-01
      • 2022-06-02
      • 2022-06-01
      • 2022-05-02
      • 2022-05-01
      • 2022-04-02
      • 2022-04-01
      • 2022-03-02
      • 2022-03-01
      • 2022-02-02
      • 2022-02-01
      • 2022-01-02
      • 2022-01-01
      • 2021-06-02
      • 2021-02-01
  • Legal
    • Diffblue Legal
      • Diffblue End User License Agreement (EULA)
      • Cover Third Party Notices and/or Licenses
      • Privacy Notice
Powered by GitBook
On this page
  • Introduction
  • R002 - Missing observers
  • R005 - Unable to load class
  • R006 - Static initializer failed
  • R007 - Class not accessible
  • R008 - Failed to instantiate class under test
  • R011 - Sandboxing policy violation
  • R012 - JNI sandbox policy violation
  • R013 - No inputs found that don't throw a trivial exception
  • R018 - Trace file incomplete
  • R019 - Method not in trace
  • R020 - Temporary files were created but not deleted
  • R021 - Missing Spring component
  • R023 - Out of memory
  • R026 - Failed to create Spring context
  • R027 - Missing beans when creating Spring context
  • R028 - Incomplete repository information
  • R031 - Method may be time-sensitive
  • R032 - User requested skeleton tests only
  • R033 - Missing Spring properties
  • R035 - Unsupported virtual threads call detected
  • R036 - CSRF protection enabled
  • R037 - Unable to use annotation value
  • R038 - Spring repository tests skipped
  • R074 - Unable to create static mock
  • R081 - Exception in arrange section
  • R082 - Can't create a parameter for constructor
  • R083 - Can't find a suitable constructor
  • R084 - Enum has no constants defined
  • R085 - Unbounded loop in method under test
  • R086 - Unable to use custom base class
  • R087 - Can't create required class instance
  • R088 - Method name is a reserved keyword

Was this helpful?

Export as PDF
  1. Features
  2. Output Codes

R - Reason Codes

PreviousL - License CodesNextT - Testability Codes

Last updated 16 days ago

Was this helpful?

Introduction

These output codes are associated with checks performed on your Java code by Diffblue Cover and highlight code issues that prevent tests being created.

R002 - Missing observers

There are no fields that could be asserted on. Add getters or make the fields package-private.

R005 - Unable to load class

Please check that the class is available on your test runtime classpath. See

R006 - Static initializer failed

A static initializer threw an exception while trying to load a class. Make sure static initializers can be executed without throwing exceptions.

R007 - Class not accessible

Make sure all classnames are accessible from their targetPackage, for example by making them public.

R008 - Failed to instantiate class under test

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: See for further troubleshooting of this issue.

R011 - Sandboxing policy violation

R012 - JNI sandbox policy violation

R013 - No inputs found that don't throw a trivial exception

R018 - Trace file incomplete

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 Diffblue Cover.

R019 - Method not in trace

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.

R020 - Temporary files were created but not deleted

Please ensure that temporary files are deleted in the method under test.

R021 - Missing Spring component

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.

R023 - Out of memory

R026 - Failed to create Spring context

R027 - Missing beans when creating Spring context

R028 - Incomplete repository information

Diffblue Cover needs to understand the Data Type and the ID Type in order to write repository tests. Diffblue Cover also needs an ID Getter method that gets the identifier field from a Data Type instance, this should be annotated@Id and be of type ID Type. Alternatively, if using composite keys with@IdClass, the entity class must be annotated with @IdClass which must reference the ID Type. Finally, better tests can be written if a Save Method is found taking a Data Type instance and storing it in the repository.

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.

R031 - Method may be time-sensitive

R032 - User requested skeleton tests only

Only skeleton tests have been created for this method, as requested by the user. These should be completed manually, as needed.

R033 - Missing Spring properties

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.

R035 - Unsupported virtual threads call detected

Diffblue Cover does not support writing tests for methods that use virtual threads.

R036 - CSRF protection enabled

Controller tests cannot be written because CSRF protection is enabled by Spring-security. Write a custom configuration to deactivate CSRF for unit tests, which can then be imported in the base class for your test.

R037 - Unable to use annotation value

Diffblue Cover was unable to write a test using a value specified by an annotation.

R038 - Spring repository tests skipped

Diffblue Cover skipped test creation for Spring repository. Check whether Spring boot tests are enabled. If they are not, enable them.

R074 - Unable to create static mock

Mockito was unable to create a static mock for a class. Please review the underlying cause in the output message or log.

R081 - Exception in arrange section

Diffblue Cover was unable to construct an instance of the class under test because a step in the arrange section threw an exception.

R082 - Can't create a parameter for constructor

Diffblue Cover was unable to construct an instance. Diffblue Cover failed to create a parameter for the constructor or factory method call.

R083 - Can't find a suitable constructor

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.

R084 - Enum has no constants defined

Diffblue Cover was unable to test an instance of an enum as no constants are defined.

R085 - Unbounded loop in method under test

Diffblue Cover was unable to write a test that does not get into a potentially unbounded loop.

R086 - Unable to use custom base class

Diffblue Cover was unable to use the requested base class. Please check that the requested base class is public and has an accessible constructor.

R087 - Can't create required class instance

Diffblue Cover was unable to create an instance of a required class.

R088 - Method name is a reserved keyword

Diffblue Cover does not support methods with names that coincide with reserved keywords

Diffblue Cover's default sandboxing policy disallowed test writing in order to prevent your code from damaging your system environment. Please see.

Diffblue Cover ran code in your project that tried to load a JNI library, violating the default security policy. See 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.

Diffblue Cover failed to create tests because it ran out of memory. See:

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.

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. For further detail troubleshooting Spring contexts please see. Otherwise, please contact with details of the entire output message and the source code of the class under test.

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 for details.

our documentation for further guidance.
custom-inputs
Working with code R008
Working with code R011
Java Native Interface
Working with code R013
Memory Management
Working with code R026
Working with code R026
Diffblue Support
Working with code R031