package com.qxgmat.help; import com.itextpdf.text.DocumentException; import com.qxgmat.data.dao.entity.User; import org.junit.Test; 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.SpringRunner; import java.io.IOException; @RunWith(SpringRunner.class) @SpringBootTest public class pdf { @Autowired private PdfHelp pdfHelp; @Test public void contextLoads() throws IOException, DocumentException { User user = User.builder().id(10).realName("高杰").mobile("15221504895").realStatus(1).build(); pdfHelp.generatePdfImage(user, "/upload/123.pdf", true); } }