Khaled Ahmed
Khaled Ahmed

Reputation: 1134

Intellij doesn't see the generated class by MapStruct

When I use MapStruct in spring-boot it generates an impl class and I want to have access on that file to import in unit test but intellij doesn't see it

@SpringBootTest(classes={OrderMapperImpl.class})

and I got error

Can't find a symbol OrderMapperImpl

Upvotes: 6

Views: 3434

Answers (1)

thunderhook
thunderhook

Reputation: 580

You can tell IntelliJ to pick up mapstructs generated classes as source files by right-clicking on the directory target/generated-sources/annotations > Mark directory as... > Generated Sources Root.

If you have configured another output path you need to choose that instead.

Upvotes: 8

Related Questions