Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to do unit testing for Cookies in JMock

 
Nitesh Patel
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I come to a scenario where I need to update my test cases to test Cookies logic. I am unable to find out how can I do this in JMock ? Below is my code,


I am already doing unit test for "header" same way I need to do for Cookies. Can someone please guide me ?
Regards,
Nitesh
 
Junilu Lacar
Sheriff
Posts: 10096
120
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The biggest problem you have with code like that is probably figuring out where the actual class under test went to because, well, I don't see one. All I see are context, request, and response and they are all impostors. If you're testing for headers the same way, then that's double trouble for you. What exactly is the class with the real production code that you want to test?
 
Did you just should on me? You should read this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!