Skip to content

Commit e007ca3

Browse files
author
YangSen-qn
committed
fix test case
1 parent ffeed74 commit e007ca3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

library/src/androidTest/java/com/qiniu/android/http/HttpTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void setUp() throws Exception {
5151
@Test
5252
public void testPost1() throws Throwable {
5353

54-
httpManager.asyncPost("https://up.qiniup.com",
54+
httpManager.asyncPost("https://up-na0.qiniup.com",
5555
"hello".getBytes(), null, UpToken.parse(TestConfig.commonToken), "hello".getBytes().length,
5656
null, new CompletionHandler() {
5757
@Override
@@ -73,7 +73,8 @@ public boolean shouldWait() {
7373
}
7474
}, 60);
7575

76-
Assert.assertTrue(info.reqId == "");
76+
assertEquals(info.error, 400, info.statusCode);
77+
assertTrue("reqid is empty", info.reqId.length() > 0);
7778
}
7879

7980
@Test

library/src/androidTest/java/com/qiniu/android/http/HttpsTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void setUp() throws Exception {
4444
public void testPost1() throws Throwable {
4545

4646
info = null;
47-
httpManager.asyncPost("https://www.baidu.com/", "hello".getBytes(), null,
47+
httpManager.asyncPost("https://up-na0.qiniup.com", "hello".getBytes(), null,
4848
UpToken.parse(TestConfig.commonToken), "hello".getBytes().length, null, new CompletionHandler() {
4949
@Override
5050
public void complete(ResponseInfo rinfo, JSONObject response) {
@@ -65,7 +65,8 @@ public boolean shouldWait() {
6565
}, 5);
6666

6767

68-
assertEquals(info.error, 200, info.statusCode);
68+
assertEquals(info.error, 400, info.statusCode);
69+
assertTrue("reqid is empty", info.reqId.length() > 0);
6970
}
7071

7172
// @SmallTest

0 commit comments

Comments
 (0)