File tree 4 files changed +41
-6
lines changed
main/java/com/techprimers/graphql/springbootgrapqlexample/resource
test/java/com/techprimers/graphql/springbootgrapqlexample
4 files changed +41
-6
lines changed Original file line number Diff line number Diff line change
1
+ pipeline {
2
+ agent any
3
+
4
+ stages {
5
+ stage (' Compile Stage' ) {
6
+
7
+ steps {
8
+ withMaven(maven : ' maven_3_5_0' ) {
9
+ sh ' mvn clean compile'
10
+ }
11
+ }
12
+ }
13
+
14
+ stage (' Testing Stage' ) {
15
+
16
+ steps {
17
+ withMaven(maven : ' maven_3_5_0' ) {
18
+ sh ' mvn test'
19
+ }
20
+ }
21
+ }
22
+
23
+
24
+ stage (' Deployment Stage' ) {
25
+ steps {
26
+ withMaven(maven : ' maven_3_5_0' ) {
27
+ sh ' mvn deploy'
28
+ }
29
+ }
30
+ }
31
+ }
32
+ }
Original file line number Diff line number Diff line change 42
42
<dependency >
43
43
<groupId >org.projectlombok</groupId >
44
44
<artifactId >lombok</artifactId >
45
+ <version >1.18.26</version >
45
46
<optional >true</optional >
46
47
</dependency >
47
48
Original file line number Diff line number Diff line change 5
5
import org .springframework .beans .factory .annotation .Autowired ;
6
6
import org .springframework .http .HttpStatus ;
7
7
import org .springframework .http .ResponseEntity ;
8
- import org .springframework .web .bind .annotation .PostMapping ;
9
- import org .springframework .web .bind .annotation .RequestBody ;
10
- import org .springframework .web .bind .annotation .RequestMapping ;
11
- import org .springframework .web .bind .annotation .RestController ;
8
+ import org .springframework .web .bind .annotation .*;
12
9
13
- @ RequestMapping ("/rest/books" )
10
+ @ RequestMapping (value = "/rest/books" )
14
11
@ RestController
15
12
public class BookResource {
16
13
@@ -23,4 +20,9 @@ public ResponseEntity<Object> getAllBooks(@RequestBody String query) {
23
20
24
21
return new ResponseEntity <>(execute , HttpStatus .OK );
25
22
}
23
+ @ GetMapping
24
+ public ResponseEntity <Object > getAllBooks () {
25
+
26
+ return ResponseEntity .ok ("Надо использовать метод POST" );
27
+ }
26
28
}
Original file line number Diff line number Diff line change 5
5
import org .springframework .boot .test .context .SpringBootTest ;
6
6
import org .springframework .test .context .junit4 .SpringRunner ;
7
7
8
- @ RunWith (SpringRunner .class )
8
+ // @RunWith(SpringRunner.class)
9
9
@ SpringBootTest
10
10
public class SpringBootGrapqlExampleApplicationTests {
11
11
You can’t perform that action at this time.
0 commit comments