Skip to content

Commit e563dbc

Browse files
committed
Setup java 8 as minimum version
1 parent 60662e2 commit e563dbc

3 files changed

Lines changed: 27 additions & 23 deletions

File tree

.github/workflows/pipeline.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,21 @@ on:
1111

1212
jobs:
1313
# old-school build and jar method. No tests run or compiled.
14-
build-1_6:
14+
build-11:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
# build for java 1.6, however don't run any tests
19-
java: [ 1.6 ]
18+
# build for java 11, however don't run any tests
19+
java: [ 11, 17, 19, 20 ]
2020
name: Java ${{ matrix.java }}
2121
steps:
22-
- uses: actions/checkout@v2
23-
- name: Setup java
24-
uses: actions/setup-java@v1
22+
- uses: actions/checkout@v3
23+
- name: Set up JDK ${{ matrix.java }}
24+
uses: actions/setup-java@v3
2525
with:
26+
distribution: 'temurin'
2627
java-version: ${{ matrix.java }}
28+
cache: 'maven'
2729
- name: Compile Java ${{ matrix.java }}
2830
run: |
2931
mkdir -p target/classes
@@ -42,14 +44,16 @@ jobs:
4244
strategy:
4345
matrix:
4446
# build against supported Java LTS versions:
45-
java: [ 8, 11 ]
47+
java: [ 11, 17 ]
4648
name: Java ${{ matrix.java }}
4749
steps:
48-
- uses: actions/checkout@v2
49-
- name: Setup java
50-
uses: actions/setup-java@v1
50+
- uses: actions/checkout@v3
51+
- name: Set up JDK ${{ matrix.java }}
52+
uses: actions/setup-java@v3
5153
with:
54+
distribution: 'temurin'
5255
java-version: ${{ matrix.java }}
56+
cache: 'maven'
5357
- name: Compile Java ${{ matrix.java }}
5458
run: mvn clean compile -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }} -Dmaven.test.skip=true -Dmaven.site.skip=true -Dmaven.javadoc.skip=true
5559
- name: Run Tests ${{ matrix.java }}

pom.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<dependency>
7070
<groupId>org.mockito</groupId>
7171
<artifactId>mockito-core</artifactId>
72-
<version>1.9.5</version>
72+
<version>4.2.0</version>
7373
<scope>test</scope>
7474
</dependency>
7575
</dependencies>
@@ -79,7 +79,7 @@
7979
<plugin>
8080
<groupId>org.apache.felix</groupId>
8181
<artifactId>maven-bundle-plugin</artifactId>
82-
<version>3.0.1</version>
82+
<version>5.1.9</version>
8383
<extensions>true</extensions>
8484
<configuration>
8585
<instructions>
@@ -93,16 +93,16 @@
9393
<plugin>
9494
<groupId>org.apache.maven.plugins</groupId>
9595
<artifactId>maven-compiler-plugin</artifactId>
96-
<version>2.3.2</version>
96+
<version>3.11.0</version>
9797
<configuration>
98-
<source>1.6</source>
99-
<target>1.6</target>
98+
<source>1.8</source>
99+
<target>1.8</target>
100100
</configuration>
101101
</plugin>
102102
<plugin>
103103
<groupId>org.apache.maven.plugins</groupId>
104104
<artifactId>maven-source-plugin</artifactId>
105-
<version>2.1.2</version>
105+
<version>3.3.0</version>
106106
<executions>
107107
<execution>
108108
<id>attach-sources</id>
@@ -115,7 +115,7 @@
115115
<plugin>
116116
<groupId>org.apache.maven.plugins</groupId>
117117
<artifactId>maven-javadoc-plugin</artifactId>
118-
<version>2.7</version>
118+
<version>3.5.0</version>
119119
<executions>
120120
<execution>
121121
<id>attach-javadocs</id>
@@ -131,7 +131,7 @@
131131
<plugin>
132132
<groupId>org.apache.maven.plugins</groupId>
133133
<artifactId>maven-gpg-plugin</artifactId>
134-
<version>1.5</version>
134+
<version>1.6</version>
135135
<executions>
136136
<execution>
137137
<id>sign-artifacts</id>
@@ -162,7 +162,7 @@
162162
<plugin>
163163
<groupId>org.apache.maven.plugins</groupId>
164164
<artifactId>maven-jar-plugin</artifactId>
165-
<version>3.2.0</version>
165+
<version>3.3.0</version>
166166
<configuration>
167167
<archive>
168168
<manifestEntries>
@@ -173,4 +173,4 @@
173173
</plugin>
174174
</plugins>
175175
</build>
176-
</project>
176+
</project>

src/test/java/org/json/junit/JSONObjectTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,9 @@ public void jsonObjectByBean1() {
626626
assertTrue("expected 42", Integer.valueOf("42").equals(jsonObject.query("/intKey")));
627627
assertTrue("expected -23.45e7", Double.valueOf("-23.45e7").equals(jsonObject.query("/doubleKey")));
628628
// sorry, mockito artifact
629-
assertTrue("expected 2 callbacks items", ((List<?>)(JsonPath.read(doc, "$.callbacks"))).size() == 2);
630-
assertTrue("expected 0 handler items", ((Map<?,?>)(JsonPath.read(doc, "$.callbacks[0].handler"))).size() == 0);
631-
assertTrue("expected 0 callbacks[1] items", ((Map<?,?>)(JsonPath.read(doc, "$.callbacks[1]"))).size() == 0);
629+
assertTrue("expected 2 mockitoInterceptor items", ((Map<?,?>)(JsonPath.read(doc, "$.mockitoInterceptor"))).size() == 2);
630+
assertTrue("expected 0 mockitoInterceptor.serializationSupport items",
631+
((Map<?,?>)(JsonPath.read(doc, "$.mockitoInterceptor.serializationSupport"))).size() == 0);
632632
Util.checkJSONObjectMaps(jsonObject);
633633
}
634634

0 commit comments

Comments
 (0)