File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
tests/src/test/java/io/jooby Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,36 @@ public void routerInstance() {
6060 });
6161 });
6262 }
63+
64+ @ Test
65+ public void routerImporting () {
66+ new JoobyRunner (app -> {
67+ Jooby sub = new Jooby ();
68+ sub .mvc (new InstanceRouter ());
69+ app .use ("/sub" , sub );
70+ }).ready (client -> {
71+ client .get ("/sub" , rsp -> {
72+ assertEquals ("Got it!" , rsp .body ().string ());
73+ });
74+ client .post ("/sub" , rsp -> {
75+ assertEquals ("Got it!" , rsp .body ().string ());
76+ });
77+
78+ client .get ("/sub/subpath" , rsp -> {
79+ assertEquals ("OK" , rsp .body ().string ());
80+ });
81+
82+ client .get ("/sub/void" , rsp -> {
83+ assertEquals ("" , rsp .body ().string ());
84+ assertEquals (204 , rsp .code ());
85+ });
86+
87+ client .get ("/sub/voidwriter" , rsp -> {
88+ assertEquals ("writer" , rsp .body ().string ().trim ());
89+ assertEquals (200 , rsp .code ());
90+ });
91+ });
92+ }
6393
6494 @ Test
6595 public void producesAndConsumes () {
You can’t perform that action at this time.
0 commit comments