springBoot——整合junit

spring整合junit复习

springBoot整合junit

package com.example.springboot_04;

import com.example.springboot_04.service.ServiceBook;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
class SpringBoot04ApplicationTests {

    @Autowired
    private ServiceBook serviceBook;
    @Test
    void contextLoads() {
        serviceBook.save();
    }

}
posted @ 2023-07-20 11:00  会秃头的小白  阅读(6)  评论(0编辑  收藏  举报