Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to mock a complicate content

 
Wladimir Babitzki
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I need, it should be a possibility to go through a html page, sort links from it and look if the pages, referenced with the links, have also links. All the found links should be represented as a tree structure, whereby each link element should point to its children elements, that also can have links.

The implementation looks like:




That�s not clear for me, what is the best way to test the searchLinksAsTree? It�s simple with searchLinksAsList, there I can feed a mock content and check expected results, but to mock the content for the multi dimensional searchLinksAsTree is hard work.

I�ll appreciate any suggestion

Thank you
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about mocking that searchListsAsList() method while testing for searchLinksAsTree()?

I.e., instead of

try something like
 
Wladimir Babitzki
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! It�s really the simplest and nicest solution!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic