In fact, the previous similar, very similar
// define pointcuts unified
@Pointcut ( "Execution (service.UserService *. * (..))")
public void the pointcut () {
}
When an exception occurs simulation program running
Running the test method:
The final enhancement:
Others are the same, the final operating results:
Surround enhancements:
Run the test class:
14:30:38 01-01 [the INFO] aop.UserServiceLogger
- call service.impl.UserServiceImpl@1623b78d the void service.UserService.addNewUser (User) process, process parameters are: [entity.User@4efbca5a]
user information stored database
injected into the user object information are: entity.User@4efbca5a
01-01 14:30:38 [the iNFO] aop.UserServiceLogger
- call service.impl.UserServiceImpl@1623b78d the void service.UserService.addNewUser (user) method, method return value: null