• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Mockito issue unit test

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I have a method (which compares JSON headers with HTTP headers and returns true if they match, else it returns false) against which I am trying to run a unit test written in Mockito. The method is as follows:



My unit test is as follows:



The test does not produce an output and instead is stuck in an infinite loop. Any reason why? Please help me.
 
Saloon Keeper
Posts: 12008
257
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you mocking all that stuff? Can't you just write your test like this?
 
Nesamani Raman
Greenhorn
Posts: 15
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That works, it was so naive of me not to think of such an easy way. Thank you Stephan.
 
You may have just won ten million dollars! Or, maybe a tiny ad.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic