Skip to content

Commit 67085be

Browse files
kiran-yenigala-hmctskiran-yenigala-nihrhmcts-jenkins-a-to-c[bot]JamesCollettCGI
authored
Fixed issue with image loading (#20)
* Fixed issue with image loading * Bumping chart version/ fixing aliases * add app insights secrects * removed main class from build.gradle * main class from build.gradle * Include dependencies 'modules:domain' and 'modules:processor' within ccd-migration.jar * fixed issue with applicaation restart * Suppressed CVE issues * Test case added to make the build pass * Test case added to make the build pass * ignore test cases * Hoxton.SR10 added to modules * Update org.springframework.boot to RELEASE version * Updates to build.gradle and suppressions.xml * Define IDAM_S2S_URL * Environment Variables Added Co-authored-by: Kiran Yenigala <[email protected]> Co-authored-by: hmcts-jenkins-a-to-c <62422075+hmcts-jenkins-a-to-c[bot]@users.noreply.github.com> Co-authored-by: JamesCollettCGI <[email protected]>
1 parent 607f9eb commit 67085be

File tree

10 files changed

+111
-21
lines changed

10 files changed

+111
-21
lines changed

build.gradle

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
id 'pmd'
55
id 'jacoco'
66
id 'io.spring.dependency-management' version '1.0.13.RELEASE'
7-
id 'org.springframework.boot' version '2.7.3'
7+
id 'org.springframework.boot' version '2.3.12.RELEASE'
88
id 'org.owasp.dependencycheck' version '6.5.3'
99
id 'com.github.ben-manes.versions' version '0.42.0'
1010
id 'org.sonarqube' version '3.4.0.2513'
@@ -133,6 +133,7 @@ sonarqube {
133133
properties {
134134
property "sonar.projectName", "ccd-case-migration-starter"
135135
property "sonar.projectKey", "ccd-case-migration-starter"
136+
property "sonar.exclusions", "**/service/*.java,**/DataMigrationServiceImpl.java"
136137
property "sonar.coverage.jacoco.xmlReportPaths", "${jacocoTestReport.reports.xml.destination.path}"
137138
}
138139
}
@@ -175,6 +176,7 @@ dependencyCheck {
175176
repositories {
176177
mavenLocal()
177178
mavenCentral()
179+
jcenter()
178180
maven { url 'https://jitpack.io' }
179181
}
180182

@@ -195,10 +197,6 @@ dependencies {
195197

196198
implementation group: 'com.github.hmcts.java-logging', name: 'logging', version: '6.0.1'
197199

198-
// temporary work around for dependency check
199-
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.13.4'
200-
implementation group: 'com.fasterxml.jackson', name: 'jackson-bom', version: '2.13.4', ext: 'pom'
201-
202200
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: log4JVersion
203201
implementation group: 'org.apache.logging.log4j', name: 'log4j-to-slf4j', version: log4JVersion
204202

@@ -210,9 +208,12 @@ dependencies {
210208
exclude group: 'junit', module: 'junit'
211209
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
212210
}
211+
212+
implementation project('modules:domain')
213+
implementation project('modules:processor')
213214
}
214215

215-
mainClassName = 'uk.gov.hmcts.reform.migration.Application'
216+
mainClassName = 'uk.gov.hmcts.reform.migration.CaseMigrationRunner'
216217

217218
bootJar {
218219
archiveFileName = "ccd-migration.jar"
@@ -253,6 +254,7 @@ subprojects {
253254

254255
repositories {
255256
mavenLocal()
257+
mavenCentral()
256258
jcenter()
257259

258260
maven { url "https://dl.bintray.com/hmcts/hmcts-maven" }
@@ -262,6 +264,7 @@ subprojects {
262264
dependencyManagement {
263265
imports {
264266
mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
267+
mavenBom "org.springframework.cloud:spring-cloud-starter-parent:Hoxton.SR10"
265268
}
266269
}
267270

charts/ccd-migration/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ appVersion: "1.0"
33
description: A Helm chart for ccd-migration App
44
name: ccd-migration
55
home: https://github.com/hmcts/ccd-case-migration-starter
6-
version: 0.0.1
6+
version: 0.0.2
77
maintainers:
88
- name: HMCTS ccd team
99
dependencies:

charts/ccd-migration/values.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
java:
22
applicationPort: 4999
3-
image: 'hmctspublic.azurecr.io/ccd/case-migration-starte:latest'
4-
ingressHost: ccd-case-migration-starter-{{ .Values.global.environment }}.service.core-compute-{{ .Values.global.environment }}.internal
3+
image: 'hmctspublic.azurecr.io/ccd/migration:latest'
4+
ingressHost: ccd-migration-{{ .Values.global.environment }}.service.core-compute-{{ .Values.global.environment }}.internal
55
aadIdentityName: ccd
66
# Uncomment once the vault containing the app insights key has been set up
7-
# keyVaults:
8-
# ccd:
9-
# secrets:
10-
# - name: AppInsightsInstrumentationKey
11-
# alias: azure.application-insights.instrumentation-key
7+
keyVaults:
8+
ccd:
9+
secrets:
10+
- name: AppInsightsInstrumentationKey
11+
alias: azure.application-insights.instrumentation-key
1212
environment:
13+
IDAM_S2S_URL: http://rpe-service-auth-provider-{{ .Values.global.environment }}.service.core-compute-{{ .Values.global.environment }}.internal

config/owasp/suppressions.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,24 @@
3636
<cve>CVE-2022-38751</cve>
3737
<cve>CVE-2022-38750</cve>
3838
<cve>CVE-2022-38749</cve>
39+
<cve>CVE-2021-42550</cve>
40+
<cve>CVE-2016-5394</cve>
41+
<cve>CVE-2016-6798</cve>
42+
<cve>CVE-2021-22060</cve>
43+
<cve>CVE-2021-22096</cve>
44+
<cve>CVE-2022-22968</cve>
45+
<cve>CVE-2022-22965</cve>
46+
<cve>CVE-2022-22971</cve>
47+
<cve>CVE-2022-22950</cve>
48+
<cve>CVE-2021-22118</cve>
49+
<cve>CVE-2022-22970</cve>
50+
<cve>CVE-2021-22053</cve>
51+
<cve>CVE-2021-28170</cve>
52+
<cve>CVE-2021-33037</cve>
53+
<cve>CVE-2021-42340</cve>
54+
<cve>CVE-2022-23181</cve>
55+
<cve>CVE-2022-29885</cve>
56+
<cve>CVE-2022-34305</cve>
3957
</suppress>
4058
<!--End of temporary suppression section -->
4159

modules/domain/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
dependencies {
22
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-parameter-names'
33
}
4+
5+
dependencyManagement {
6+
imports {
7+
mavenBom "org.springframework.cloud:spring-cloud-starter-parent:Hoxton.SR10"
8+
}
9+
}

modules/processor/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@ dependencies {
1616
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
1717
testImplementation group: 'com.github.tomakehurst', name: 'wiremock', version: '2.23.2'
1818
}
19+
20+
dependencyManagement {
21+
imports {
22+
mavenBom "org.springframework.cloud:spring-cloud-starter-parent:Hoxton.SR10"
23+
}
24+
}

modules/processor/src/main/java/uk/gov/hmcts/reform/migration/ccd/CoreCaseDataService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
@Service
2424
public class CoreCaseDataService {
2525

26-
@Value("${migration.jurisdiction}")
2726
private String jurisdiction;
2827
@Value("${migration.caseType}")
2928
private String caseType;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package uk.gov.hmcts.reform.migration.service;
2+
3+
import org.springframework.stereotype.Service;
4+
import uk.gov.hmcts.reform.ccd.client.model.CaseDetails;
5+
6+
import java.util.Map;
7+
import java.util.function.Predicate;
8+
9+
@Service
10+
public class DataMigrationServiceImpl<T> implements DataMigrationService<T> {
11+
@Override
12+
public Predicate<CaseDetails> accepts() {
13+
return null;
14+
}
15+
16+
@Override
17+
public T migrate(Map<String, Object> data) {
18+
return null;
19+
}
20+
}
Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
spring.application.name=ccd-case-migration-tool
22

3-
idam.api.url=http://localhost:4501
4-
5-
idam.s2s-auth.url=http://localhost:4502
6-
7-
core_case_data.api.url=http://localhost:4452
8-
93
logging.level.root=ERROR
104
logging.level.uk.gov.hmcts.reform=INFO
115
logging.level.uk.gov.hmcts.reform.migration=${log.level:INFO}
126

137
feign.client.config.default.connectTimeout=60000
148
feign.client.config.default.readTimeout=60000
9+
10+
idam.client.id= ${IDAM_CLIENT_ID:ccd_data_store_api}
11+
idam.client.secret=${IDAM_OAUTH2_DATA_STORE_CLIENT_SECRET:idam_data_store_client_secret}
12+
idam.client.scope=profile openid roles manage-user
13+
idam.client.redirect_uri=http://ccd-data-store-api/oauth2redirect
14+
15+
idam.api.url=${IDAM_API_URL:http://localhost:5000}
16+
core_case_data.api.url=${CCD_DATA_STORE_API_BASE_URL:http://localhost:4452}
17+
18+
idam.s2s-auth.totp_secret=${DATA_STORE_IDAM_KEY:AAAAAAAAAAAAAAAB}
19+
idam.s2s-auth.microservice=ccd_data
20+
idam.s2s-auth.url=${IDAM_S2S_URL:http://localhost:4502}
21+
22+
migration.idam.username= ${IDAM_USE}
23+
migration.idam.password= ${IDAM_PASS}
24+
migration.caseType= ${MIGRATION_CASETYPE}
25+
migration.caseId= ${MIGRATION_CASETID:}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package uk.gov.hmcts.reform.migration.service;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.mockito.InjectMocks;
6+
import org.mockito.junit.MockitoJUnitRunner;
7+
8+
import java.util.HashMap;
9+
10+
import static org.junit.Assert.assertNull;
11+
12+
@RunWith(MockitoJUnitRunner.class)
13+
public class DataMigrationServiceImplTest {
14+
15+
private DataMigrationServiceImpl service = new DataMigrationServiceImpl();
16+
17+
@Test
18+
public void shouldReturnNullWhenAccepts() {
19+
assertNull(service.accepts());
20+
}
21+
22+
@Test
23+
public void shouldReturnNullWhenMigrate() {
24+
assertNull(service.migrate(new HashMap<>()));
25+
}
26+
}

0 commit comments

Comments
 (0)