File tree Expand file tree Collapse file tree
src/test/java/info/cadecode/simple/common/response Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments