Hi All,
I am GSoC student for this year working of Human Resource Module. As part of my first iteration I am writing unit tests.I have this doubt about testing authorization.
I writing my test classes extending BaseModuleContextSensitiveTest. I went through the source code and found there is this authenticate method that is used to authenticate the current user. The method uses admin and test as default username password, I have changed password for admin on my machine. The javadoc says that there will be a popup asking for username and password, I do not get anything like this when I run the tests.
I am testing services and I have authorization constraints implemented using @Authorized annotation on my services. All my tests are green even if I do not call authenticate() method. I am not getting this. I want to test if the authorization constraints are enforced. How to do this? Am I making any conceptual mistake?
Thanks in advance...
Ragerds,
Sandeep