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 Issue: SPR-9492
This commit is contained in:
@@ -47,6 +47,22 @@
|
||||
<section xml:id="mock-objects">
|
||||
<title>Mock Objects</title>
|
||||
|
||||
<section xml:id="mock-objects-env">
|
||||
<title>Environment</title>
|
||||
|
||||
<para>The <literal>org.springframework.mock.env</literal> package
|
||||
contains mock implementations of the
|
||||
<interfacename>Environment</interfacename> and
|
||||
<interfacename>PropertySource</interfacename> abstractions introduced
|
||||
in Spring 3.1 (see <xref
|
||||
linkend="new-in-3.1-environment-abstraction" /> and <xref
|
||||
linkend="new-in-3.1-property-source-abstraction" />).
|
||||
<classname>MockEnvironment</classname> and
|
||||
<classname>MockPropertySource</classname> are useful for developing
|
||||
<emphasis>out-of-container</emphasis> unit tests for code that depends
|
||||
on environment-specific properties.</para>
|
||||
</section>
|
||||
|
||||
<section xml:id="mock-objects-jndi">
|
||||
<title>JNDI</title>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user