Skip to content

Commit 6ae7ec9

Browse files
committed
init commit
1 parent f7fc933 commit 6ae7ec9

File tree

4 files changed

+41
-6
lines changed

4 files changed

+41
-6
lines changed

Jenkinsfile

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
}

pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<dependency>
4343
<groupId>org.projectlombok</groupId>
4444
<artifactId>lombok</artifactId>
45+
<version>1.18.26</version>
4546
<optional>true</optional>
4647
</dependency>
4748

src/main/java/com/techprimers/graphql/springbootgrapqlexample/resource/BookResource.java

+7-5
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
import org.springframework.beans.factory.annotation.Autowired;
66
import org.springframework.http.HttpStatus;
77
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.*;
129

13-
@RequestMapping("/rest/books")
10+
@RequestMapping(value = "/rest/books")
1411
@RestController
1512
public class BookResource {
1613

@@ -23,4 +20,9 @@ public ResponseEntity<Object> getAllBooks(@RequestBody String query) {
2320

2421
return new ResponseEntity<>(execute, HttpStatus.OK);
2522
}
23+
@GetMapping
24+
public ResponseEntity<Object> getAllBooks() {
25+
26+
return ResponseEntity.ok("Надо использовать метод POST");
27+
}
2628
}

src/test/java/com/techprimers/graphql/springbootgrapqlexample/SpringBootGrapqlExampleApplicationTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import org.springframework.boot.test.context.SpringBootTest;
66
import org.springframework.test.context.junit4.SpringRunner;
77

8-
@RunWith(SpringRunner.class)
8+
//@RunWith(SpringRunner.class)
99
@SpringBootTest
1010
public class SpringBootGrapqlExampleApplicationTests {
1111

0 commit comments

Comments
 (0)