Set up riak for unittest in Java

Fenglin 凤麟 fenglinlfl at gmail.com
Tue Jul 29 20:35:07 EDT 2014


Is there an easy way to set up riak for unittest purpose?

I have some java service that talks to Riak, and I want to write unittest
for that flow to make sure the Riak client is properly triggered.

I tried Mockito to mock Riak client out, but then I realized that I need to
mock out the fetchBucket and execute() as well otherwise I will get
NullPointerException left and right.



My code snippet is very basic as following (with riakClient being mockito
mock)

      Bucket bucket = riakClient.fetchBucket("some_key").execute();
      return bucket.fetch(hostingId.toString(), Result.class).execute();


Thanks!

-Fenglin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20140729/ea91ebbf/attachment.html>


More information about the riak-users mailing list