File tree 9 files changed +56
-24
lines changed
main/java/com/spt/development/demo/repository
test/java/com/spt/development/demo/repository 9 files changed +56
-24
lines changed Original file line number Diff line number Diff line change @@ -16,16 +16,16 @@ jobs:
16
16
distribution : ' temurin'
17
17
- run : ./mvnw clean verify -B
18
18
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
21
21
with :
22
- java-version : ' 20 '
23
- distribution : ' temurin '
22
+ website : jdk.java.net
23
+ release : 21
24
24
- run : ./mvnw clean verify -Pall-quality-gates -B
25
25
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
28
28
with :
29
- java-version : ' 20 '
30
- distribution : ' temurin '
29
+ website : jdk.java.net
30
+ release : 21
31
31
- run : ./mvnw clean verify -Dspring.profiles.active=mdc-disabled -Pall-quality-gates -B
Original file line number Diff line number Diff line change 9
9
steps :
10
10
- uses : actions/checkout@v3
11
11
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
14
14
with :
15
- java-version : ' 20 '
16
- distribution : ' temurin '
15
+ website : jdk.java.net
16
+ release : 21
17
17
- run : ./mvnw clean versions:update-properties scm:check-local-modification -U -B
Original file line number Diff line number Diff line change 9
9
steps :
10
10
- uses : actions/checkout@v3
11
11
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
14
14
with :
15
- java-version : ' 20 '
16
- distribution : ' temurin '
15
+ website : jdk.java.net
16
+ release : 21
17
17
- run : ./mvnw clean dependency-check:check -B
Original file line number Diff line number Diff line change 45
45
<Method name =" < init> " />
46
46
<Bug pattern =" EI_EXPOSE_REP2" />
47
47
</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 =" < init> " />
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 =" < init> " />
60
+ <Bug pattern =" EI_EXPOSE_REP2" />
61
+ </Match >
48
62
</FindBugsFilter >
Original file line number Diff line number Diff line change 6
6
<parent >
7
7
<groupId >org.springframework.boot</groupId >
8
8
<artifactId >spring-boot-starter-parent</artifactId >
9
- <version >3.1.3 </version >
9
+ <version >3.1.4 </version >
10
10
<relativePath /> <!-- lookup parent from repository -->
11
11
</parent >
12
12
35
35
<commons-collections .version>4.4</commons-collections .version>
36
36
<findbugs-jsr305 .version>3.0.2</findbugs-jsr305 .version>
37
37
<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>
42
42
43
43
<!-- Test dependency versions -->
44
44
<awaitility .version>4.2.0</awaitility .version>
45
45
<cucumber .version>7.14.0</cucumber .version>
46
46
<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>
48
48
<testcontainers .version>1.19.0</testcontainers .version>
49
49
50
50
<!-- Plugin versions -->
Original file line number Diff line number Diff line change 1
1
package com .spt .development .demo .repository ;
2
2
3
3
import com .spt .development .audit .spring .AuditEvent ;
4
+ import jakarta .annotation .PostConstruct ;
4
5
import lombok .NonNull ;
5
6
import org .apache .commons .collections4 .MapUtils ;
6
7
import org .apache .commons .collections4 .keyvalue .DefaultMapEntry ;
@@ -20,9 +21,16 @@ public class AuditRepository extends JdbcDaoSupport {
20
21
private static final String SCHEMA = "audit" ;
21
22
private static final String TABLE = "event" ;
22
23
23
- private SimpleJdbcInsert simpleJdbcInsert ;
24
+ private final DataSource dataSource ;
25
+
26
+ private SimpleJdbcInsert simpleJdbcInsert = null ;
24
27
25
28
public AuditRepository (final DataSource dataSource ) {
29
+ this .dataSource = dataSource ;
30
+ }
31
+
32
+ @ PostConstruct
33
+ public void init () {
26
34
setDataSource (dataSource );
27
35
}
28
36
Original file line number Diff line number Diff line change 1
1
package com .spt .development .demo .repository ;
2
2
3
3
import com .spt .development .demo .domain .Book ;
4
+ import jakarta .annotation .PostConstruct ;
4
5
import lombok .NonNull ;
5
6
import org .springframework .dao .EmptyResultDataAccessException ;
6
7
import org .springframework .jdbc .core .JdbcTemplate ;
@@ -20,9 +21,16 @@ public class BookRepository extends JdbcDaoSupport {
20
21
private static final String SCHEMA = "demo" ;
21
22
private static final String TABLE = "book" ;
22
23
23
- private SimpleJdbcInsert simpleJdbcInsert ;
24
+ private final DataSource dataSource ;
25
+
26
+ private SimpleJdbcInsert simpleJdbcInsert = null ;
24
27
25
28
public BookRepository (final DataSource dataSource ) {
29
+ this .dataSource = dataSource ;
30
+ }
31
+
32
+ @ PostConstruct
33
+ public void init () {
26
34
setDataSource (dataSource );
27
35
}
28
36
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ void create_validAuditEvent_shouldConvertToInsert() {
88
88
89
89
private AuditRepository createRepository (AuditRepositoryArgs args ) {
90
90
final AuditRepository repository = new AuditRepository (args .dataSource );
91
+ repository .init ();
91
92
92
93
ReflectionTestUtils .setField (repository , "simpleJdbcInsert" , args .simpleJdbcInsert );
93
94
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ void setJdbcTemplate_nullTemplateWhenSimpleJdbcInsertNotSet_shouldThrowException
25
25
26
26
private BookRepository createRepository (BookRepositoryArgs args ) {
27
27
final BookRepository repository = new BookRepository (args .dataSource );
28
+ repository .init ();
28
29
29
30
ReflectionTestUtils .setField (repository , "simpleJdbcInsert" , args .simpleJdbcInsert );
30
31
You can’t perform that action at this time.
0 commit comments