Skip to content

Commit 210197d

Browse files
authored
Merge pull request #24 from spt-development/feature/spring-boot3.1.4-upgrade
Updated dependencies to align with Spring Boot 3.1.4
2 parents bc3cc63 + 64336dc commit 210197d

File tree

9 files changed

+56
-24
lines changed

9 files changed

+56
-24
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ jobs:
1616
distribution: 'temurin'
1717
- run: ./mvnw clean verify -B
1818

19-
- name: Set up JDK 20
20-
uses: actions/setup-java@v3
19+
- name: Set up JDK 21
20+
uses: oracle-actions/setup-java@v1
2121
with:
22-
java-version: '20'
23-
distribution: 'temurin'
22+
website: jdk.java.net
23+
release: 21
2424
- run: ./mvnw clean verify -Pall-quality-gates -B
2525

26-
- name: Set up JDK 20 (MDC disabled)
27-
uses: actions/setup-java@v3
26+
- name: Set up JDK 21 (MDC Disabled)
27+
uses: oracle-actions/setup-java@v1
2828
with:
29-
java-version: '20'
30-
distribution: 'temurin'
29+
website: jdk.java.net
30+
release: 21
3131
- run: ./mvnw clean verify -Dspring.profiles.active=mdc-disabled -Pall-quality-gates -B

.github/workflows/latest-versions.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v3
1111

12-
- name: Set up JDK 20
13-
uses: actions/setup-java@v3
12+
- name: Set up JDK 21
13+
uses: oracle-actions/setup-java@v1
1414
with:
15-
java-version: '20'
16-
distribution: 'temurin'
15+
website: jdk.java.net
16+
release: 21
1717
- run: ./mvnw clean versions:update-properties scm:check-local-modification -U -B

.github/workflows/owasp.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v3
1111

12-
- name: Set up JDK 20
13-
uses: actions/setup-java@v3
12+
- name: Set up JDK 21
13+
uses: oracle-actions/setup-java@v1
1414
with:
15-
java-version: '20'
16-
distribution: 'temurin'
15+
website: jdk.java.net
16+
release: 21
1717
- run: ./mvnw clean dependency-check:check -B

config/findbugs/exclude.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,18 @@
4545
<Method name="&lt;init&gt;"/>
4646
<Bug pattern="EI_EXPOSE_REP2" />
4747
</Match>
48+
49+
<!-- Assignment of library spring bean, no workaround to avoid warning -->
50+
<Match>
51+
<Class name="com.spt.development.demo.repository.AuditRepository" />
52+
<Method name="&lt;init&gt;"/>
53+
<Bug pattern="EI_EXPOSE_REP2" />
54+
</Match>
55+
56+
<!-- Assignment of library spring bean, no workaround to avoid warning -->
57+
<Match>
58+
<Class name="com.spt.development.demo.repository.BookRepository" />
59+
<Method name="&lt;init&gt;"/>
60+
<Bug pattern="EI_EXPOSE_REP2" />
61+
</Match>
4862
</FindBugsFilter>

pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.springframework.boot</groupId>
88
<artifactId>spring-boot-starter-parent</artifactId>
9-
<version>3.1.3</version>
9+
<version>3.1.4</version>
1010
<relativePath /> <!-- lookup parent from repository -->
1111
</parent>
1212

@@ -35,16 +35,16 @@
3535
<commons-collections.version>4.4</commons-collections.version>
3636
<findbugs-jsr305.version>3.0.2</findbugs-jsr305.version>
3737
<guava.version>32.1.2-jre</guava.version>
38-
<spt-development-audit-spring-boot.version>3.1.3</spt-development-audit-spring-boot.version>
39-
<spt-development-cid-jms-spring-boot.version>3.1.3</spt-development-cid-jms-spring-boot.version>
40-
<spt-development-cid-web-spring-boot.version>3.1.3</spt-development-cid-web-spring-boot.version>
41-
<spt-development-logging-spring-boot.version>3.1.3</spt-development-logging-spring-boot.version>
38+
<spt-development-audit-spring-boot.version>3.1.4</spt-development-audit-spring-boot.version>
39+
<spt-development-cid-jms-spring-boot.version>3.1.4</spt-development-cid-jms-spring-boot.version>
40+
<spt-development-cid-web-spring-boot.version>3.1.4</spt-development-cid-web-spring-boot.version>
41+
<spt-development-logging-spring-boot.version>3.1.4</spt-development-logging-spring-boot.version>
4242

4343
<!-- Test dependency versions -->
4444
<awaitility.version>4.2.0</awaitility.version>
4545
<cucumber.version>7.14.0</cucumber.version>
4646
<junit-platform.version>1.10.0</junit-platform.version>
47-
<spt-development-test.version>3.0.9</spt-development-test.version>
47+
<spt-development-test.version>3.0.10</spt-development-test.version>
4848
<testcontainers.version>1.19.0</testcontainers.version>
4949

5050
<!-- Plugin versions -->

src/main/java/com/spt/development/demo/repository/AuditRepository.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.spt.development.demo.repository;
22

33
import com.spt.development.audit.spring.AuditEvent;
4+
import jakarta.annotation.PostConstruct;
45
import lombok.NonNull;
56
import org.apache.commons.collections4.MapUtils;
67
import org.apache.commons.collections4.keyvalue.DefaultMapEntry;
@@ -20,9 +21,16 @@ public class AuditRepository extends JdbcDaoSupport {
2021
private static final String SCHEMA = "audit";
2122
private static final String TABLE = "event";
2223

23-
private SimpleJdbcInsert simpleJdbcInsert;
24+
private final DataSource dataSource;
25+
26+
private SimpleJdbcInsert simpleJdbcInsert = null;
2427

2528
public AuditRepository(final DataSource dataSource) {
29+
this.dataSource = dataSource;
30+
}
31+
32+
@PostConstruct
33+
public void init() {
2634
setDataSource(dataSource);
2735
}
2836

src/main/java/com/spt/development/demo/repository/BookRepository.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.spt.development.demo.repository;
22

33
import com.spt.development.demo.domain.Book;
4+
import jakarta.annotation.PostConstruct;
45
import lombok.NonNull;
56
import org.springframework.dao.EmptyResultDataAccessException;
67
import org.springframework.jdbc.core.JdbcTemplate;
@@ -20,9 +21,16 @@ public class BookRepository extends JdbcDaoSupport {
2021
private static final String SCHEMA = "demo";
2122
private static final String TABLE = "book";
2223

23-
private SimpleJdbcInsert simpleJdbcInsert;
24+
private final DataSource dataSource;
25+
26+
private SimpleJdbcInsert simpleJdbcInsert = null;
2427

2528
public BookRepository(final DataSource dataSource) {
29+
this.dataSource = dataSource;
30+
}
31+
32+
@PostConstruct
33+
public void init() {
2634
setDataSource(dataSource);
2735
}
2836

src/test/java/com/spt/development/demo/repository/AuditRepositoryTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ void create_validAuditEvent_shouldConvertToInsert() {
8888

8989
private AuditRepository createRepository(AuditRepositoryArgs args) {
9090
final AuditRepository repository = new AuditRepository(args.dataSource);
91+
repository.init();
9192

9293
ReflectionTestUtils.setField(repository, "simpleJdbcInsert", args.simpleJdbcInsert);
9394

src/test/java/com/spt/development/demo/repository/BookRepositoryTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ void setJdbcTemplate_nullTemplateWhenSimpleJdbcInsertNotSet_shouldThrowException
2525

2626
private BookRepository createRepository(BookRepositoryArgs args) {
2727
final BookRepository repository = new BookRepository(args.dataSource);
28+
repository.init();
2829

2930
ReflectionTestUtils.setField(repository, "simpleJdbcInsert", args.simpleJdbcInsert);
3031

0 commit comments

Comments
 (0)