diff --git a/spring-test/src/main/java/org/springframework/test/util/ReflectionTestUtils.java b/spring-test/src/main/java/org/springframework/test/util/ReflectionTestUtils.java index 4f781e555b..f40227fb8c 100644 --- a/spring-test/src/main/java/org/springframework/test/util/ReflectionTestUtils.java +++ b/spring-test/src/main/java/org/springframework/test/util/ReflectionTestUtils.java @@ -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. *
  • 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.
  • diff --git a/src/asciidoc/testing.adoc b/src/asciidoc/testing.adoc index 61878b13a3..c7c2338004 100644 --- a/src/asciidoc/testing.adoc +++ b/src/asciidoc/testing.adoc @@ -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]]