How to mock riak java client?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to unit test code that uses com.basho.riak:riak-client:2.0.0. I mocked all riak client classes and was hoping to get a useless but working test. However, this fails with a null pointer: java.lang.NullPointerException at com.basho.riak.client.api.commands.kv.KvResponseBase.convertValues(KvResponseBase.java:243) at com.basho.riak.client.api.commands.kv.KvResponseBase.getValue(KvResponseBase.java:150) at com.basho.riak.client.api.commands.kv.FetchValue$Response.getValue(FetchValue.java:171) My test looks like this: @Test public void