fix(core): use Mappers.getMapper to avoid IDE unresolved reference error for MapStruct

This commit is contained in:
jade
2026-07-09 10:11:43 +09:00
parent 8294c66711
commit 377d0d2a6f
2 changed files with 5 additions and 2 deletions

View File

@@ -8,6 +8,9 @@ import org.mapstruct.Mapping;
@Mapper(componentModel = "spring") @Mapper(componentModel = "spring")
public interface SampleMciMapper { public interface SampleMciMapper {
// 테스트 환경 등에서 Spring Bean 주입 없이 직접 접근하기 위한 INSTANCE 제공 (IDE 에러 방지용)
SampleMciMapper INSTANCE = org.mapstruct.factory.Mappers.getMapper(SampleMciMapper.class);
/** /**
* AI Agent의 DTO를 MCI 통신용 DTO로 변환합니다. * AI Agent의 DTO를 MCI 통신용 DTO로 변환합니다.
* 필드명이 달라도 @Mapping 어노테이션으로 손쉽게 연결할 수 있습니다. * 필드명이 달라도 @Mapping 어노테이션으로 손쉽게 연결할 수 있습니다.

View File

@@ -10,8 +10,8 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
public class SampleMciMapperTest { public class SampleMciMapperTest {
// MapStruct가 자동 생성한 구현체를 직접 가져와서 테스트합니다. (의존성 주입 불필요) // MapStruct가 자동 생성한 구현체를 가져와서 테스트합니다. (IDE 에러 방지를 위해 INSTANCE 참조)
private final SampleMciMapper sampleMciMapper = new SampleMciMapperImpl(); private final SampleMciMapper sampleMciMapper = SampleMciMapper.INSTANCE;
@Test @Test
@DisplayName("AI 파라미터 DTO가 MCI DTO로 정확히 매핑되는지 테스트") @DisplayName("AI 파라미터 DTO가 MCI DTO로 정확히 매핑되는지 테스트")