junit - Java constructor mockup -


could please 1 tell me how mock java constructor ? tried below. doesn't work.

new mockup<usercompanydivision>() {      @mock     public usercompanydivision(string com, string div)     {     }     }; 

since constructors don't have names methods do, jmockit uses special name "$init" corresponding @mock methods. example:

new mockup<usercompanydivision>() {     @mock // matches constructor having same parameters     void $init(string com, string div) {         // ...     } }; 

note described in api documentation @mock.


Comments

Popular posts from this blog

r - Trouble relying on third party package imports in my package -

Payment information shows nothing in one page checkout page magento -