Win a copy of Functional Reactive Programming this week in the Other Languages 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
Bartender
Pie
Posts: 7794
62
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic