• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

TestCase in Mokito

 
Ranch Hand
Posts: 157
Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I have below method that i want to test.


And i tried the below test case for that.As I just stared mokito Can some one advice at what points i m doing wrong.

Thanks
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you need to go back to the manual and understand WHEN and WHY you would want to use a mock. In short, you use a mock to simulate what a collaborator would do. It is appropriate to mock a collaborator if setting it up is expensive or too involved or if the real collaborator crosses system boundaries to do its work, such as access the file system or hit a web service or a database. With something like a Map, there is hardly ever any good reason to mock that. A Map resides in memory, so why don't you just use a real one instead of mocking it?
 
reply
    Bookmark Topic Watch Topic
  • New Topic