From d43ec1864433a0c5cfd8e5b93b8faccc182ae56f Mon Sep 17 00:00:00 2001 From: liukun <2802223182@qq.com> Date: Tue, 21 Dec 2021 14:34:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/com/qiniu/caster/CasterTest.java | 73 +++++++------------ 1 file changed, 27 insertions(+), 46 deletions(-) diff --git a/src/test/java/test/com/qiniu/caster/CasterTest.java b/src/test/java/test/com/qiniu/caster/CasterTest.java index a29cf2f91..7b09bc778 100644 --- a/src/test/java/test/com/qiniu/caster/CasterTest.java +++ b/src/test/java/test/com/qiniu/caster/CasterTest.java @@ -6,13 +6,14 @@ import com.qiniu.http.Response; import com.qiniu.util.Auth; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.util.HashMap; public class CasterTest { - String accessKey = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW"; //config.getAccesskey(); - String secretKey = "pCav6rTslxP2SIFg0XJmAw53D9PjWEcuYWVdUqAf"; //config.getSecretKey(); + String accessKey = ""; //config.getAccesskey(); + String secretKey = ""; //config.getSecretKey(); CasterManager casterManager; @BeforeEach @@ -21,13 +22,6 @@ public void setUp() throws Exception { this.casterManager = new CasterManager(auth); } - - @Test - public void casterInfo() throws QiniuException { - Response result = casterManager.getCasterInfo("u1380432151abcde"); - System.out.println(result.bodyString()); - } - @Test public void testCreat() { CasterParams casterParams = new CasterParams(); @@ -40,58 +34,45 @@ public void testCreat() { CasterParams.Canvas canvas = new CasterParams.Canvas("720P", 720, 480); casterParams.setCanvas(canvas); casterParams.setMonitors(hashMap); - Response result = casterManager.createCaster("abcdefg", casterParams); - try { - System.out.println(result.bodyString()); - } catch (QiniuException e) { - e.printStackTrace(); - } + Response result = casterManager.createCaster("abcde", casterParams); + assert result.statusCode == 200; } @Test - public void tsetStop() { + public void casterInfo() throws QiniuException { + Response result = casterManager.getCasterInfo("u1380432151abcde"); + assert result.statusCode == 200; + } + + @Test + public void testStop() { Response result = casterManager.stopCaster("u1380432151abcde"); - try { - System.out.println(result.bodyString()); - } catch (QiniuException e) { - e.printStackTrace(); - } + assert result.statusCode == 200; } + @Test public void testStart() { Response result = casterManager.startCaster("u1380432151abcde", 2, 1); - try { - System.out.println(result.bodyString()); - } catch (QiniuException e) { - e.printStackTrace(); - } - } - @Test - public void testDelete() { - Response result = casterManager.deleteCaster("u1380432151abcde"); - try { - System.out.println(result.bodyString()); - } catch (QiniuException e) { - e.printStackTrace(); - } + assert result.statusCode == 200; } @Test public void testChangeLayouts() { - Response result = casterManager.changeLayout("u1380432151abcde", 3, "aaabbbccc"); - try { - System.out.println(result.bodyString()); - } catch (QiniuException e) { - e.printStackTrace(); - } + Response result = casterManager.changeLayout("u1380432151abcde", 2, "aaabbbccc"); + assert result.statusCode == 200; } + @Test public void testUpdateLayouts() { Response result = casterManager.updateLayout("u1380432151abcde", 0, "liuliu", null, null, "aaabbbccc"); - try { - System.out.println(result.bodyString()); - } catch (QiniuException e) { - e.printStackTrace(); - } + assert result.statusCode == 200; + } + + + @Test + public void testDelete() { + Response result = casterManager.deleteCaster("u1380432151abcde"); + assert result.statusCode == 200; } + }