|
|
|
@ -1,5 +1,7 @@ |
|
|
|
|
package com.bupt.note; |
|
|
|
|
|
|
|
|
|
import com.bupt.note.Model.Paper; |
|
|
|
|
import com.bupt.note.Repository.PaperRepository; |
|
|
|
|
import com.bupt.note.service.FileService; |
|
|
|
|
import org.junit.jupiter.api.BeforeEach; |
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
@ -14,6 +16,7 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders; |
|
|
|
|
import org.springframework.web.context.WebApplicationContext; |
|
|
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
@SpringBootTest |
|
|
|
|
class NoteApplicationTests { |
|
|
|
@ -26,6 +29,9 @@ class NoteApplicationTests { |
|
|
|
|
@Autowired |
|
|
|
|
private FileService fileService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private PaperRepository paperRepository; |
|
|
|
|
|
|
|
|
|
@BeforeEach |
|
|
|
|
public void setUp() { |
|
|
|
|
mvc = MockMvcBuilders.webAppContextSetup(context).build(); |
|
|
|
@ -45,4 +51,10 @@ class NoteApplicationTests { |
|
|
|
|
public void testRead() throws IOException { |
|
|
|
|
String a= fileService.getContent("E:\\JetBrains\\IdeaProjects\\back-end code\\target\\classes\\resources\\static\\txt\\1aee7062-58a7-46e0-ba4d-84a9a14f4205.txt"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testPaper(){ |
|
|
|
|
List<Paper> papers=paperRepository.recommend(); |
|
|
|
|
System.out.println(papers.size()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|