JHIpster:EmployeeMapperImpl不能被解析为mapperTest类的类型错误。

问题描述 投票:0回答:1

我正在学习JHIpster,我已经创建了一个项目,并且我可以使用mvn命令从终端运行它,但是当我在eclipse中打开项目时,我得到了错误,我只创建了一个名为employee的实体,并且我得到了错误EmployeeMapperImpl不能被解析为EmployeeMapperTest.java类中的一个类型。

jdl文件

    /**
     * The Employee entity.
     */
    entity Employee {
        /**
        * The firstname attribute.
        */
        Name String,
        firstName String,
        lastName String,
        email String,
        phoneNumber String,
        hireDate Instant,
        salary Long,
        commissionPct Long
    }
    relationship ManyToMany{
        Employee{manager} to Employee{subordinate}
    }
paginate * with pagination
service all with serviceImpl
dto * with mapstruct

EmployeeMapperTest.java

    package com.mycompany.myapp.service.mapper;

    import org.junit.jupiter.api.BeforeEach;
    import org.junit.jupiter.api.Test;
    import static org.assertj.core.api.Assertions.assertThat;


    public class EmployeeMapperTest {

        private EmployeeMapper employeeMapper;

        @BeforeEach
        public void setUp() {
//This line causes the error
            employeeMapper = new EmployeeMapperImpl();
        }

        @Test
        public void testEntityFromId() {
            Long id = 2L;
            assertThat(employeeMapper.fromId(id).getId()).isEqualTo(id);
            assertThat(employeeMapper.fromId(null)).isNull();
        }
    }

我在JHipster项目中没有看到任何MapperImpl类,是不是我在JDL文件中遗漏了什么? 如何解决这个问题?

spring-boot jhipster
1个回答
0
投票

你可以在下面找到这个类: ...\src\。检验 \(javaorgjunit/jupiter/service/mapper;))

© www.soinside.com 2019 - 2024. All rights reserved.