File tree Expand file tree Collapse file tree
jooby/src/main/java/io/jooby
main/java/io/jooby/internal/apt Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -912,6 +912,11 @@ on them (mostly annotations processors).
912912|string
913913|[]
914914|Add custom handler mapping.
915+
916+ |jooby.mvcMethod
917+ |boolean
918+ |false
919+ |Set the Route.mvcMethod when true.
915920|===
916921
917922==== Setting options
Original file line number Diff line number Diff line change @@ -1041,7 +1041,8 @@ public boolean isTransactional(boolean defaultValue) {
10411041 }
10421042
10431043 /**
1044- * Method for MVC/Controller. Not available for lambda routes.
1044+ * Method for MVC/Controller available when <code>jooby.mvcMethod</code> processor option is set
1045+ * to <code>true</code>. Not available for lambda routes.
10451046 *
10461047 * @return Method for MVC/Controller. Not available for lambda routes.
10471048 */
Original file line number Diff line number Diff line change @@ -44,8 +44,8 @@ public MvcContext(
4444 this .output = output ;
4545 this .debug = Options .boolOpt (processingEnvironment , Options .DEBUG , false );
4646 this .incremental = Options .boolOpt (processingEnvironment , Options .INCREMENTAL , true );
47- this .returnType = Options .boolOpt (processingEnvironment , Options .RETURN_TYPE , true );
48- this .mvcMethod = Options .boolOpt (processingEnvironment , Options .MVC_METHOD , true );
47+ this .returnType = Options .boolOpt (processingEnvironment , Options .RETURN_TYPE , false );
48+ this .mvcMethod = Options .boolOpt (processingEnvironment , Options .MVC_METHOD , false );
4949 this .services = Options .boolOpt (processingEnvironment , Options .SERVICES , true );
5050 this .routerPrefix = Options .string (processingEnvironment , Options .ROUTER_PREFIX , "" );
5151 this .routerSuffix = Options .string (processingEnvironment , Options .ROUTER_SUFFIX , "_" );
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ public void arrayRoute() throws Exception {
8181
8282 @ Test
8383 public void routes () throws Exception {
84- new ProcessorRunner (new Routes ())
84+ new ProcessorRunner (new Routes (), Map . of ( "jooby.returnType" , true ) )
8585 .withRouter (
8686 app -> {
8787 MockRouter router = new MockRouter (app );
@@ -263,7 +263,7 @@ public void noTopLevel() throws Exception {
263263
264264 @ Test
265265 public void setPrimitiveReturnType () throws Exception {
266- new ProcessorRunner (new PrimitiveReturnType ())
266+ new ProcessorRunner (new PrimitiveReturnType (), Map . of ( "jooby.returnType" , true ) )
267267 .withRouter (
268268 app -> {
269269 Route route = app .getRoutes ().get (0 );
Original file line number Diff line number Diff line change 77
88import static org .junit .jupiter .api .Assertions .assertEquals ;
99
10+ import java .util .Map ;
11+
1012import org .junit .jupiter .api .Test ;
1113
1214import io .jooby .apt .ProcessorRunner ;
@@ -17,7 +19,7 @@ public class Issue1814 {
1719
1820 @ Test
1921 public void shouldIgnoreWildcardResponseType () throws Exception {
20- new ProcessorRunner (new C1814 ())
22+ new ProcessorRunner (new C1814 (), Map . of ( "jooby.returnType" , true ) )
2123 .withRouter (
2224 app -> {
2325 MockRouter router = new MockRouter (app );
Original file line number Diff line number Diff line change 99import static org .junit .jupiter .api .Assertions .assertNotNull ;
1010
1111import java .util .List ;
12+ import java .util .Map ;
1213
1314import org .junit .jupiter .api .Test ;
1415
@@ -20,7 +21,7 @@ public class Issue2629 {
2021
2122 @ Test
2223 public void shouldSetMvcMethod () throws Exception {
23- new ProcessorRunner (new C2629 ())
24+ new ProcessorRunner (new C2629 (), Map . of ( "jooby.mvcMethod" , true ) )
2425 .withRouter (
2526 app -> {
2627 MockRouter router = new MockRouter (app );
Original file line number Diff line number Diff line change 88import static org .junit .jupiter .api .Assertions .assertEquals ;
99import static org .junit .jupiter .api .Assertions .assertNotNull ;
1010
11+ import java .util .Map ;
12+
1113import org .junit .jupiter .api .Test ;
1214
1315import io .jooby .apt .ProcessorRunner ;
@@ -18,7 +20,7 @@ public class Issue2629b {
1820
1921 @ Test
2022 public void shouldSetMvcMethod () throws Exception {
21- new ProcessorRunner (new C2629b ())
23+ new ProcessorRunner (new C2629b (), Map . of ( "jooby.mvcMethod" , true ) )
2224 .withRouter (
2325 app -> {
2426 MockRouter router = new MockRouter (app );
Original file line number Diff line number Diff line change 88import static org .junit .jupiter .api .Assertions .assertTrue ;
99
1010import java .io .IOException ;
11+ import java .util .Map ;
1112
1213import org .junit .jupiter .api .Test ;
1314
@@ -17,7 +18,7 @@ public class Issue3490 {
1718
1819 @ Test
1920 public void shouldNotGeneratePrimitiveOnKotlinGenerics () throws IOException {
20- new ProcessorRunner (new C3490 ())
21+ new ProcessorRunner (new C3490 (), Map . of ( "jooby.returnType" , true ) )
2122 .withSourceCode (
2223 true ,
2324 source -> {
You can’t perform that action at this time.
0 commit comments