3

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
Khaled Ahmed
  • 1,074
  • 8
  • 21

1 Answers1

4

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.

thunderhook
  • 497
  • 5
  • 21