File tree 7 files changed +80
-9
lines changed
src/main/java/au/com/dius/pactworkshop/consumer
7 files changed +80
-9
lines changed Original file line number Diff line number Diff line change
1
+ name : CI
2
+ on :
3
+ push :
4
+ branches :
5
+ - step1
6
+ pull_request :
7
+ branches :
8
+ - step1
9
+ jobs :
10
+ test :
11
+ runs-on : ubuntu-latest
12
+
13
+ steps :
14
+ - name : Checkout code
15
+ uses : actions/checkout@v4
16
+
17
+ - name : Set up JDK 17
18
+ uses : actions/setup-java@v4
19
+ with :
20
+ java-version : 17
21
+ distribution : ' temurin'
22
+
23
+ - name : Test consumer tests
24
+ run : ./gradlew consumer:bootRun || true
Original file line number Diff line number Diff line change 29
29
/nbdist /
30
30
/.nb-gradle /
31
31
32
+ # ## VS Code ###
33
+ .vscode /
34
+ .gradle
35
+ build /
36
+ ! .. /gradle /wrapper /gradle-wrapper.jar
37
+ ! ** /src /main /** /build /
38
+ ! ** /src /test /** /build /
39
+ consumer /bin
40
+ provider /bin
41
+
42
+ # ## STS ###
43
+ .apt_generated
44
+ .classpath
45
+ .factorypath
46
+ .project
47
+ .settings
48
+ .springBeans
49
+ .sts4-cache
50
+
51
+ # ## IntelliJ IDEA ###
52
+ .idea /
53
+ * .iws
54
+ * .iml
55
+ * .ipr
56
+ out /
57
+ ! ** /src /main /** /out /
58
+ ! ** /src /test /** /out /
59
+
60
+ # ## NetBeans ###
61
+ /nbproject /private /
62
+ /nbbuild /
63
+ /dist /
64
+ /nbdist /
65
+ /.nb-gradle /
66
+
32
67
# ## VS Code ###
33
68
.vscode /
34
69
.gradle
@@ -45,3 +80,7 @@ gradle-app.setting
45
80
46
81
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
47
82
# gradle/wrapper/gradle-wrapper.properties
83
+
84
+ # # MacOS
85
+
86
+ .DS_Store
Original file line number Diff line number Diff line change
1
+ 17.0
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ step of the workshop just check out the branch for that step (i.e. `git checkout
7
7
8
8
## Requirements
9
9
10
- * JDK 8 +
10
+ * JDK 17 +
11
11
* Docker for step 11
12
12
13
13
## Workshop outline:
Original file line number Diff line number Diff line change 1
1
plugins {
2
- id ' org.springframework.boot' version ' 2.3.4.RELEASE'
3
- id ' io.spring.dependency-management' version ' 1.0.10.RELEASE'
2
+ // Stopped from moving to 3.2.x due to wiremock issue
3
+ // https://github.com/wiremock/wiremock/issues/2395
4
+ id ' org.springframework.boot' version ' 3.1.8'
5
+ id ' io.spring.dependency-management' version ' 1.1.4'
4
6
}
5
7
6
8
group = ' au.com.dius.pactworkshop'
7
9
version = ' 0.0.1-SNAPSHOT'
8
- sourceCompatibility = ' 8 '
10
+ sourceCompatibility = ' 17 '
9
11
10
12
dependencies {
11
13
implementation ' org.springframework.boot:spring-boot-starter'
@@ -14,7 +16,7 @@ dependencies {
14
16
testImplementation(' org.springframework.boot:spring-boot-starter-test' ) {
15
17
exclude group : ' org.junit.vintage' , module : ' junit-vintage-engine'
16
18
}
17
- testImplementation ' com.github.tomakehurst:wiremock:2.27.2 '
19
+ testImplementation ' com.github.tomakehurst:wiremock:3.0.1 '
18
20
}
19
21
20
22
test {
Original file line number Diff line number Diff line change @@ -49,10 +49,15 @@ private Integer getUserChoice(Scanner scanner) {
49
49
50
50
private void printProduct (int index ) {
51
51
String id = products .get (index - 1 ).getId ();
52
- Product product = productService .getProduct (id );
52
+ try {
53
+ Product product = productService .getProduct (id );
53
54
54
- System .out .println ("Product Details\n ---------------" );
55
- System .out .println (product );
55
+ System .out .println ("Product Details\n ---------------" );
56
+ System .out .println (product );
57
+ } catch (Exception e ) {
58
+ System .out .println ("Failed to load product " + id );
59
+ System .out .println (e .getMessage ());
60
+ }
56
61
}
57
62
58
63
private Integer parseChoice (String choice ) {
Original file line number Diff line number Diff line change 1
1
distributionBase =GRADLE_USER_HOME
2
2
distributionPath =wrapper/dists
3
- distributionUrl =https\://services.gradle.org/distributions/gradle-6 .6.1 -bin.zip
3
+ distributionUrl =https\://services.gradle.org/distributions/gradle-7 .6.3 -bin.zip
4
4
zipStoreBase =GRADLE_USER_HOME
5
5
zipStorePath =wrapper/dists
You can’t perform that action at this time.
0 commit comments