Skip to content

Tag: mapstruct

Mapstruct – no qualifying bean of type

I try to autowire my mapstruct mapper: This works: But WHY I can’t use: I get the following error: Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘pl.comp.window.application.mapper.WindowDtoMapper’ available: expected at least 1 bean wh…

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…

Mapping multiple fields to one in Mapstruct?

I need to map from an open banking class to my core class. I am working with mapstruct. I need to map multiple enum fields to one on my core class. But i think mapstruct doesn’t support mapping multiple fields. Any tricky way or a solution for that? Thanks in advance! Here is my enum values from open ba…

Using MapStruct together with Lombok under Quarkus

I’m following the guide at the MapStruct blog and having trouble using this 3 technology together. I’ve been trying several approaches from the MapStruct docs, bug-reports, posts from here but in every case I end up receiving the following exception during the build. Have anyone successfully used …

How to tests and mock mapstruct converter?

I’m using MapStruct framework on my java Gradle project, and it works perfectly but I just want to test : MapStruct generated sources (converter) service class (calls MapStruct’s converter) I have tried to use another topic to do this but it is not working for me. This is my MapStruct interface : …