Skip to content

Tag: junit5

How to mock MapStruct nested mapper in JUnit5

I have been searching a solution for about a day now. I still cannot produce a working example. My problem is simple. I have a mapper uses another mapper: My test class which tests mapper works as it should: However, NullPointerException is thrown on the line where roleMapper is called in automatically genera…