0

I am testing an application that uses struts2 framework with junit and mockito. I'm getting an illegalstateexception saying that the plugin Mockmaker cannot be initialized I have tried adding dependencies like bytebuddy and objenesis but it is still not working Can someone please guide me on this as I am new to struts2

Exception:

java.lang.IllegalStateException: Could not initialize plugin MockMaker

Test code:

@RunWith(MockitoJUnitRunner)
Public class HTest{

    @InjectMocks
    ActionClassToBeTested a

    @Mock //issue with this, I checked by commenting everything
    HttpServletRequest request

    @Mock
    HttpServletResponse response

    @Test
    Public void TestMethod(){
        //Some test logic
    }

}
Roman C
  • 49,761
  • 33
  • 66
  • 176
mk1998
  • 1
  • 1
  • 1
    You need to include the code of a minimal test which produces this error, and the full stack trace of the exception it produces. – tgdavies Dec 24 '20 at 11:18
  • Please include the full stack trace of the exception – tgdavies Dec 25 '20 at 22:56
  • Does this help https://stackoverflow.com/questions/41956692/could-not-initialize-plugin-interface-org-mockito-plugins-mockmaker ? – tgdavies Dec 25 '20 at 22:57
  • Already tried it and it's not working, that's why I posted my question separately – mk1998 Dec 26 '20 at 18:08

0 Answers0