# 2022-06-02

## Diffblue Cover now allows writing tests for code that calls JNI libraries

The Java Native Interface (JNI) mechanism allows your Java applications to load native libraries written in C, C++, assembly, etc. Diffblue Cover executes your application in a sandboxed environment, so that its behavior can be analyzed without external effects, and by default this blocks the execution of JNI libraries. If you believe that Diffblue Cover is safe to call a native library that you use, then you can add it to the list of JNI libraries that are allowed to be loaded.

Using the CLI

Use the `--allow-jni` option to specifically allow JNI libraries with the given name prefix to be loaded. In this case, either `--allow-jni custommagic` or `--allow-jni custom` allows a JNI library `custommagic` to be loaded.

Using the Intellij plugin\
Select Diffblue Cover Settings > Sandboxed Environment Options > Allowed JNI prefixes.

For more information, please see our documentation at: [https://docs.diffblue.com/knowledge-base/cli/jni/](https://github.com/diffblue/website-docs/blob/develop/knowledge-base/cli/jni/README.md)

## Diffblue Cover provides additional guidance when using custom rules

Using custom rules allows you to specify appropriate inputs necessary to write tests for a given method under test, should Diffblue Cover be unable to do them automatically. Custom rules must be formatted correctly.

Diffblue Cover now offers additional guidance if the formatting is incorrect. For further information on custom rules, please see our documentation at: <https://docs.diffblue.com/knowledge-base/cli/custom-inputs/>

## Developer Edition trial available

We are delighted to now offer a 14-day trial version of our Developer Edition, which includes the Diffblue Cover CLI, as part of our new licensing option. We're really excited that you can now "try before you buy"! To download your trial of Diffblue Cover Developer Edition, please [click here](https://www.diffblue.com/try-cover?cover_plan_selected=Developer). Full information on all our options is also available [here](https://diffblue.com/pricing).

## How do I automatically maintain all of these tests?

![](https://info.diffblue.com/hubfs/PluginPopup/ci-workflow.gif)

Use Diffblue Cover on any CI platform to automatically update your unit tests and catch regressions for every commit - watch [this video](https://www.diffblue.com/video-demo/?utm_source=Plugin\&utm_medium=Whatsnew\&utm_campaign=WhatsNewBox) to learn more.

## Enhancements

* Cover now allows additional JNI libraries to be used via the `--allow-jni` CLI option and `Allowed JNI prefixes` section of the IntelliJ Plugin settings. \[Ref: TG-17102]
* Cover now writes tests with `MockitoJUnitRunner` or `MockitoExtension` for Spring classes when `spring-boot-test` is not available. \[Ref: TG-16457]
* Cover now ensures that known-vulnerable Maven dependencies are not downloaded at runtime. \[Ref: TG-17134]
* Cover now provides improved guidance if `R008` (Failed to instantiate class under test) is encountered whilst writing tests. \[Ref: TG-17231]
* CLI: Cover now provides a warning if an empty or malformed custom test inputs file is provided via `DiffblueRules.yml`. \[Ref: TG-16982]

## Resolved Issues

* Resolved an issue, which, in some circumstances, would prevent Cover from writing tests with more than one element in a `Collection` if a test with a single element `Collection` was written. \[Ref: TG-17190]
* Resolved an issue which, in some circumstances, would cause Cover to fail to activate, or write tests, on MacOS. \[Ref: TG-16659]
* Resolved an issue which caused Cover to report `There is no license linked to your product`, rather than an [L016 output code](https://diff.blue/L016), if the computer's hardware configuration had changed. \[Ref: TG-16368]
* IntelliJ Plugin: Resolved an issue which caused Cover to not show a detailed failure message if it was unable to combine tests it had written with an existing test class. \[Ref: TG-17228]
* CLI: Resolved an issue which caused Cover to run integration tests (`*IT.java` classes) tests whilst using the `--coverage-reports` CLI option. \[Ref: TG-17291]

## Known Issues

* CLI: The command `dcover clean --failing` does not work on Gradle projects. This command is now deprecated and `dcover validate` should be used instead. \[Ref: TG-11707]
* For multi-module projects, `--coverage-reports` needs to be run in the sub-modules, not from the root module with `--working-directory`. \[Ref: TG-16876]


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cover-docs-preview.diffblue.com/updates-and-upgrades/release-archive/2022-06-02.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
