This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to do unit testing for Cookies in JMock  RSS feed

 
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: 11146
160
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac 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
Boost this thread!