fix(core): use Mappers.getMapper to avoid IDE unresolved reference error for MapStruct
This commit is contained in:
@@ -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 어노테이션으로 손쉽게 연결할 수 있습니다.
|
||||||
|
|||||||
@@ -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로 정확히 매핑되는지 테스트")
|
||||||
|
|||||||
Reference in New Issue
Block a user