File tree Expand file tree Collapse file tree 5 files changed +59
-4
lines changed
java/org/springframework/boot/cli Expand file tree Collapse file tree 5 files changed +59
-4
lines changed Original file line number Diff line number Diff line change @@ -2,14 +2,11 @@ package org.test
2
2
3
3
@Grab (" spring-boot-starter-actuator" )
4
4
5
- @Controller
5
+ @RestController
6
6
class SampleController {
7
7
8
8
@RequestMapping (" /" )
9
- @ResponseBody
10
9
public def hello () {
11
10
[message : " Hello World!" ]
12
11
}
13
12
}
14
-
15
-
Original file line number Diff line number Diff line change
1
+ package org.test
2
+
3
+ @Grab (" spring-boot-starter-security" )
4
+ @Grab (" spring-boot-starter-actuator" )
5
+
6
+ @RestController
7
+ class SampleController {
8
+
9
+ @RequestMapping (" /" )
10
+ public def hello () {
11
+ [message : " Hello World!" ]
12
+ }
13
+ }
Original file line number Diff line number Diff line change @@ -39,4 +39,20 @@ public void grabAntBuilder() throws Exception {
39
39
containsString ("{\" message\" :\" Hello World\" }" ));
40
40
}
41
41
42
+ // Security depends on old versions of Spring so if the dependencies aren't pinned
43
+ // this will fail
44
+ @ Test
45
+ public void securityDependencies () throws Exception {
46
+ this .cli .run ("secure.groovy" );
47
+ assertThat (this .cli .getHttpOutput (),
48
+ containsString ("{\" message\" :\" Hello World\" }" ));
49
+ }
50
+
51
+ @ Test
52
+ public void shellDependencies () throws Exception {
53
+ this .cli .run ("crsh.groovy" );
54
+ assertThat (this .cli .getHttpOutput (),
55
+ containsString ("{\" message\" :\" Hello World\" }" ));
56
+ }
57
+
42
58
}
Original file line number Diff line number Diff line change
1
+ package org.test
2
+
3
+ @Grab (" spring-boot-starter-shell-remote" )
4
+
5
+ @RestController
6
+ class SampleController {
7
+
8
+ @RequestMapping (" /" )
9
+ public def hello () {
10
+ [message : " Hello World!" ]
11
+ }
12
+ }
13
+
14
+
Original file line number Diff line number Diff line change
1
+ package org.test
2
+
3
+ // No security features added just a test that the dependencies are resolved
4
+ @Grab (" spring-boot-starter-security" )
5
+
6
+ @RestController
7
+ class SampleController {
8
+
9
+ @RequestMapping (" /" )
10
+ public def hello () {
11
+ [message : " Hello World!" ]
12
+ }
13
+ }
14
+
15
+
You can’t perform that action at this time.
0 commit comments