File tree 8 files changed +21
-9
lines changed
jooby/src/main/java/io/jooby
main/java/io/jooby/internal/apt
8 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -912,6 +912,11 @@ on them (mostly annotations processors).
912
912
|string
913
913
|[]
914
914
|Add custom handler mapping.
915
+
916
+ |jooby.mvcMethod
917
+ |boolean
918
+ |false
919
+ |Set the Route.mvcMethod when true.
915
920
|===
916
921
917
922
==== Setting options
Original file line number Diff line number Diff line change @@ -1041,7 +1041,8 @@ public boolean isTransactional(boolean defaultValue) {
1041
1041
}
1042
1042
1043
1043
/**
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.
1045
1046
*
1046
1047
* @return Method for MVC/Controller. Not available for lambda routes.
1047
1048
*/
Original file line number Diff line number Diff line change @@ -44,8 +44,8 @@ public MvcContext(
44
44
this .output = output ;
45
45
this .debug = Options .boolOpt (processingEnvironment , Options .DEBUG , false );
46
46
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 );
49
49
this .services = Options .boolOpt (processingEnvironment , Options .SERVICES , true );
50
50
this .routerPrefix = Options .string (processingEnvironment , Options .ROUTER_PREFIX , "" );
51
51
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 {
81
81
82
82
@ Test
83
83
public void routes () throws Exception {
84
- new ProcessorRunner (new Routes ())
84
+ new ProcessorRunner (new Routes (), Map . of ( "jooby.returnType" , true ) )
85
85
.withRouter (
86
86
app -> {
87
87
MockRouter router = new MockRouter (app );
@@ -263,7 +263,7 @@ public void noTopLevel() throws Exception {
263
263
264
264
@ Test
265
265
public void setPrimitiveReturnType () throws Exception {
266
- new ProcessorRunner (new PrimitiveReturnType ())
266
+ new ProcessorRunner (new PrimitiveReturnType (), Map . of ( "jooby.returnType" , true ) )
267
267
.withRouter (
268
268
app -> {
269
269
Route route = app .getRoutes ().get (0 );
Original file line number Diff line number Diff line change 7
7
8
8
import static org .junit .jupiter .api .Assertions .assertEquals ;
9
9
10
+ import java .util .Map ;
11
+
10
12
import org .junit .jupiter .api .Test ;
11
13
12
14
import io .jooby .apt .ProcessorRunner ;
@@ -17,7 +19,7 @@ public class Issue1814 {
17
19
18
20
@ Test
19
21
public void shouldIgnoreWildcardResponseType () throws Exception {
20
- new ProcessorRunner (new C1814 ())
22
+ new ProcessorRunner (new C1814 (), Map . of ( "jooby.returnType" , true ) )
21
23
.withRouter (
22
24
app -> {
23
25
MockRouter router = new MockRouter (app );
Original file line number Diff line number Diff line change 9
9
import static org .junit .jupiter .api .Assertions .assertNotNull ;
10
10
11
11
import java .util .List ;
12
+ import java .util .Map ;
12
13
13
14
import org .junit .jupiter .api .Test ;
14
15
@@ -20,7 +21,7 @@ public class Issue2629 {
20
21
21
22
@ Test
22
23
public void shouldSetMvcMethod () throws Exception {
23
- new ProcessorRunner (new C2629 ())
24
+ new ProcessorRunner (new C2629 (), Map . of ( "jooby.mvcMethod" , true ) )
24
25
.withRouter (
25
26
app -> {
26
27
MockRouter router = new MockRouter (app );
Original file line number Diff line number Diff line change 8
8
import static org .junit .jupiter .api .Assertions .assertEquals ;
9
9
import static org .junit .jupiter .api .Assertions .assertNotNull ;
10
10
11
+ import java .util .Map ;
12
+
11
13
import org .junit .jupiter .api .Test ;
12
14
13
15
import io .jooby .apt .ProcessorRunner ;
@@ -18,7 +20,7 @@ public class Issue2629b {
18
20
19
21
@ Test
20
22
public void shouldSetMvcMethod () throws Exception {
21
- new ProcessorRunner (new C2629b ())
23
+ new ProcessorRunner (new C2629b (), Map . of ( "jooby.mvcMethod" , true ) )
22
24
.withRouter (
23
25
app -> {
24
26
MockRouter router = new MockRouter (app );
Original file line number Diff line number Diff line change 8
8
import static org .junit .jupiter .api .Assertions .assertTrue ;
9
9
10
10
import java .io .IOException ;
11
+ import java .util .Map ;
11
12
12
13
import org .junit .jupiter .api .Test ;
13
14
@@ -17,7 +18,7 @@ public class Issue3490 {
17
18
18
19
@ Test
19
20
public void shouldNotGeneratePrimitiveOnKotlinGenerics () throws IOException {
20
- new ProcessorRunner (new C3490 ())
21
+ new ProcessorRunner (new C3490 (), Map . of ( "jooby.returnType" , true ) )
21
22
.withSourceCode (
22
23
true ,
23
24
source -> {
You can’t perform that action at this time.
0 commit comments