Skip to content

Commit 6a63739

Browse files
committed
优化单测
1 parent 6e69d75 commit 6a63739

File tree

2 files changed

+6
-36
lines changed

2 files changed

+6
-36
lines changed

__test/src/test/java/features/BigBodyTest.java

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package features;
1717

18+
import org.junit.jupiter.api.Assertions;
1819
import org.junit.jupiter.api.Test;
1920
import org.noear.snack.ONode;
2021
import org.noear.solon.net.http.HttpResponse;
@@ -73,15 +74,7 @@ public void test_body2() throws Exception {
7374
System.out.println("code: " + resp.code());
7475
System.out.println("body: " + resp.bodyAsString());
7576

76-
assert resp.code() == 413;
77-
78-
// String resp_body = resp.bodyAsString();
79-
// if (resp_body.contains("IOException")) {
80-
// assert true;
81-
// return;
82-
// }
83-
//
84-
// assert false;
77+
Assertions.assertEquals(413, resp.code());
8578
}
8679

8780
@Test
@@ -129,14 +122,6 @@ public void test_form2() throws Exception {
129122
System.out.println("code: " + resp.code());
130123
System.out.println("body: " + resp.bodyAsString());
131124

132-
assert resp.code() == 413;
133-
134-
// String resp_body = resp.bodyAsString();
135-
// if (resp_body.contains("IOException") || resp_body.contains("HTTP ERROR 400 Unable to parse form content")) {
136-
// assert true;
137-
// return;
138-
// }
139-
//
140-
// assert false;
125+
Assertions.assertEquals(413, resp.code());
141126
}
142127
}

__test/src/test/java/features/BigBodyTest_u5.java

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package features;
1717

18+
import org.junit.jupiter.api.Assertions;
1819
import org.junit.jupiter.api.Test;
1920
import org.noear.snack.ONode;
2021
import org.noear.solon.net.http.HttpResponse;
@@ -73,15 +74,7 @@ public void test_body2() throws Exception {
7374
System.out.println("code: " + resp.code());
7475
System.out.println("body: " + resp.bodyAsString());
7576

76-
assert resp.code() == 413;
77-
78-
// String resp_body = resp.bodyAsString();
79-
// if (resp_body.contains("IOException")) {
80-
// assert true;
81-
// return;
82-
// }
83-
//
84-
// assert false;
77+
Assertions.assertEquals(413, resp.code());
8578
}
8679

8780
@Test
@@ -130,14 +123,6 @@ public void test_form2() throws Exception {
130123
System.out.println("code: " + resp.code());
131124
System.out.println("body: " + resp.bodyAsString());
132125

133-
assert resp.code() == 413;
134-
135-
// String resp_body = resp.bodyAsString();
136-
// if (resp_body.contains("IOException") || resp_body.contains("HTTP ERROR 400 Unable to parse form content")) {
137-
// assert true;
138-
// return;
139-
// }
140-
//
141-
// assert false;
126+
Assertions.assertEquals(413, resp.code());
142127
}
143128
}

0 commit comments

Comments
 (0)