Skip to content

Commit 071cc18

Browse files
authored
Merge branch 'main' into PRM-668-2
2 parents 8208d7c + e3f6d8f commit 071cc18

34 files changed

+187
-630
lines changed

.github/workflows/full-deployment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ jobs:
101101
service: pds-adaptor
102102
environment: ${{ inputs.environment }}
103103
is_deployment: ${{ inputs.is_deployment }}
104+
# TODO PRM-713 REMOVE THIS LINE SO IT TAKES THE DEFAULT
104105
java_version: "11"
105106
ecr_alias: deductions/pds-adaptor
106107
secrets: inherit

.github/workflows/service-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ jobs:
109109
environment: dev
110110
is_deployment: ${{ github.ref == 'refs/heads/main' }}
111111
requires_localstack: true
112+
# PRM-711: Remove the hardcoded java_versions once all services are compatible with Java 25
113+
java_version: "25"
112114
ecr_alias: deductions/nems-event-processor
113115
secrets: inherit
114116

services/ehr-transfer-service/docker-compose.localstack-local.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,14 @@ services:
2525

2626
localstack:
2727
container_name: "localstack-ehr-transfer-service"
28-
image: localstack/localstack
28+
image: localstack/localstack:4.14.0
2929
ports:
3030
- "4566:4566"
3131
network_mode: bridge
3232
environment:
3333
- DOCKER_HOST=unix:///var/run/docker.sock
3434
- SERVICES=sqs,sns,dynamodb,s3
3535
- GATEWAY_LISTEN=4566
36-
- LOCALSTACK_ACKNOWLEDGE_ACCOUNT_REQUIREMENT=1
3736
volumes:
3837
- "/var/run/docker.sock:/var/run/docker.sock"
3938
- "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"

services/nems-event-processor/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM eclipse-temurin:21-jre-alpine-3.23
1+
FROM eclipse-temurin:25-jre-alpine-3.23
22

33
RUN apk update && \
44
apk -u list && \
Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
11
# prm-deductions-nems-event-processor
22

3-
This component is a Java service that receives NEMS events when there is a change of GP for a patient in PDS (Personal Demographics Service). It processes each event to filter for relevant use cases and extracts important information from each, and forwards this information to another queue for further use.
3+
This component is a Java service that receives NEMS events when there is a change of GP for a patient in PDS (Personal Demographics Service). It processes each event to filter for relevant use cases and extracts important information from each, and forwards this information to another queue for further use.
4+
5+
## Prerequisites
6+
7+
- Java 25 LTS
8+
- Gradle 9.3
9+
10+
### Running the tests
11+
12+
#### All tests
13+
To run all Unit and Integration tests and produce a coverage report, in your terminal, run `./tasks test_all`
14+
15+
#### Unit testing
16+
These are easiest to run from your IDE, however, you can also run them from your terminal with: `./tasks test_unit`
17+
18+
#### Integration testing
19+
The integration tests can be run from your terminal with: `./tasks test_integration` which will start and stop LocalStack for you.
20+
21+
If you want to run these from your IDE, you must first start LocalStack with: `./tasks start_localstack`
22+
It is recommended that you stop LocalStack after running the tests with: `./tasks stop_localstack`
Lines changed: 46 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
plugins {
2-
id 'org.springframework.boot' version '3.2.1'
3-
id 'io.spring.dependency-management' version '1.1.4'
2+
id 'org.springframework.boot' version '4.0.3'
3+
id 'io.spring.dependency-management' version '1.1.7'
44
id 'java'
55
id 'jacoco'
6-
id 'com.github.spotbugs' version '6.0.6'
7-
id 'org.sonarqube' version '4.4.1.3373'
6+
id 'org.sonarqube' version '7.2.2.6593'
87
}
98

109
sonar {
@@ -17,74 +16,73 @@ sonar {
1716

1817
group = 'uk.nhs.prm.deductions'
1918
version = '0.0.1-SNAPSHOT'
20-
sourceCompatibility = '21'
2119

22-
configurations {
23-
compileOnly {
24-
extendsFrom annotationProcessor
20+
repositories {
21+
mavenCentral()
22+
}
23+
24+
java {
25+
toolchain {
26+
languageVersion = JavaLanguageVersion.of(25)
2527
}
2628
}
2729

28-
repositories {
29-
mavenCentral()
30+
sourceSets {
31+
integration {
32+
compileClasspath += sourceSets.main.output
33+
runtimeClasspath += sourceSets.main.output
34+
}
3035
}
3136

32-
//Without this task two jars are built, the additional "-plain.jar" is not needed
33-
// for more details refer to: https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/htmlsingle/#packaging-executable.and-plain-archives
34-
jar {
35-
enabled = false
37+
configurations {
38+
compileOnly {
39+
extendsFrom annotationProcessor
40+
}
41+
42+
integrationImplementation.extendsFrom testImplementation
43+
integrationRuntime.extendsFrom testRuntime
3644
}
3745

3846
dependencies {
3947
implementation 'org.springframework.boot:spring-boot-starter'
4048

41-
implementation 'net.logstash.logback:logstash-logback-encoder:6.6'
42-
implementation 'org.jetbrains:annotations:20.1.0'
43-
44-
implementation('io.netty:netty-buffer') { version { strictly '4.1.104.Final' } }
45-
implementation('io.netty:netty-codec') { version { strictly '4.1.104.Final' } }
46-
implementation('io.netty:netty-codec-http') { version { strictly '4.1.104.Final' } }
47-
implementation('io.netty:netty-codec-http2') { version { strictly '4.1.104.Final' } }
48-
implementation('io.netty:netty-common') { version { strictly '4.1.104.Final' } }
49-
implementation('io.netty:netty-handler') { version { strictly '4.1.104.Final' } }
50-
implementation('io.netty:netty-resolver') { version { strictly '4.1.104.Final' } }
51-
implementation('io.netty:netty-transport') { version { strictly '4.1.104.Final' } }
52-
implementation('io.netty:netty-transport-classes-epoll') { version { strictly '4.1.104.Final' } }
53-
implementation('io.netty:netty-transport-native-unix-common') { version { strictly '4.1.104.Final' } }
54-
55-
implementation platform('software.amazon.awssdk:bom:2.18.41')
49+
implementation 'net.logstash.logback:logstash-logback-encoder:9.0'
50+
51+
implementation('io.netty:netty-buffer') { version { strictly '4.2.9.Final' } }
52+
implementation('io.netty:netty-codec') { version { strictly '4.2.9.Final' } }
53+
implementation('io.netty:netty-codec-http') { version { strictly '4.2.9.Final' } }
54+
implementation('io.netty:netty-codec-http2') { version { strictly '4.2.9.Final' } }
55+
implementation('io.netty:netty-common') { version { strictly '4.2.9.Final' } }
56+
implementation('io.netty:netty-handler') { version { strictly '4.2.9.Final' } }
57+
implementation('io.netty:netty-resolver') { version { strictly '4.2.9.Final' } }
58+
implementation('io.netty:netty-transport') { version { strictly '4.2.9.Final' } }
59+
implementation('io.netty:netty-transport-classes-epoll') { version { strictly '4.2.9.Final' } }
60+
implementation('io.netty:netty-transport-native-unix-common') { version { strictly '4.2.9.Final' } }
61+
62+
implementation platform('software.amazon.awssdk:bom:2.41.14')
5663
implementation 'software.amazon.awssdk:cloudwatch'
5764
implementation 'software.amazon.awssdk:sns'
5865
implementation 'software.amazon.awssdk:sqs'
59-
implementation 'com.amazonaws:amazon-sqs-java-messaging-lib:2.0.1'
6066

61-
implementation 'com.jcabi:jcabi-xml:0.23.1'
62-
implementation 'com.google.code.gson:gson:2.10.1'
67+
implementation 'com.amazonaws:amazon-sqs-java-messaging-lib:2.1.4'
6368

64-
implementation 'com.github.spotbugs:spotbugs-annotations:4.8.3'
69+
// TODO PRM-714 a discussion is needed about whether this is removed. It'll require complicated logic changes,
70+
// but is a dependency managed by a small team.
71+
implementation 'com.jcabi:jcabi-xml:0.35.0'
72+
implementation 'com.google.code.gson:gson:2.13.2'
6573

66-
compileOnly 'org.projectlombok:lombok:1.18.30'
74+
compileOnly 'org.projectlombok:lombok:1.18.42'
6775
annotationProcessor 'org.projectlombok:lombok'
6876

6977
testImplementation 'org.springframework.boot:spring-boot-test'
7078
testImplementation 'org.springframework.boot:spring-boot-test-autoconfigure'
7179
testImplementation 'org.springframework.boot:spring-boot-starter-test'
72-
testImplementation 'org.springframework.boot:spring-boot-starter-aop'
80+
testImplementation 'org.springframework.boot:spring-boot-starter-json'
7381

74-
testImplementation "org.mockito:mockito-core:3.+"
75-
testImplementation 'org.awaitility:awaitility:4.2.0'
76-
}
82+
integrationImplementation 'com.fasterxml.jackson.core:jackson-databind'
7783

78-
sourceSets {
79-
integration {
80-
compileClasspath += sourceSets.main.output
81-
runtimeClasspath += sourceSets.main.output
82-
}
83-
}
84-
85-
configurations {
86-
integrationImplementation.extendsFrom testImplementation
87-
integrationRuntime.extendsFrom testRuntime
84+
testImplementation 'org.mockito:mockito-core:5.22.0'
85+
testImplementation 'org.awaitility:awaitility:4.3.0'
8886
}
8987

9088
tasks.withType(Test) {
@@ -119,42 +117,3 @@ jacocoTestCoverageVerification {
119117
}))
120118
}
121119
}
122-
123-
spotbugs {
124-
toolVersion = '4.8.3'
125-
}
126-
127-
spotbugsMain {
128-
ignoreFailures = true
129-
reports {
130-
html {
131-
enabled = true
132-
destination = file("$buildDir/reports/spotbugs/main/spotbugs.html")
133-
stylesheet = 'fancy-hist.xsl'
134-
}
135-
}
136-
}
137-
138-
spotbugsTest {
139-
ignoreFailures = true
140-
reports {
141-
html {
142-
enabled = true
143-
destination = file("$buildDir/reports/spotbugs/test/spotbugs.html")
144-
stylesheet = 'fancy-hist.xsl'
145-
}
146-
}
147-
}
148-
149-
spotbugsIntegration {
150-
ignoreFailures = true
151-
reports {
152-
html {
153-
enabled = true
154-
destination = file("$buildDir/reports/spotbugs/integration/spotbugs.html")
155-
stylesheet = 'fancy-hist.xsl'
156-
}
157-
}
158-
}
159-
160-
check.dependsOn integration

services/nems-event-processor/docker-compose.localstack-local.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
localstack:
33
container_name: "localstack-nems-event-processor"
4-
image: localstack/localstack
4+
image: localstack/localstack:4.14.0
55
network_mode: bridge
66
ports:
77
- "127.0.0.1:4566:4566"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

services/nems-event-processor/src/integration/java/uk/nhs/prm/deductions/nemseventprocessor/metrics/MetricPublisherTest.java

Lines changed: 0 additions & 113 deletions
This file was deleted.

services/nems-event-processor/src/integration/java/uk/nhs/prm/deductions/nemseventprocessor/metrics/ScheduledTestConfig.java

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)