feat:单元测试类集成

dev
wangxy 1 year ago
parent 6fffe167fe
commit 3a541458ca

@ -68,6 +68,14 @@
<version>2.1.0</version>
</dependency>
<!--单元测试-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>

@ -0,0 +1,23 @@
package com.hyp;
import com.hyp.common.constant.HttpStatus;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.Rollback;
import org.springframework.transaction.annotation.Transactional;
import org.junit.jupiter.api.Assertions;
@SpringBootTest
@Transactional(rollbackFor = Exception.class)
@Rollback
public class HypApplicationTest {
@Test
public void test(){
Assertions.assertEquals(200, HttpStatus.SUCCESS);
}
}

@ -0,0 +1,24 @@
package com.hyp.manager;
import com.hyp.HypApplicationTest;
import com.hyp.system.domain.vo.ApplyInfoListVO;
import com.hyp.web.controller.manager.ApplyInfoListManager;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
class ApplyInfoListManagerTest extends HypApplicationTest {
@Autowired
private ApplyInfoListManager applyInfoListManager;
@Test
void objectTest() {
ApplyInfoListVO detail = applyInfoListManager.detail("1c1e0cfeec36fa881d7cb8d82dd9d036");
Assertions.assertNotNull(detail);
}
}
Loading…
Cancel
Save