# Spring configuration options

To set your Spring configuration options for Cover Plugin go to `Diffblue > Change Settings > Spring` in IntelliJ.

## Mocking in Spring integration tests

Check the `Enable integration tests` option to limit mocking for Spring projects to Repository dependencies only - Spring handles the rest directly. If this option is not selected then mocking may be implemented for a wider scope of dependencies.

* Spring Repositories are classes implementing `org.springframework.data.repository.Repository` or those annotated with `org.springframework.stereotype.Repository`.
* This option is not applied when creating tests for `@Controller` classes.

## Spring contexts

Check the `Use Spring contexts` option to enable Spring contexts for dependency injection in tests written by Diffblue Cover.

## Spring Boot Tests

Check the `Use Spring Boot to write tests` option for dependency injection using, amongst the others,`@MockBean`. If this option is not enabled Cover will instead fall back to other dependency injection mechanisms for tests such as Mockito's `@InjectMocks` and `@Mock`. This option may be useful depending on whether or not a Spring context needs to be loaded for a particular unit test suite.

**Note:** This functionality is in Beta stage, hence there could be cases where some inconsistencies and limitations might still be present.

## Active profiles

Use the `Active Profiles` text box to specify one or more Spring profiles to activate while writing tests (comma separated list). If no profiles are defined, Cover will automatically use the `test` profile (if available), otherwise the default Spring profile will be used.


---

# 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/features/cover-plugin/cover-plugin-settings/spring-configuration-options.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.
