I'm trying to do an integration test. These are my components:
UsersService
@ManageSession
public List<T> get() {
//...
return something;
}
ManageSessionAspect
@Autowired
AuthService authService;
@Before("manageSessionMethod()") //methods annotated with @ManageSession
public void doSomething() {
authService.doSomething();
}
I need to test UsersService.get()
method. But I want to disable the aspect OR I want to be able to mock the AuthService
inside it.
I have tried using an is()
pointcut, but I get:
if() pointcut designator isn't supported by Spring.
Can you help me? Thanks.