一篇文章帶你掌握主流辦公框架——SpringBoot( 九 )

  1. 我們將頁面相關內容移至Sources文件夾下的static文件夾下

一篇文章帶你掌握主流辦公框架——SpringBoot

文章插圖
  1. 基本修改完畢,采用測試類測試
package com.itheima.service;import com.itheima.domain.Book;import org.junit.jupiter.api.Test;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.boot.test.context.SpringBootTest;import java.util.List;@SpringBootTestpublic class BookServiceTest {@Autowiredprivate BookService bookService;@Testpublic void testGetById(){Book book = bookService.getById(2);System.out.println(book);}@Testpublic void testGetAll(){List<Book> all = bookService.getAll();System.out.println(all);}}最后為大家展示一下SpringBoot整合后的整體框架:
一篇文章帶你掌握主流辦公框架——SpringBoot

文章插圖
結束語好的,關于SpringBoot的內容就介紹到這里,希望能為你帶來幫助!
附錄該文章屬于學習內容,具體參考B站黑馬程序員李老師的SSM框架課程
這里附上鏈接:SpringBoot-01-SpringBoot工程入門案例開發步驟_嗶哩嗶哩_bilibili

推薦閱讀