February 2015
Intermediate to advanced
178 pages
3h 47m
English
The org.springframework.test.util package contains ReflectionTestUtils, which is a collection of reflection-based utility methods to set a non-public field or invoke a private/protected setter method when testing the application code, as follows:
@Autowired, @Inject, and @Resource, which provide dependency injections for private or protected fields, setter methods, and configuration methodsThe following example demonstrates the capabilities of ReflectionUtils:
Secret class in the com.packt.testutils package with a private ...Read now
Unlock full access