JMockit method that isn't mocked doesn't work -


sample class

public class test{ @tested classa obja;  @test(expected = myexception.class){   string expectedvar = "expectedvar";   new expectations(obja)   {     {       obja.somemethod();       result = expectedvar;     }   };    // here error, when debug programm doesn't enter following method.   // if connent out new expectations(){{...}} block, programm   // enter method obja.execute()   obja.execute(); } 

could explain happening here , why setting expectations on method changes behaviour of other method?

i didn't find answer, did other way:

new mockup<classa>() {        @mock     string somemethod()     {         return expectedvar;     } }; 

and worked expected


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -