Skip to main content
4-Participant
July 22, 2025
Question

Mocking the MaturityHelper class

  • July 22, 2025
  • 1 reply
  • 373 views

Hello PTC-Community,

While writing JUnit Tests for my Project I found an error while trying to mock the wt.maturity.MaturityHelper class.

org.mockito.exceptions.base.MockitoException: Cannot instrument class wt.maturity.MaturityHelper because it or one of its supertypes could not be initialized

I am using mockito 5.2.0 and JUnit 5.10.0, I also activated mockito-inline as well which should enable supertypes to be mocked, but I can't seem to figure out how to do it.
Any Ideas would help, thanks in advance.

1 reply

Catalina
Community Moderator
July 28, 2025

Hi @Leon_Dietz 

Thank you for your post. 

Your post appears well documented but has not yet received any response. I am replying to raise awareness. Hopefully, another community member will be able to help.

Also, feel free to add any additional information you think might be relevant. It sometimes helps to have screenshots to better understand what you are trying to do.

 

Best regards,

Catalina | PTC Community Moderator