Sync Javadoc and reference manual regarding ReflectionTestUtils

This commit is contained in:
Sam Brannen
2015-07-21 17:10:00 +02:00
parent 6b84c332fd
commit 420e8ca833
2 changed files with 10 additions and 4 deletions

View File

@@ -42,7 +42,8 @@ import org.springframework.util.StringUtils;
* {@code private} or {@code protected} field access as opposed to
* {@code public} setter methods for properties in a domain entity.</li>
* <li>Spring's support for annotations such as
* {@link org.springframework.beans.factory.annotation.Autowired @Autowired} and
* {@link org.springframework.beans.factory.annotation.Autowired @Autowired},
* {@link javax.inject.Inject @Inject}, and
* {@link javax.annotation.Resource @Resource} which provides dependency
* injection for {@code private} or {@code protected} fields, setter methods,
* and configuration methods.</li>

View File

@@ -93,14 +93,19 @@ objects, targeted at usage with Spring's Portlet MVC framework.
==== General utilities
The `org.springframework.test.util` package contains `ReflectionTestUtils`, which is a
collection of reflection-based utility methods. Developers use these methods in unit and
integration testing scenarios in which they need to set a non- `public` field or invoke
a non- `public` setter method when testing application code involving, for example:
integration testing scenarios in which they need to change the value of a constant, set
a non-++public++ field, invoke a non-++public++ setter method, or invoke a non-++public++
_configuration_ or _lifecycle_ callback method when testing application code involving
use cases such as the following.
* ORM frameworks such as JPA and Hibernate that condone `private` or `protected` field
access as opposed to `public` setter methods for properties in a domain entity.
* Spring's support for annotations such as `@Autowired`, `@Inject`, and `@Resource,`
* Spring's support for annotations such as `@Autowired`, `@Inject`, and `@Resource`,
which provides dependency injection for `private` or `protected` fields, setter
methods, and configuration methods.
* Use of annotations such as `@PostConstruct` and `@PreDestroy` for lifecycle callback
methods.
[[unit-testing-spring-mvc]]