MyBatisPlusIServiceTest.kt 769 字节
Newer Older
2
2293736867 已提交
1 2 3 4 5 6 7 8 9
package com.example.demo

import com.example.demo.entity.User
import com.example.demo.service.MyBatisPlusIService
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest

@SpringBootTest
10
class MyBatisPlusIServiceTest {
2
2293736867 已提交
11
    @Autowired
12
    private lateinit var myBatisPlusIService: MyBatisPlusIService
13

2
2293736867 已提交
14
    @Test
15
    fun save() {
16
        myBatisPlusIService.save(User(3, "iservice-username-3", "iservice-password-3"))
2
2293736867 已提交
17 18 19
    }

    @Test
20
    fun delete() {
21
        myBatisPlusIService.delete(4)
2
2293736867 已提交
22 23 24
    }

    @Test
25
    fun select() {
26
        println(myBatisPlusIService.select(1))
2
2293736867 已提交
27 28 29
    }

    @Test
30
    fun selectAll() {
2
2293736867 已提交
31 32 33
        println(myBatisPlusIService.selectAll())
    }
}