Skip to content

Commit 4191aa0

Browse files
committed
feature: move apitest gradle dependencies into build.gradle
Reorder log fields to put message as the second column where we can easily see it
1 parent 6749940 commit 4191aa0

6 files changed

Lines changed: 28 additions & 47 deletions

File tree

build.gradle

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,8 @@ apply {
2525
from("$rootDir/gradle/api-test.gradle")
2626
}
2727

28-
springBoot {
29-
buildInfo {
30-
properties {
31-
name = project.name
32-
version = project.version.toString()
33-
}
34-
}
35-
}
36-
28+
// We MUST keep all dependencies in the build.gradle to allow dependabot to provide version updates
29+
// Sadly, dependabot does not track dependencies in the apply-from files
3730
dependencies {
3831
// Api spec
3932
implementation("uk.gov.hmcts.cp:api-hmcts-crime-template:2.0.2")
@@ -86,4 +79,16 @@ dependencies {
8679

8780
// Jwt token
8881
implementation 'io.jsonwebtoken:jjwt:0.13.0'
82+
83+
84+
// Api Test
85+
apiTestImplementation platform('org.junit:junit-bom:5.13.4')
86+
apiTestRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
87+
apiTestImplementation('org.springframework.boot:spring-boot-starter-test') {
88+
exclude group: 'junit', module: 'junit'
89+
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
90+
}
91+
apiTestRuntimeOnly 'org.junit.platform:junit-platform-launcher'
92+
apiTestCompileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.38'
93+
apiTestAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.38'
8994
}

gradle/api-test.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,6 @@ configurations {
4949
}
5050
}
5151

52-
dependencies {
53-
apiTestImplementation platform('org.junit:junit-bom:5.13.4')
54-
apiTestRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
55-
56-
apiTestImplementation('org.springframework.boot:spring-boot-starter-test') {
57-
exclude group: 'junit', module: 'junit'
58-
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
59-
}
60-
apiTestRuntimeOnly 'org.junit.platform:junit-platform-launcher'
61-
apiTestCompileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.38'
62-
apiTestAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.38'
63-
}
64-
6552
dockerCompose {
6653
useComposeFiles = ['docker-compose.yml']
6754
startedServices = ['app', 'db']

gradle/java.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,13 @@ tasks.withType(JavaExec).configureEach {
1414

1515
tasks.named('wrapper') {
1616
delete "${projectDir}/gradlew.bat"
17+
}
18+
19+
springBoot {
20+
buildInfo {
21+
properties {
22+
name = project.name
23+
version = project.version.toString()
24+
}
25+
}
1726
}

gradle/spring-db.gradle

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

src/main/java/uk/gov/hmcts/cp/controllers/BadController.java

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

src/main/resources/logback.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22
<appender name="JSON" class="ch.qos.logback.core.ConsoleAppender">
33
<encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
44
<providers>
5-
<mdc/>
65
<timestamp>
76
<fieldName>timestamp</fieldName>
87
<pattern>yyyy-MM-dd' 'HH:mm:ss.SSS</pattern>
98
</timestamp>
10-
<loggerName/>
11-
<threadName/>
12-
<logLevel/>
9+
<!-- Lets keep the message to the left so its easier to find without scrolling -->
1310
<pattern>
1411
<pattern>{"message": "%message%n%xException{full}"}</pattern>
1512
</pattern>
13+
<mdc/>
14+
<loggerName/>
15+
<threadName/>
16+
<logLevel/>
1617
</providers>
1718
</encoder>
1819
</appender>

0 commit comments

Comments
 (0)