<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单元测试相关依赖