forked from hmcts/am-org-role-mapping-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
705 lines (622 loc) · 33.8 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath("net.serenity-bdd:serenity-gradle-plugin:2.4.34")
classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.15.0'
}
}
plugins {
id 'application'
id 'uk.gov.hmcts.java' version '0.12.63'
id 'pmd'
id 'jacoco'
id 'io.spring.dependency-management' version '1.1.6'
id 'org.springframework.boot' version '2.7.18'
id 'info.solidsoft.pitest' version '1.15.0'
id 'com.github.ben-manes.versions' version '0.45.0'
id 'org.sonarqube' version '4.0.0.2929'
id 'au.com.dius.pact' version '4.3.12'
id 'com.github.spacialcircumstances.gradle-cucumber-reporting' version '0.1.25'
id 'org.owasp.dependencycheck' version '10.0.3'
id 'org.flywaydb.flyway' version '8.5.13'
}
apply plugin: "info.solidsoft.pitest"
apply plugin: 'java'
apply plugin: 'net.serenity-bdd.aggregator'
apply plugin: 'project-report'
apply plugin: 'idea'
apply plugin: 'io.spring.dependency-management'
ext['snakeyaml.version'] = '2.0'
def versions = [
junit : '5.9.0',
lombok : '1.18.34',
pitest : '1.16.1',
reformLogging : '6.1.5',
reformS2sClient: '4.0.2',
serenity : '2.2.12',
springBoot : '2.7.18',
spring : '5.3.37',
springSecurity : '5.7.11',
springHystrix : '2.1.1.RELEASE',
swagger2Version: '2.10.5',
tomcat : '9.0.91',
pact_version : '4.1.41',
rest_assured : '3.3.0',
cucumber : '5.7.0',
feign_jackson : '9.7.0',
jacksondata : '2.17.2',
drools : '7.73.0.Final',
log4JVersion : '2.20.0',
logbackVersion : '1.2.13',
launchDarklySdk: '5.10.9',
netty_version : '4.1.112.Final',
poi : '5.2.5'
]
mainClassName = 'uk.gov.hmcts.reform.orgrolemapping.OrgRoleMappingApplication'
def jarName = 'am-org-role-mapping-service.jar'
pmd {
toolVersion = '6.55.0'
sourceSets = []
}
group = 'uk.gov.hmcts.reform.orgrolemapping'
version = '0.0.1'
tasks.withType(JavaExec).configureEach {
javaLauncher.set(javaToolchains.launcherFor(java.toolchain))
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.0
}
}
}
}
configurations {
functionalTestCompile.extendsFrom testCompile
functionalTestRuntime.extendsFrom testRuntime
cucumberRuntime.extendsFrom(functionalRuntime)
contractTestCompile.extendsFrom testCompile
contractTestRuntime.extendsFrom testRuntime
}
sourceSets {
functionalTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/functionalTest/java')
}
resources.srcDir file('src/functionalTest/resources')
}
integrationTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integrationTest/java')
}
resources.srcDir file('src/integrationTest/resources')
}
smokeTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/smokeTest/java')
}
resources.srcDir file('src/smokeTest/resources')
}
contractTest {
java {
compileClasspath += main.output
runtimeClasspath += main.output
srcDir file('src/contractTest/java')
}
resources.srcDir file('src/contractTest/resources')
}
}
idea {
module {
// config to allow Intelij to mark test source and resource files correctly to help linting tools
testSources.from(java.sourceSets.functionalTest.java.srcDirs)
testSources.from(java.sourceSets.integrationTest.java.srcDirs)
testSources.from(java.sourceSets.smokeTest.java.srcDirs)
testSources.from(java.sourceSets.contractTest.java.srcDirs)
testResources.from(java.sourceSets.functionalTest.resources.srcDirs)
testResources.from(java.sourceSets.integrationTest.resources.srcDirs)
testResources.from(java.sourceSets.smokeTest.resources.srcDirs)
testResources.from(java.sourceSets.contractTest.resources.srcDirs)
}
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Werror"
}
task functional(type: JavaExec) {
description = "Runs the functional tests"
group = "Verification"
generateCucumberReports.enabled = false
main("uk.gov.hmcts.reform.orgrolemapping.befta.OrgRoleMappingAmBeftaMain")
classpath += configurations.cucumberRuntime + sourceSets.functionalTest.runtimeClasspath + sourceSets.main.output + sourceSets.test.output
args = ['--strict', '--tags', 'not @Ignore',
'--plugin', "json:${rootDir}/target/cucumber.json", '--plugin', "junit:${buildDir}/test-results/functional/cucumber.xml",
'--glue', 'uk.gov.hmcts.befta.player', 'src/functionalTest/resources/features'
]
// '--add-opens=...' added to suppress 'WARNING: An illegal reflective access operation has occurred' in uk.gov.hmcts.befta.util.CucumberStepAnnotationUtils
jvmArgs '--add-opens=java.base/java.lang.reflect=ALL-UNNAMED'
// Configure array order in FTAs
environment "DEFAULT_COLLECTION_ASSERTION_MODE", "UNORDERED"
finalizedBy {
generateCucumberReports.enabled = true
generateCucumberReports {
doLast{
def functionalReportsFolder = "${rootDir}/target/cucumber/functional-html-reports/"
delete functionalReportsFolder
new File(functionalReportsFolder).mkdirs()
file("${rootDir}/target/cucumber/cucumber-html-reports").renameTo(file(functionalReportsFolder))
logger.quiet("Functional test report moved to ---> file://$functionalReportsFolder/overview-features.html")
}
}
}
outputs.upToDateWhen { false }
}
task integration(type: Test, description: 'Runs the integration tests.', group: 'Verification') {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
mustRunAfter test
finalizedBy aggregate
}
check.dependsOn integration
task smoke(type: Test, description: 'Runs the smoke tests.', group: 'Verification') {
testClassesDirs = sourceSets.smokeTest.output.classesDirs
classpath = sourceSets.smokeTest.runtimeClasspath
finalizedBy aggregate
}
task fortifyScan(type: JavaExec) {
main("uk.gov.hmcts.fortifyclient.FortifyClientMainApp")
classpath += sourceSets.test.runtimeClasspath
jvmArgs = ['--add-opens=java.base/java.lang.reflect=ALL-UNNAMED']
// The line below prevents the build from failing if the Fortify scan detects issues
ignoreExitValue = true as JavaExecSpec
}
jacocoTestReport {
executionData(test)
reports {
xml.required = true
csv.required = false
xml.outputLocation = file("${project.buildDir}/reports/jacoco/test/jacocoTestReport.xml")
}
}
project.tasks['sonarqube'].dependsOn jacocoTestReport
jacoco {
toolVersion = "0.8.8"
}
task migratePostgresDatabase(type: org.flywaydb.gradle.task.FlywayMigrateTask) {
baselineOnMigrate = true
outOfOrder = true
if (project.hasProperty("dburl")) {
url = "jdbc:postgresql://${dburl}"
}
}
pitest {
testPlugin = "junit5"
targetClasses = ['uk.gov.hmcts.reform.*']
excludedClasses = ['uk.gov.hmcts.reform.orgrolemapping.OrgRoleMappingApplication',
'uk.gov.hmcts.reform.orgrolemapping.util.GetSasToken',
'uk.gov.hmcts.reform.orgrolemapping.config.*',
'uk.gov.hmcts.reform.orgrolemapping.data.*',
'uk.gov.hmcts.reform.orgrolemapping.servicebus.messaging.MessagingConfig',
'uk.gov.hmcts.reform.orgrolemapping.feignclients.configuration.*',
'uk.gov.hmcts.reform.orgrolemapping.domain.model.*',
'uk.gov.hmcts.reform.orgrolemapping.servicebus.*',
'*UserAccessProfileBuilder*', '*AssignmentRequestBuilder*',
'*Swagger2SpringBoot*']
threads = 15
outputFormats = ['XML', 'HTML']
timestampedReports = true
mutationThreshold = 40
}
sonarqube {
properties {
property "sonar.projectName", "am-org-role-mapping-service"
property "sonar.projectKey", "am-org-role-mapping-service"
property "sonar.coverage.jacoco.xmlReportPaths", "${project.buildDir}/reports/jacoco/test/jacocoTestReport.xml"
property "sonar.pitest.mode", "reuseReport"
property "sonar.pitest.reportsDirectory", "build/reports/pitest"
property "sonar.exclusions",
"src/main/java/uk/gov/hmcts/reform/orgrolemapping/*Application.java," +
"src/main/java/uk/gov/hmcts/reform/orgrolemapping/util/*Swagger2SpringBoot.java," +
"src/main/java/uk/gov/hmcts/reform/orgrolemapping/util/*GetSasToken.java," +
"src/main/java/uk/gov/hmcts/reform/orgrolemapping/feignclients/configuration/**," +
"src/main/java/uk/gov/hmcts/reform/orgrolemapping/domain/model/**," +
"src/main/java/uk/gov/hmcts/reform/orgrolemapping/servicebus/**," +
"src/main/java/uk/gov/hmcts/reform/orgrolemapping/config/**," +
"src/main/java/uk/gov/hmcts/reform/orgrolemapping/data/**," +
"src/main/java/uk/gov/hmcts/reform/orgrolemapping/controller/TestController.java," +
"**UserAccessProfileBuilder.java," +
"**TestController.java"
"src/main/java/uk/gov/hmcts/reform/orgrolemapping/controller/advice/exception/**"
property "sonar.junit.reportPaths", "${project.buildDir}/test-results/junit-platform"
}
}
project.tasks['sonarqube'].dependsOn test, integration, jacocoTestReport
project.tasks['sonarqube'].group = "Verification"
dependencyUpdates.resolutionStrategy {
componentSelection { rules ->
rules.all {
def isNonStable = { String version ->
['alpha', 'beta', 'rc', 'cr', 'm', 'preview', 'b', 'ea'].any { qualifier ->
version ==~ /(?i).*[.-]$qualifier[.\d-+]*/
}
}
if (isNonStable(candidate.version) && !isNonStable(currentVersion)) {
selection.reject('Release candidate')
}
}
}
}
//https://jeremylong.github.io/DependencyCheck/dependency-check-gradle/configuration.html
dependencyCheck {
suppressionFile = 'config/owasp/suppressions.xml'
}
dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}
repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://jitpack.io'
}
}
tasks.named('integration') {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}
dependencies {
implementation(group: 'org.springframework.boot', name:'spring-boot-starter-web', version: versions.springBoot) {
exclude group: 'org.glassfish', module: 'jakarta.el'
}
implementation(group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: versions.springBoot)
implementation(group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: versions.springBoot)
implementation(group: 'org.springframework.boot', name: 'spring-boot-starter-aop', version: versions.springBoot)
implementation(group: 'org.springframework.boot', name: 'spring-boot-starter-json', version: versions.springBoot)
implementation(group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc', version: versions.springBoot)
//Added for Spring Security Implementation
implementation(group: 'org.springframework.boot', name: 'spring-boot-starter-security', version: versions.springBoot)
implementation(group: 'org.springframework.boot', name: 'spring-boot-starter-cache', version: versions.springBoot)
implementation(group: 'org.springframework.boot', name:'spring-boot-starter-oauth2-client', version: versions.springBoot)
implementation(group: 'org.springframework.boot', name:'spring-boot-starter-oauth2-resource-server', version: versions.springBoot)
implementation group: 'org.springframework.security', name: 'spring-security-core', version: versions.springSecurity
implementation group: 'org.springframework.security', name:'spring-security-web', version: versions.springSecurity
implementation group: 'org.springframework.security', name:'spring-security-config', version: versions.springSecurity
implementation group: 'org.springframework.security', name:'spring-security-crypto', version: versions.springSecurity
implementation group: 'org.springframework.security', name:'spring-security-oauth2-client', version: versions.springSecurity
implementation group: 'org.springframework.security', name:'spring-security-oauth2-core', version: versions.springSecurity
implementation group: 'org.springframework.security', name:'spring-security-oauth2-jose', version: versions.springSecurity
implementation group: 'org.springframework.security', name:'spring-security-oauth2-resource-server', version: versions.springSecurity
implementation group: 'org.springframework.retry', name: 'spring-retry', version: '2.0.7'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-netflix-hystrix', version: '2.2.10.RELEASE'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-bootstrap', version: '3.1.8'
implementation group: 'org.springframework.hateoas', name: 'spring-hateoas', version: '1.5.6'
implementation group: 'org.springframework', name: 'spring-core', version: versions.spring
implementation group: 'org.springframework', name: 'spring-beans', version: versions.spring
implementation group: 'org.springframework', name: 'spring-aop', version: versions.spring
implementation group: 'org.springframework', name: 'spring-aspects', version: versions.spring
implementation group: 'org.springframework', name: 'spring-context', version: versions.spring
implementation group: 'org.springframework', name: 'spring-context-support', version: versions.spring
implementation group: 'org.springframework', name: 'spring-expression', version: versions.spring
implementation group: 'org.springframework', name: 'spring-jcl', version: versions.spring
implementation group: 'org.springframework', name: 'spring-jdbc', version: versions.spring
implementation group: 'org.springframework', name: 'spring-orm', version: versions.spring
implementation group: 'org.springframework', name: 'spring-tx', version: versions.spring
implementation group: 'org.springframework', name: 'spring-web', version: versions.spring
implementation group: 'org.springframework', name: 'spring-webmvc', version: versions.spring
implementation group: 'org.springdoc', name: 'springdoc-openapi-ui', version: '1.6.8'
implementation group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.4'
implementation group: 'commons-fileupload', name: 'commons-fileupload', version: '1.5'
implementation group: 'org.json', name: 'json', version: '20231013'
implementation group: 'javax.inject', name: 'javax.inject', version: '1'
implementation group: 'com.microsoft.azure', name: 'applicationinsights-spring-boot-starter', version: '2.6.4'
implementation group: 'io.opentelemetry.instrumentation', name: 'opentelemetry-instrumentation-annotations', version: '1.33.5'
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.14'
// drools engine dependency
implementation group: 'org.drools', name: 'drools-core', version: versions.drools
implementation group: 'org.drools', name: 'drools-compiler', version: versions.drools
implementation group: 'org.drools', name: 'drools-decisiontables', version: versions.drools
implementation(group: 'org.kie', name: 'kie-ci', version: versions.drools) {
exclude group: 'org.jsoup', module: 'jsoup'
exclude group: 'org.apache.ant', module: 'ant'
exclude group: 'org.apache.ant', module: 'ant-launcher'
exclude group: 'org.glassfish', module: 'jakarta.el'
exclude group: 'jakarta.el', module: 'jakarta.el-api'
exclude group: 'com.google.protobuf', module: 'protobuf-java'
}
implementation group: 'com.thoughtworks.xstream', name: 'xstream', version: '1.4.20'
implementation group: 'org.flywaydb', name: 'flyway-core', version: '8.5.13'
//Added for S2S and User Authentication
implementation group: 'com.github.hmcts', name: 'service-auth-provider-java-client', version: versions.reformS2sClient
implementation group: 'javax.inject', name: 'javax.inject', version: '1'
implementation group: 'com.github.hmcts.java-logging', name: 'logging', version: versions.reformLogging
//Azure service bus libraries
implementation(group: 'com.microsoft.azure', name: 'azure-servicebus', version: '3.6.7'){
exclude group: 'com.microsoft.azure', module: 'adal4j'
exclude group: 'org.asynchttpclient', module: 'async-http-client-netty-utils'
}
implementation group: 'com.azure', name: 'azure-core', version: '1.50.0'
implementation group: 'com.azure', name: 'azure-messaging-servicebus', version: '7.17.2'
implementation group: 'io.projectreactor', name: 'reactor-core', version: '3.6.8'
implementation group: 'commons-cli', name: 'commons-cli', version: '1.8.0'
implementation group: 'com.launchdarkly', name: 'launchdarkly-java-server-sdk', version: versions.launchDarklySdk
implementation group: 'com.google.guava', name: 'guava', version: '32.1.3-jre'
implementation group: 'com.github.ben-manes.caffeine', name: 'caffeine', version: '3.1.8'
implementation group: 'org.apache.maven', name: 'maven-core', version: '3.8.7'
implementation group: 'org.postgresql', name: 'postgresql', version: '42.6.1'
implementation group: 'com.nimbusds', name: 'nimbus-jose-jwt', version: '9.40'
implementation group: 'io.jsonwebtoken', name: 'jjwt', version: '0.9.1'
implementation group: 'com.github.hmcts', name: 'idam-java-client', version: '2.0.1'
implementation 'commons-io:commons-io:20030203.000550'
//CVE-2021-35515, CVE-2021-35516, CVE-2021-35517, CVE-2021-36090
// To be cleaned up later
implementation group: 'org.apache.commons', name: 'commons-compress', version: '1.26.2'
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-websocket', version: versions.tomcat
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: versions.tomcat
implementation group:'com.fasterxml.jackson.datatype', name:'jackson-datatype-jsr310'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: versions.jacksondata
implementation group: 'com.fasterxml.jackson', name: 'jackson-bom', version: versions.jacksondata, ext: 'pom'
implementation group: 'org.apache.poi', name: 'poi', version: versions.poi
implementation group: 'org.apache.poi', name: 'poi-ooxml', version: versions.poi
implementation group: 'org.apache.poi', name: 'poi-scratchpad', version: versions.poi
//Dependent on drools Jar. Can be removed CVE-2021-26291
implementation group: 'org.apache.maven', name: 'maven-core', version: '3.8.7'
implementation (group: 'io.netty', name: 'netty-buffer', version: versions.netty_version) {
because 'In Netty before version 4.1.60.Final there is a vulnerability that enables request smuggling.'
}
implementation (group: 'io.netty', name: 'netty-codec', version: versions.netty_version) {
because 'In Netty before version 4.1.60.Final there is a vulnerability that enables request smuggling.'
}
implementation (group: 'io.netty', name: 'netty-codec-http', version: versions.netty_version) {
because 'In Netty before version 4.1.60.Final there is a vulnerability that enables request smuggling.'
}
implementation (group: 'io.netty', name: 'netty-common', version: versions.netty_version) {
because 'In Netty before version 4.1.60.Final there is a vulnerability that enables request smuggling.'
}
implementation (group: 'io.netty', name: 'netty-handler', version: versions.netty_version) {
because 'In Netty before version 4.1.60.Final there is a vulnerability that enables request smuggling.'
}
implementation (group: 'io.netty', name: 'netty-resolver', version: versions.netty_version) {
because 'In Netty before version 4.1.60.Final there is a vulnerability that enables request smuggling.'
}
implementation (group: 'io.netty', name: 'netty-transport', version: versions.netty_version) {
because 'In Netty before version 4.1.60.Final there is a vulnerability that enables request smuggling.'
}
implementation (group: 'io.netty', name: 'netty-transport-native-epoll', version: versions.netty_version) {
because 'In Netty before version 4.1.60.Final there is a vulnerability that enables request smuggling.'
}
implementation (group: 'io.netty', name: 'netty-transport-native-kqueue', version: versions.netty_version) {
because 'In Netty before version 4.1.60.Final there is a vulnerability that enables request smuggling.'
}
implementation (group: 'io.netty', name: 'netty-transport-native-unix-common', version: versions.netty_version) {
because 'In Netty before version 4.1.60.Final there is a vulnerability that enables request smuggling.'
}
implementation (group: 'io.netty', name: 'netty-codec-http2', version: versions.netty_version) {
because 'In Netty before version 4.1.60.Final there is a vulnerability that enables request smuggling.'
}
implementation (group: 'io.netty', name: 'netty-codec-socks', version: versions.netty_version) {
because 'In Netty before version 4.1.60.Final there is a vulnerability that enables request smuggling.'
}
implementation (group: 'io.netty', name: 'netty-handler-proxy', version: versions.netty_version) {
because 'In Netty before version 4.1.60.Final there is a vulnerability that enables request smuggling.'
}
implementation (group: 'io.netty', name: 'netty-codec-dns', version: versions.netty_version) {
because 'In Netty before version 4.1.66.Final there is a vulnerability that enables request smuggling.'
}
implementation (group: 'io.netty', name: 'netty-resolver-dns', version: versions.netty_version) {
because 'In Netty before version 4.1.66.Final there is a vulnerability that enables request smuggling.'
}
implementation (group: 'io.netty', name: 'netty-resolver-dns-native-macos', version: versions.netty_version) {
because 'In Netty before version 4.1.66.Final there is a vulnerability that enables request smuggling.'
}
implementation group: 'io.netty', name: 'netty-resolver-dns-classes-macos', version: versions.netty_version
implementation group: 'io.netty', name: 'netty-transport-classes-epoll', version: versions.netty_version
implementation group: 'io.netty', name: 'netty-transport-classes-kqueue', version: versions.netty_version
testImplementation('com.opentable.components:otj-pg-embedded:1.1.0')
testImplementation('com.github.tomakehurst:wiremock-jre8-standalone:2.35.2')
testImplementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.36'
pitest 'org.pitest:pitest-junit5-plugin:1.2.1'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: versions.junit
testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.4.0'
testImplementation group: 'org.mockito', name: 'mockito-inline', version: '4.4.0'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: versions.junit
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: versions.junit
testImplementation group: 'org.junit.platform', name: 'junit-platform-commons', version: '1.9.2'
testImplementation group: 'org.pitest', name: 'pitest', version: versions.pitest
testImplementation group: 'info.solidsoft.gradle.pitest', name:'gradle-pitest-plugin', version: '1.15.0'
testImplementation 'org.codehaus.sonar-plugins:sonar-pitest-plugin:0.5'
testImplementation('org.springframework.cloud:spring-cloud-contract-wiremock:3.1.10')
testImplementation group: 'org.springframework.boot', name:'spring-boot-starter-test', version: versions.springBoot
testImplementation group: 'org.springframework.security',name:'spring-security-test', version: versions.springSecurity
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-openfeign', version: '2.2.10.RELEASE'
testImplementation(group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: versions.springBoot) {
exclude group: 'junit', module: 'junit'
}
testImplementation 'com.github.hmcts:befta-fw:8.7.11'
testImplementation(group: 'io.cucumber', name: 'cucumber-java', version: versions.cucumber) {
exclude group: 'javascript', module: 'jquery'
}
testImplementation group: 'io.rest-assured', name: 'rest-assured', version: versions.rest_assured
testImplementation group: 'io.cucumber', name: 'cucumber-junit', version: versions.cucumber
testImplementation group: 'io.github.openfeign', name: 'feign-jackson', version: versions.feign_jackson
testImplementation group: 'net.serenity-bdd', name: 'serenity-core', version: versions.serenity
testImplementation group: 'net.serenity-bdd', name: 'serenity-junit', version: versions.serenity
testImplementation group: 'net.serenity-bdd', name: 'serenity-rest-assured', version: versions.serenity
testImplementation group: 'net.serenity-bdd', name: 'serenity-spring', version: versions.serenity
testImplementation 'com.github.hmcts:fortify-client:1.4.3:all'
smokeTestImplementation group: 'net.serenity-bdd', name: 'serenity-core', version: versions.serenity
smokeTestImplementation group: 'net.serenity-bdd', name: 'serenity-junit', version: versions.serenity
smokeTestImplementation group: 'net.serenity-bdd', name: 'serenity-rest-assured', version: versions.serenity
smokeTestImplementation group: 'net.serenity-bdd', name: 'serenity-spring', version: versions.serenity
smokeTestImplementation group: 'io.rest-assured', name: 'rest-assured', version: versions.rest_assured
smokeTestImplementation group: 'commons-io', name: 'commons-io', version: '20030203.000550'
// AM-467-Serenity report for Integration test
integrationTestImplementation group: 'net.serenity-bdd', name: 'serenity-core', version: versions.serenity
integrationTestImplementation group: 'net.serenity-bdd', name: 'serenity-junit', version: versions.serenity
integrationTestImplementation group: 'net.serenity-bdd', name: 'serenity-rest-assured', version: versions.serenity
integrationTestImplementation group: 'net.serenity-bdd', name: 'serenity-spring', version: versions.serenity
integrationTestImplementation group: 'io.rest-assured', name: 'rest-assured', version: versions.rest_assured
integrationTestImplementation group: 'org.awaitility', name: 'awaitility', version: '4.2.2'
integrationTestImplementation group: 'org.awaitility', name: 'awaitility-proxy', version: '3.1.6'
integrationTestImplementation sourceSets.main.runtimeClasspath
integrationTestImplementation sourceSets.test.runtimeClasspath
functionalTestImplementation sourceSets.main.runtimeClasspath
functionalTestImplementation sourceSets.test.runtimeClasspath
compileOnly group: 'org.projectlombok', name: 'lombok', version: versions.lombok
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: versions.lombok
smokeTestImplementation sourceSets.main.runtimeClasspath
smokeTestImplementation sourceSets.test.runtimeClasspath
smokeTestCompileOnly group: 'org.projectlombok', name: 'lombok', version: versions.lombok
smokeTestAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: versions.lombok
contractTestImplementation group: 'au.com.dius.pact.consumer', name: 'java8', version: versions.pact_version
contractTestImplementation group: 'au.com.dius.pact.consumer', name: 'junit5', version: versions.pact_version
contractTestImplementation group: 'au.com.dius.pact.provider', name: 'junit5', version: versions.pact_version
contractTestImplementation group: 'au.com.dius.pact.provider', name: 'spring', version: versions.pact_version
contractTestImplementation group: 'au.com.dius.pact.provider', name: 'junit5spring', version: versions.pact_version
contractTestImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
contractTestImplementation(group: "org.junit.jupiter", name: "junit-jupiter-api", version: versions.junit)
contractTestRuntime(group: 'org.junit.jupiter', name:'junit-jupiter-engine', version: versions.junit)
contractTestImplementation sourceSets.main.runtimeClasspath
contractTestImplementation sourceSets.test.runtimeClasspath
}
dependencyManagement {
dependencies {
dependencySet(group: 'org.apache.logging.log4j', version: versions.log4JVersion) {
entry 'log4j-api'
entry 'log4j-to-slf4j'
}
dependencySet(group: 'ch.qos.logback', version: versions.logbackVersion) {
entry 'logback-classic'
entry 'logback-core'
}
dependencySet(group: 'com.fasterxml.jackson.core', version: versions.jacksondata) {
entry 'jackson-databind'
entry 'jackson-core'
entry 'jackson-annotations'
}
// CVE-2023-3635 override okio dependency in azure-servicebus:3.6.7
dependencySet(group: 'com.squareup.okio', version: '3.9.0') {
entry 'okio'
}
}
}
project.ext {
pacticipant = 'accessMgmt_orgRoleMapping'
if (System.env.GIT_COMMIT) {
// DTSAM-379 canIDeploy Index 0 out of bounds for length 0 Issue
pacticipantVersion = System.env.GIT_COMMIT.substring(0,9)
} else {
// DTSAM-382 GIT_COMMIT null in local build fix
pacticipantVersion = getCheckedOutGitCommitHash()
}
}
static def getCheckedOutGitCommitHash() {
'git rev-parse --verify --short HEAD'.execute().text.trim()
}
task contract(type: Test) {
description = 'Runs the consumer Pact tests'
useJUnitPlatform()
testClassesDirs = sourceSets.contractTest.output.classesDirs
classpath = sourceSets.contractTest.runtimeClasspath
include "uk/gov/hmcts/reform/judicialbooking/**"
include "uk/gov/hmcts/reform/orgrolemapping/**"
include "uk/gov/hmcts/reform/refdata/**"
systemProperty 'pact.rootDir', "pacts"
}
task runAndPublishConsumerPactTests(type: Test, description: 'Publish pact test to broker.', group: 'Verification') {
useJUnitPlatform()
testClassesDirs = sourceSets.contractTest.output.classesDirs
classpath = sourceSets.contractTest.runtimeClasspath
include "uk/gov/hmcts/reform/judicialbooking/**"
include "uk/gov/hmcts/reform/refdata/**"
include "uk/gov/hmcts/reform/orgrolemapping/**"
systemProperty 'pact.rootDir', "pacts"
}
runAndPublishConsumerPactTests.finalizedBy pactPublish
task runProviderPactVerification(type: Test) {
useJUnitPlatform()
logger.lifecycle("Runs provider pact Tests")
testClassesDirs = sourceSets.contractTest.output.classesDirs
classpath = sourceSets.contractTest.runtimeClasspath
if (project.hasProperty('pact.verifier.publishResults')) {
systemProperty 'pact.verifier.publishResults', project.property('pact.verifier.publishResults')
}
systemProperty 'pact.provider.version', project.pacticipantVersion
include "uk/gov/hmcts/reform/orgrolemapping/provider/**"
}
runProviderPactVerification.finalizedBy pactVerify
pact {
broker {
pactBrokerUrl = System.getenv("PACT_BROKER_FULL_URL") ?: 'http://localhost:9292'
}
publish {
pactDirectory = 'pacts'
version = project.pacticipantVersion
tags = [System.getenv("PACT_BRANCH_NAME") ?: 'Dev']
}
}
test {
jacoco{
excludes = ['org/drools/**/*']
}
generateCucumberReports.enabled = false
useJUnitPlatform()
failFast = true
}
bootJar {
archiveFileName = jarName
manifest {
attributes('Implementation-Version': project.version.toString())
}
}
configurations.all {
exclude group: "org.glassfish", module: "jakarta.el"
exclude group: "io.github.x-stream", module: "mxparser"
exclude group: 'io.netty', module: 'netty-tcnative-classes'
exclude group: 'io.netty.incubator', module: 'netty-incubator-codec-native-quic'
exclude group: 'io.netty.incubator', module: 'netty-incubator-codec-classes-quic'
}
cucumberReports {
outputDir = file("${projectDir}/target/cucumber")
reports = files("${projectDir}/target/cucumber.json")
notFailingStatuses = ["skipped","passed"]
}
// Gradle 7.x issue, workaround from: https://github.com/gradle/gradle/issues/17236#issuecomment-894768083
rootProject.tasks.named("processSmokeTestResources") {
duplicatesStrategy = 'include'
}
rootProject.tasks.named("processFunctionalTestResources") {
duplicatesStrategy = 'include'
}
rootProject.tasks.named("processIntegrationTestResources") {
duplicatesStrategy = 'include'
}
rootProject.tasks.named("processContractTestResources") {
duplicatesStrategy = 'include'
}