Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 of 4 tasks
spring-projects-issues opened this issue Jun 11, 2012 · 2 comments
Closed
3 of 4 tasks
Assignees
Labels
in: test Issues in the test module type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

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

@spring-projects-issues
Copy link
Collaborator Author

Sam Brannen commented

Submitted pull request #111.

@spring-projects-issues
Copy link
Collaborator Author

Sam Brannen commented

Merged pull request:

Introduce MockEnvironment in the spring-test module

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

This commit promotes MockEnvironment to a first-class citizen in the spring-test module, alongside the existing MockPropertySource.

In addition, the following house cleaning has been performed.

  • deleted MockPropertySource from the spring-expression module
  • deleted MockEnvironment from the "spring" integration testing module
  • updated test copies of MockPropertySource and MockEnvironment
  • documented MockEnvironment and MockPropertySource in the testing
    chapter of the reference manual

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants