java - JMockit throwing errors -


i'm trying mock interface class using jmockit, following example in documentation. however, im getting error saying

java.lang.illegalargumentexception: matching real methods not found following mocks: package.jmockittest$1#httpresponse(package.httpclient client)

@test public void mockinganinterface() throws exception {     httpclient client = new mockup<httpclient>() {       @mock       string httpresponse(httpclient client)       {          return "100";       }    }.getmockinstance();      weblogic weblogic = new weblogic();     assert.assertequals(client.httpresponse("asd"), "100");  } 

you passing string @ line client.httpresponse("asd"), "100" while mocked method expects httpclient need mock method,

@mock string httpresponse(string client) {              return "100"; } 

in mockup or

you need change call use httpclient instead of string


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -