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; } + }