mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-02-01 06:21:56 +08:00
[test] 新增查询根据手机号查询用户信息的测试用例
This commit is contained in:
7
pom.xml
7
pom.xml
@@ -240,6 +240,11 @@
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||
@@ -247,7 +252,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-test</artifactId>
|
||||
<artifactId>kotlin-test-junit</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -148,7 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
<select id="findByPhoneNumberStartingWith" parameterType="String" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.phonenumber = CONCAT(#{phoneNumber},"%") and u.del_flag = '0'
|
||||
where u.phonenumber like CONCAT(#{phoneNumber},"%") and u.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.ruoyi.system.service
|
||||
|
||||
import com.alibaba.fastjson.JSONObject
|
||||
import com.ruoyi.system.RuoYiSystemApplication
|
||||
import org.junit.runner.RunWith
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.boot.test.context.SpringBootTest
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner
|
||||
import kotlin.test.Test
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner::class)
|
||||
@SpringBootTest(classes = [RuoYiSystemApplication::class], webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
class ISysUserServiceTest {
|
||||
@Autowired
|
||||
lateinit var iSysUserService: ISysUserService
|
||||
|
||||
@Test
|
||||
fun findByPhoneNumberStartingWithTest() {
|
||||
println(JSONObject.toJSONString(iSysUserService.findByPhoneNumberStartingWith("1")))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user