Hi,

Let's say i have a class which represents an user, called "User" and an 
interface implemented by this class called "IUser". The IUser interface 
declares one method called "sendMail(String text)" for the user. Also i 
created an interceptor/ aspect via the Guice bindInterceptor method for my 
IUser. The aspect simply logs every call for the sendMail() method, that 
works fine.

1.) But how do i test, that my aspect works properly? I don't have an idea 
how to write an unit test for that. My idea was to create an IUser mock and 
trigger the public sendMail() method from outside. But how do I create an 
aspect on top of a mock?

2.) In my aspect/ interceptor i simply check the methodname like this: "if 
methodname == 'sendMail'". But if i rename/ refactor the sendMail Method my 
aspect won't work anymore. Is there a better way to to that?

Thanks,
Dirk

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-guice/-/6flNLUy1tfwJ.
To post to this group, send email to google-guice@googlegroups.com.
To unsubscribe from this group, send email to 
google-guice+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to