Skip to content

Commit

Permalink
修改测试代码
Browse files Browse the repository at this point in the history
  • Loading branch information
iuaku committed Dec 21, 2021
1 parent 1c09627 commit d43ec18
Showing 1 changed file with 27 additions and 46 deletions.
73 changes: 27 additions & 46 deletions src/test/java/test/com/qiniu/caster/CasterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand All @@ -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;
}

}

0 comments on commit d43ec18

Please sign in to comment.