Skip to content

Commit c698f3b

Browse files
committed
test: 添加工具类 SimpleRes 测试类
1 parent eebbe43 commit c698f3b

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package info.cadecode.simple.common.response;
2+
3+
import info.cadecode.simple.SimpleSpringBootApplicationTests;
4+
import info.cadecode.simple.constant.Reason;
5+
import org.junit.jupiter.api.Test;
6+
7+
/**
8+
* @author Cade Li
9+
* @date 2021/7/16
10+
* @description:
11+
*/
12+
public class SimpleResTest extends SimpleSpringBootApplicationTests {
13+
14+
@Test
15+
public void ok() {
16+
String okJson = SimpleRes.ok("hello world!")
17+
.json();
18+
log.info("okJson: {}", okJson);
19+
}
20+
21+
@Test
22+
public void error() {
23+
String errorJson = SimpleRes.error("hello world!")
24+
.json();
25+
log.info("errorJson: {}", errorJson);
26+
}
27+
28+
@Test
29+
public void reason() {
30+
String reasonJson = SimpleRes.reason(Reason.BAD_REQ)
31+
.json();
32+
log.info("reasonJson: {}", reasonJson);
33+
}
34+
}

0 commit comments

Comments
 (0)