From 121bcc159ea086bc0b8fff4752d3601fcbfa3d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=98=E9=9C=B2?= <1137738840@qq.com> Date: Mon, 18 Oct 2021 18:07:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ContentType=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E6=96=B9=E6=B3=95=E7=9A=84=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/hutool/http/ContentTypeTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 hutool-http/src/test/java/cn/hutool/http/ContentTypeTest.java diff --git a/hutool-http/src/test/java/cn/hutool/http/ContentTypeTest.java b/hutool-http/src/test/java/cn/hutool/http/ContentTypeTest.java new file mode 100644 index 000000000..1d03c44eb --- /dev/null +++ b/hutool-http/src/test/java/cn/hutool/http/ContentTypeTest.java @@ -0,0 +1,19 @@ +package cn.hutool.http; + +import cn.hutool.core.util.CharsetUtil; +import org.junit.Assert; +import org.junit.Test; + +/** + * ContentType 单元测试 + * + * + */ +public class ContentTypeTest { + + @Test + public void testBuild() { + String result = ContentType.build(ContentType.JSON, CharsetUtil.CHARSET_UTF_8); + Assert.assertEquals("application/json;charset=UTF-8", result); + } +}