Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ private List<CourtMapping> resolveCpXhibitCourtMappingsWithMagsFirst(final UUID
.withCrestCourtId(mapping.getCrestCourtId())
.withCrestCourtSiteId(mapping.getCrestCourtSiteId())
.withCrestCourtName(mapping.getCrestCourtName())
.withWelshCrestCourtName(mapping.getWelshCrestCourtName())
.withCrestCourtShortName(mapping.getCrestCourtShortName())
.withWelshCrestCourtShortName(mapping.getWelshCrestCourtShortName())
.withCrestCourtSiteName(mapping.getCrestCourtSiteName())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ public void shouldCopyAllFieldsFromMagsMappingAndOverrideCourtTypeToMagistratesC
final String courtIdVal = "432";
final String courtSiteId = "433";
final String courtName = "BLACKFRIARS CROWN";
final String welshCourtName = "CORON BLACKFRIARS";
final String courtShortName = "BLF";
final String courtSiteName = "BLACKFRIARS SITE";
final String welshCourtSiteName = "SAFLE BLACKFRIARS";
Expand All @@ -496,6 +497,7 @@ public void shouldCopyAllFieldsFromMagsMappingAndOverrideCourtTypeToMagistratesC
.withCrestCourtId(courtIdVal)
.withCrestCourtSiteId(courtSiteId)
.withCrestCourtName(courtName)
.withWelshCrestCourtName(welshCourtName)
.withCrestCourtShortName(courtShortName)
.withCrestCourtSiteName(courtSiteName)
.withWelshCrestCourtSiteName(welshCourtSiteName)
Expand Down Expand Up @@ -524,6 +526,7 @@ public void shouldCopyAllFieldsFromMagsMappingAndOverrideCourtTypeToMagistratesC
assertThat(rebuilt.getCrestCourtId(), is(courtIdVal));
assertThat(rebuilt.getCrestCourtSiteId(), is(courtSiteId));
assertThat(rebuilt.getCrestCourtName(), is(courtName));
assertThat(rebuilt.getWelshCrestCourtName(), is(welshCourtName));
assertThat(rebuilt.getCrestCourtShortName(), is(courtShortName));
assertThat(rebuilt.getCrestCourtSiteName(), is(courtSiteName));
assertThat(rebuilt.getWelshCrestCourtSiteName(), is(welshCourtSiteName));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class CourtMapping {

private String crestCourtName;

private String welshCrestCourtName;

private String crestCourtShortName;

private String welshCrestCourtShortName;
Expand All @@ -51,6 +53,7 @@ public CourtMapping(@JsonProperty("id") final UUID id,
@JsonProperty("validFrom") final LocalDate validFrom,
@JsonProperty("validTo") final LocalDate validTo,
@JsonProperty("crestCourtName") final String crestCourtName,
@JsonProperty("welshCrestCourtName") final String welshCrestCourtName,
@JsonProperty("crestCourtShortName") final String crestCourtShortName,
@JsonProperty("welshCrestCourtShortName") final String welshCrestCourtShortName,
@JsonProperty("crestCourtFullName") final String crestCourtFullName,
Expand All @@ -66,6 +69,7 @@ public CourtMapping(@JsonProperty("id") final UUID id,
this.validFrom = validFrom;
this.validTo = validTo;
this.crestCourtName = crestCourtName;
this.welshCrestCourtName = welshCrestCourtName;
this.crestCourtShortName = crestCourtShortName;
this.welshCrestCourtShortName = welshCrestCourtShortName;
this.crestCourtFullName = crestCourtFullName;
Expand All @@ -74,6 +78,9 @@ public CourtMapping(@JsonProperty("id") final UUID id,
this.courtType = courtType;
}

private CourtMapping() {
}

public UUID getId() {
return id;
}
Expand Down Expand Up @@ -110,6 +117,10 @@ public String getCrestCourtName() {
return crestCourtName;
}

public String getWelshCrestCourtName() {
return welshCrestCourtName;
}

public String getCrestCourtShortName() {
return crestCourtShortName;
}
Expand All @@ -135,94 +146,90 @@ public String getCourtType() {
}

public static class Builder {
private UUID id;
private String oucode;
private String crestCourtId;
private String crestCourtSiteId;
private String crestCourtSiteName;
private String welshCrestCourtSiteName;
private LocalDate validFrom;
private LocalDate validTo;
private String crestCourtName;
private String crestCourtShortName;
private String welshCrestCourtShortName;
private String crestCourtFullName;
private String welshCrestCourtFullName;
private String crestCourtSiteCode;
private String courtType;
private final CourtMapping instance = new CourtMapping();

public CourtMapping.Builder withId(final UUID id) {
this.id = id;
instance.id = id;
return this;
}

public CourtMapping.Builder withOucode(final String oucode) {
this.oucode = oucode;
instance.oucode = oucode;
return this;
}

public CourtMapping.Builder withCrestCourtId(final String crestCourtId) {
this.crestCourtId = crestCourtId;
instance.crestCourtId = crestCourtId;
return this;
}

public CourtMapping.Builder withCrestCourtSiteId(final String crestCourtSiteId) {
this.crestCourtSiteId = crestCourtSiteId;
instance.crestCourtSiteId = crestCourtSiteId;
return this;
}

public CourtMapping.Builder withCrestCourtName(final String crestCourtName) {
this.crestCourtName = crestCourtName;
instance.crestCourtName = crestCourtName;
return this;
}

public CourtMapping.Builder withWelshCrestCourtName(final String welshCrestCourtName) {
instance.welshCrestCourtName = welshCrestCourtName;
return this;
}

public CourtMapping.Builder withCrestCourtSiteName(final String crestCourtSiteName) {
this.crestCourtSiteName = crestCourtSiteName;
instance.crestCourtSiteName = crestCourtSiteName;
return this;
}

public CourtMapping.Builder withWelshCrestCourtSiteName(final String welshCrestCourtSiteName) {
this.welshCrestCourtSiteName = welshCrestCourtSiteName;
instance.welshCrestCourtSiteName = welshCrestCourtSiteName;
return this;
}

public CourtMapping.Builder withCrestCourtShortName(final String crestCourtShortName) {
this.crestCourtShortName = crestCourtShortName;
instance.crestCourtShortName = crestCourtShortName;
return this;
}

public CourtMapping.Builder withWelshCrestCourtShortName(final String welshCrestCourtShortName) {
this.welshCrestCourtShortName = welshCrestCourtShortName;
instance.welshCrestCourtShortName = welshCrestCourtShortName;
return this;
}

public CourtMapping.Builder withCrestCourtFullName(final String crestCourtFullName) {
instance.crestCourtFullName = crestCourtFullName;
return this;
}

public CourtMapping.Builder withWelshCrestCourtFullName(final String welshCrestCourtFullName) {
this.welshCrestCourtFullName = welshCrestCourtFullName;
instance.welshCrestCourtFullName = welshCrestCourtFullName;
return this;
}

public CourtMapping.Builder withValidFrom(final LocalDate validFrom) {
this.validFrom = validFrom;
instance.validFrom = validFrom;
return this;
}

public CourtMapping.Builder withValidTo(final LocalDate validTo) {
this.validTo = validTo;
instance.validTo = validTo;
return this;
}

public CourtMapping.Builder withCrestCourtSiteCode(final String crestCourtSiteCode) {
this.crestCourtSiteCode = crestCourtSiteCode;
instance.crestCourtSiteCode = crestCourtSiteCode;
return this;
}

public CourtMapping.Builder withCourtType(final String courtType) {
this.courtType = courtType;
instance.courtType = courtType;
return this;
}

public CourtMapping build() {
return new CourtMapping(id, oucode, crestCourtId, crestCourtSiteId, crestCourtSiteName, welshCrestCourtSiteName, validFrom, validTo, crestCourtName, crestCourtShortName, welshCrestCourtShortName, crestCourtFullName, welshCrestCourtFullName, crestCourtSiteCode, courtType);
return instance;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ void shouldDeserializeReferenceDataCourtMappingsPayload() throws Exception {
"crestCourtSiteName": "PRESTON",
"welshCrestCourtSiteName": "PRESTON WELSH",
"crestCourtName": "PRESTON",
"welshCrestCourtName": "PRESTON WELSH NAME",
"crestCourtShortName": "PREST",
"crestCourtFullName": "PRESTON",
"welshCrestCourtFullName": "PRESTON WELSH FULL",
Expand All @@ -40,5 +41,6 @@ void shouldDeserializeReferenceDataCourtMappingsPayload() throws Exception {
assertEquals("CROWN_COURT", courtMappingsList.getCpXhibitCourtMappings().get(0).getCourtType());
assertEquals("PRESTON WELSH", courtMappingsList.getCpXhibitCourtMappings().get(0).getWelshCrestCourtSiteName());
assertEquals("PRESTON WELSH FULL", courtMappingsList.getCpXhibitCourtMappings().get(0).getWelshCrestCourtFullName());
assertEquals("PRESTON WELSH NAME", courtMappingsList.getCpXhibitCourtMappings().get(0).getWelshCrestCourtName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,22 @@
"crestCourtFullName": "NEWCASTLE UPON TYNE",
"crestCourtSiteCode": "C",
"courtType": "CROWN_COURT"
},
{
"id": "9c6f6b2b-2f1a-3f36-9d3c-6e6a2f2b5c4a",
"oucode": "CDF",
"crestCourtId": "100",
"crestCourtSiteId": "100",
"crestCourtSiteName": "Cardiff Crown Court",
"welshCrestCourtSiteName": "Llys y Goron Caerdydd",
"crestCourtName": "Cardiff",
"welshCrestCourtName": "Caerdydd",
"crestCourtShortName": "Cardiff",
"welshCrestCourtShortName": "Caerdydd",
"crestCourtFullName": "Cardiff Crown Court",
"welshCrestCourtFullName": "Llys y Goron Caerdydd",
"crestCourtSiteCode": "CDF01",
"courtType": "CROWN_COURT"
}
]
}
Loading