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' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -