Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring security with JUnit

 
Mohan rvscas
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends ,

i am new to spring security.

i have created a login form with username and password.

(mapping also done with authority in applicationContext.xml file).

i am getting username and password from the data base.

By using spring security the user name and password is checked properly.

after running the form its executing properly and iam getting correct page.


Now,

i need to test the methods using junit test cases.

in spring security we are using jar file to login and providing access through the <interceptor-url> tags.

here no need to write the code.

so i do not know how to test the login form using junit test cases.

please give me the solution.

if you have any references please give me.

Thanks in advance


 
Mark Secrist
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What methods are you wanting to test? What you are suggesting sounds more like an integration test than a unit test. If you are wanting to test the security mechisms or your configuration of them via the spring config files, you might want to use a browser based test tool like CubicTest/Selenium. This would allow you to test loging in with proper user, invalid user, etc.

Without more information, it's hard to make a better recommendation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic