Skip to content

Introduce MockEnvironment in the spring-test module [SPR-9492] #14126

@spring-projects-issues

Description

@spring-projects-issues

Sam Brannen opened SPR-9492 and commented

Status Quo

For legacy reasons, a MockEnvironment implementation already exists in multiple places within Spring's test suite. Furthermore, it is not available to the general public.

Goal

MockEnvironment can be used as a general purpose stub within developer tests (i.e., not just within Spring's own test suite). As such, it should be promoted to a first-class citizen in the spring-test module, alongside the existing MockPropertySource.

Doing so would eliminate at least the copy of MockEnvironment in the base spring module. It would also solve the Javadoc warning that MockEnvironment is not visible from MockPropertySource in the spring-test module.

Deliverables

  1. Move MockEnvironment to the spring-test module.
  2. Delete all other occurrences of MockEnvironment, where possible.
  3. Clean up the Gradle build if necessary.
    • deemed unnecessary
  4. Document the existence of MockEnvironment and MockPropertySource in the testing chapter of the reference manual.

Affects: 3.1 GA

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions