add methods

This commit is contained in:
Looly
2021-03-26 21:50:21 +08:00
parent 6a8e5d8b6c
commit 2484c82584
8 changed files with 163 additions and 172 deletions

View File

@@ -1,5 +1,6 @@
package cn.hutool.extra.servlet;
import org.junit.Ignore;
import org.junit.Test;
import javax.servlet.http.HttpServletResponse;
@@ -8,18 +9,22 @@ import java.nio.charset.StandardCharsets;
/**
* ServletUtil工具类测试
*
* @author dazer
* @date 2021/3/24 15:02
* @see ServletUtil
*/
public class ServletUtilTest {
@Test
@Ignore
public void writeTest() {
HttpServletResponse response = null;
byte[] bytes = new String("地球是我们共同的家园,需要大家珍惜.").getBytes(StandardCharsets.UTF_8);
byte[] bytes = "地球是我们共同的家园,需要大家珍惜.".getBytes(StandardCharsets.UTF_8);
//下载文件
// 这里没法直接测试,直接写到这里,方便调用;
//noinspection ConstantConditions
if (response != null) {
String fileName = "签名文件.pdf";
String contentType = "application/pdf";// application/octet-stream、image/jpeg、image/gif