springboot单元测试相关依赖

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>

package com.sdt;

import com.sdt.mapper.UserCertMapper;
import org.springframework.beans.factory.annotation.Autowired;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest
public class SignAndVerifyManagerApplicationTests {

@Autowired
private UserCertMapper userCertMapper;

@Test
public void contextLoads() {
int keyId = userCertMapper.selectKeyId("sfdjfdjfsdjfsdfjdkfjsdjffk231231231231231213123123123fdsfsfdsfsdf2");
log.info("keyId=={}", keyId);
}

}

springboot单元测试相关依赖

上一篇:对象池在 .NET (Core)中的应用[1]: 编程体验


下一篇:Linq分组后,再对分组后的每组数据进行排序,获取每组的第一条记录