Skip to content

Commit

Permalink
Stabilisation12 (#714)
Browse files Browse the repository at this point in the history
* PNC Batch Job fails when a post code contains a double space (#711)

* Updated require_pnc_check_view to account for post codes with double spaces

* Added regex check to post code

* Fixed issue where attendance time could return undefined for some court letters (#710)

* Can not return Jurors that are in any status other then PANEL and JUROR (#709)

* Fixed issue where users could not return Jurors that are in any status other then PANEL and JUROR

* Removed any jurors that have  a confirmed jury attendances from the day but are not in JUROR status from the jurors in waiting list

* Updated juror on a trial list to show historical confirmed attendances (Even if the trial has ended)

* Updated a few welsh letter message templates (#707)

* Added some performance indexs

* Renamed migration files

* Updated migration

* Updated migrations

* Removed index from pnc_check_view

* Fixed tests

* Digital responses - Reasonable adjustments detail only displaying code on JUROR DETAILS and REASONABLE ADJ REPORT (#613)

* Fixed issue where digital Reasonable adjustments were not being added correctly

* Updated reasonable adjustment logic for save

* Updated tests

* Fixed styles

* Updated juror name search to ignore case (#718)

* Dependency update (#720)

* Update plugin org.owasp.dependencycheck to v10

* Update dependency hashicorp/terraform to v1.9.4

* Update dependency net.bytebuddy:byte-buddy to v1.14.19

* Update dependency org.assertj:assertj-core to v3.26.3

* Update Terraform azurerm to 3.116

* Update dependency gradle to v8.10

* Update dependency net.javacrumbs.json-unit:json-unit-fluent to v3.4.1

* Update plugin org.sonarqube to v5.1.0.4882

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Updated StraightThroughProcessingServiceException logging (#716)

* Updated bulk_print_data_notify_comms to exclude blank email addresses (#715)

* ISSUES WITH COMPLETION OF SERVICE REPORT (#712)

* remove duplicate jurors from completion of service report

* update tests

* Improved performance of getting the latest juror revision (#719)

* Third party details in the juror record does not save the details (#708)

* Added support for third party details

* Added migration

* Application fails to retrieve public holidays as loc code is null (#713)

* Fixed issue where holidays would fail to retrieve some public holidays

* Fixed styles

* A number of places within the application can return a "Query did not return a unique result" when a juror is within multiple pools (#717)

* Updated several places where juror pools could return non unique results

* Replaced many calls to JurorPoolUtils with calls to the jurorPoolService

* Hide "Expenses approval limits" for Court Managers and SJO's (#721)

* Updated expense approval limit to only be editable by system admins

* Updated expense approval limit to only be editable by system admins

* Updated juror response search to exclude juror owned records (#722)

* Fixed issue where digital response would only merge reason and relationship (#723)

* Added totalJurors In pool to pool statistics (#725)

* Update the way we grab the current jurors location to grab the active trial instead of using appearances (#724)

* Fixed tests

* Fixed third party details (#726)

* Fixed issue where users were unable to put a user on call if they have been transferred (#727)

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ricardo <140706972+ricardofreitasrocha@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 22, 2024
1 parent c99b99b commit b45348f
Show file tree
Hide file tree
Showing 98 changed files with 1,217 additions and 1,021 deletions.
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ buildscript {
plugins {
id 'org.springframework.boot' version "${springBootVersion}"
id "org.flywaydb.flyway" version "${flywayVersion}"
id 'org.owasp.dependencycheck' version '9.2.0'
id 'org.owasp.dependencycheck' version '10.0.3'
id 'checkstyle'
id 'pmd'
id 'com.github.ben-manes.versions' version '0.51.0'
id 'org.sonarqube' version '5.0.0.4638'
id 'org.sonarqube' version '5.1.0.4882'
}
apply plugin: 'java'
apply plugin: 'eclipse'
Expand Down Expand Up @@ -137,14 +137,14 @@ dependencies {

testImplementation 'org.apache.httpcomponents.client5:httpclient5:5.3.1'
//testImplementation 'org.apache.httpcomponents:httpclient:4.5.13'
testImplementation 'net.javacrumbs.json-unit:json-unit-fluent:3.3.0'
testImplementation('org.assertj:assertj-core:3.26.0')
testImplementation 'net.javacrumbs.json-unit:json-unit-fluent:3.4.1'
testImplementation('org.assertj:assertj-core:3.26.3')
testImplementation 'org.mockito:mockito-core:5.12.0'

testImplementation('org.projectlombok:lombok')
testAnnotationProcessor('org.projectlombok:lombok')

testImplementation('net.bytebuddy:byte-buddy:1.14.17')
testImplementation('net.bytebuddy:byte-buddy:1.14.19')
testImplementation('junit:junit:4.13.2')
testImplementation "org.testcontainers:testcontainers:1.19.8"
testImplementation "org.testcontainers:junit-jupiter:1.19.8"
Expand Down Expand Up @@ -239,7 +239,7 @@ processResources.finalizedBy(copyDocs)


wrapper {
gradleVersion = '8.8'
gradleVersion = '8.10'
}

sourceSets {
Expand Down Expand Up @@ -287,7 +287,7 @@ pmdTest {
maxFailures = 294
}
pmdMain {
maxFailures = 780
maxFailures = 776
}
pmd {
maxFailures = 0
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 4 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/.terraform-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.0
1.9.4
2 changes: 1 addition & 1 deletion infrastructure/state.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.110"
version = "3.116"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,7 @@ public void updateResponseStatus_happy_closed() throws Exception {

final URI uri = URI.create("/api/v1/bureau/status/644892530");

final String bureauJwt = mintBureauJwt(BureauJwtPayload.builder()
.userLevel("99")
.login("testlogin")
.owner(JurorDigitalApplication.JUROR_OWNER)
.build());
final String bureauJwt = createJwtBureau("testlogin");

// assert db state before merge.
assertThat(jdbcTemplate.queryForObject("SELECT count(*) FROM juror_mod.juror", Integer.class)).isEqualTo(1);
Expand Down Expand Up @@ -256,11 +252,7 @@ public void updateResponseStatus_unhappy_optimisticLockingMismatch() throws Exce

final URI uri = URI.create("/api/v1/bureau/status/644892530");

final String bureauJwt = mintBureauJwt(BureauJwtPayload.builder()
.userLevel("99")
.login("testlogin")
.owner(JurorDigitalApplication.JUROR_OWNER)
.build());
final String bureauJwt = createJwtBureau("testlogin");

// assert db state before merge.
assertThat(jdbcTemplate.queryForObject("SELECT count(*) FROM juror_mod.juror", Integer.class)).isEqualTo(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import uk.gov.hmcts.juror.api.AbstractIntegrationTest;
import uk.gov.hmcts.juror.api.SpringBootErrorResponse;
import uk.gov.hmcts.juror.api.bureau.controller.response.CourtCatchmentStatusDto;
import uk.gov.hmcts.juror.api.config.bureau.BureauJwtPayload;

import java.net.URI;
import java.util.Collections;
Expand Down Expand Up @@ -55,11 +54,7 @@ void setUp() throws Exception {
@Sql("/db/standing_data.sql")
@Sql("/db/BureauResponseCourtCatchmentController.sql")
void courtCatchmentChanged() throws Exception {
final String bureauJwt = mintBureauJwt(BureauJwtPayload.builder()
.userLevel("99")
.login("ncrawford")
.owner("400")
.build());
final String bureauJwt = createJwtBureau("ncrawford");


httpHeaders.set(HttpHeaders.AUTHORIZATION, bureauJwt);
Expand Down Expand Up @@ -93,11 +88,7 @@ void courtCatchmentChanged() throws Exception {
@Sql("/db/standing_data.sql")
@Sql("/db/BureauResponseCourtCatchmentController.sql")
void courtCatchmentUnchanged() throws Exception {
final String bureauJwt = mintBureauJwt(BureauJwtPayload.builder()
.userLevel("99")
.login("ncrawford")
.owner("400")
.build());
final String bureauJwt = createJwtBureau("ncrawford");


httpHeaders.set(HttpHeaders.AUTHORIZATION, bureauJwt);
Expand Down Expand Up @@ -130,11 +121,7 @@ void courtCatchmentUnchanged() throws Exception {
@Sql("/db/standing_data.sql")
@Sql("/db/BureauResponseCourtCatchmentController_Unhappy.sql")
void courtCatchmentLocCodeNotFoundUnhappy() throws Exception {
final String bureauJwt = mintBureauJwt(BureauJwtPayload.builder()
.userLevel("99")
.login("ncrawford")
.owner("400")
.build());
final String bureauJwt = createJwtBureau("ncrawford");

httpHeaders.set(HttpHeaders.AUTHORIZATION, bureauJwt);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import uk.gov.hmcts.juror.api.bureau.controller.ResponseDisqualifyController.DisqualifyReasonsDto;
import uk.gov.hmcts.juror.api.bureau.domain.DisCode;
import uk.gov.hmcts.juror.api.bureau.domain.IPoolStatus;
import uk.gov.hmcts.juror.api.config.bureau.BureauJwtPayload;
import uk.gov.hmcts.juror.api.moj.domain.DisqualifiedCode;

import java.net.URI;
Expand Down Expand Up @@ -57,12 +56,7 @@ public void setUp() throws Exception {
@SuppressWarnings("PMD.JUnitAssertionsShouldIncludeMessage")//False positive
public void testGDisqualifyReasons_happy() {
final String loginName = "testlogin";
httpHeaders.set(HttpHeaders.AUTHORIZATION, mintBureauJwt(BureauJwtPayload.builder()
.userLevel("1")
.login(loginName)
.owner("400")
.build())
);
httpHeaders.set(HttpHeaders.AUTHORIZATION, createJwtBureau(loginName));

ResponseEntity<DisqualifyReasonsDto> responseEntity = template.exchange(new RequestEntity<Void>(httpHeaders,
HttpMethod.GET, URI.create("/api/v1/bureau/juror/disqualify")), DisqualifyReasonsDto.class);
Expand Down Expand Up @@ -90,12 +84,7 @@ public void testGDisqualifyReasons_happy() {
})
public void disqualifyJuror_happy() throws Exception {
final String loginName = "testlogin";
httpHeaders.set(HttpHeaders.AUTHORIZATION, mintBureauJwt(BureauJwtPayload.builder()
.userLevel("1")
.login(loginName)
.owner("400")
.build())
);
httpHeaders.set(HttpHeaders.AUTHORIZATION, createJwtBureau(loginName));

DisqualifiedCode disqualifyCodeEntity = new DisqualifiedCode("B", "On Bail", true);
DisqualifyCodeDto disqualifyDto =
Expand Down Expand Up @@ -213,12 +202,7 @@ public void disqualifyJuror_happy() throws Exception {
})
public void disqualifyJuror_happy_ageDisqualification() throws Exception {
final String loginName = "testlogin";
httpHeaders.set(HttpHeaders.AUTHORIZATION, mintBureauJwt(BureauJwtPayload.builder()
.userLevel("1")
.login(loginName)
.owner("400")
.build())
);
httpHeaders.set(HttpHeaders.AUTHORIZATION, createJwtBureau(loginName));

DisqualifiedCode disqualifyCodeEntity = new DisqualifiedCode("A", "Less Than Eighteen Years of Age or"
+ " Over 70", true);
Expand Down Expand Up @@ -305,12 +289,7 @@ public void disqualifyJuror_happy_ageDisqualification() throws Exception {
})
public void disqualifyJuror_unhappy_invalidDisqualifyCode() throws Exception {
final String loginName = "testlogin";
httpHeaders.set(HttpHeaders.AUTHORIZATION, mintBureauJwt(BureauJwtPayload.builder()
.userLevel("1")
.login(loginName)
.owner("400")
.build())
);
httpHeaders.set(HttpHeaders.AUTHORIZATION, createJwtBureau(loginName));

DisqualifiedCode disqualifyCodeEntity = new DisqualifiedCode("Z", "Zinvalid code", true);
DisqualifyCodeDto disqualifyDto = new DisqualifyCodeDto(disqualifyCodeEntity);
Expand Down Expand Up @@ -391,12 +370,7 @@ public void disqualifyJuror_unhappy_invalidDisqualifyCode() throws Exception {
})
public void disqualifyJuror_unhappy_jurorNotFound() throws Exception {
final String loginName = "testlogin";
httpHeaders.set(HttpHeaders.AUTHORIZATION, mintBureauJwt(BureauJwtPayload.builder()
.userLevel("1")
.login(loginName)
.owner("400")
.build())
);
httpHeaders.set(HttpHeaders.AUTHORIZATION, createJwtBureau(loginName));

DisqualifiedCode disqualifyCodeEntity = new DisqualifiedCode("B", "On Bail", true);
DisqualifyCodeDto disqualifyDto = new DisqualifyCodeDto(disqualifyCodeEntity);
Expand Down Expand Up @@ -471,12 +445,7 @@ public void disqualifyJuror_unhappy_jurorNotFound() throws Exception {
})
public void disqualifyJuror_unhappy_incorrectVersion() throws Exception {
final String loginName = "testlogin";
httpHeaders.set(HttpHeaders.AUTHORIZATION, mintBureauJwt(BureauJwtPayload.builder()
.userLevel("1")
.login(loginName)
.owner("400")
.build())
);
httpHeaders.set(HttpHeaders.AUTHORIZATION,createJwtBureau(loginName));

DisqualifiedCode disqualifyCodeEntity = new DisqualifiedCode("B", "On Bail", true);
DisqualifyCodeDto disqualifyDto = new DisqualifyCodeDto(disqualifyCodeEntity);
Expand Down Expand Up @@ -551,12 +520,7 @@ public void disqualifyJuror_unhappy_incorrectVersion() throws Exception {
})
public void disqualifyJuror_unhappy_nullVersion() throws Exception {
final String loginName = "testlogin";
httpHeaders.set(HttpHeaders.AUTHORIZATION, mintBureauJwt(BureauJwtPayload.builder()
.userLevel("1")
.login(loginName)
.owner("400")
.build())
);
httpHeaders.set(HttpHeaders.AUTHORIZATION, createJwtBureau(loginName));

DisqualifiedCode disqualifyCodeEntity = new DisqualifiedCode("B", "On Bail", true);
DisqualifyCodeDto disqualifyDto = new DisqualifyCodeDto(disqualifyCodeEntity);
Expand Down
Loading

0 comments on commit b45348f

Please sign in to comment.