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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<groupId>uk.gov.moj.cpp.sjp</groupId>
<artifactId>sjp-parent</artifactId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
<packaging>pom</packaging>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion sjp-command/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-parent</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sjp-command/sjp-command-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-command</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion sjp-command/sjp-command-controller/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-command</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion sjp-command/sjp-command-handler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-command</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion sjp-domain/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<artifactId>sjp-parent</artifactId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>

<artifactId>sjp-domain</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sjp-domain/sjp-domain-aggregate/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<artifactId>sjp-domain</artifactId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>

<artifactId>sjp-domain-aggregate</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sjp-domain/sjp-domain-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<artifactId>sjp-domain</artifactId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion sjp-domain/sjp-domain-event-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-domain</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion sjp-domain/sjp-domain-event/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<artifactId>sjp-domain</artifactId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>

<artifactId>sjp-domain-event</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sjp-domain/sjp-domain-prosecution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>sjp-domain</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>

<artifactId>sjp-domain-prosecution</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sjp-domain/sjp-domain-transformation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-domain</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-domain-transformation</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-domain-transformation</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion sjp-event-sources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-parent</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sjp-event/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-parent</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sjp-event/sjp-event-indexer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-event</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,24 @@ public void shouldTransformCaseReceivedEvent() throws IOException {
verifyCase(inputCourtApplication, transformedJson, false);
}

@Test
public void shouldTransformCaseReceivedEventWithPncIdentifier() throws IOException {

final JsonObject specJson = readJsonViaPath("src/transformer/sjp.events.case-received-spec.json");
assertNotNull(specJson);

final JsonObject inputJson = readJson("/sjp.events.case-received-with-pnc-identifier.json");
final DocumentContext inputCourtApplication = parse(inputJson);
final JsonObject transformedJson = joltTransformer.transformWithJolt(specJson.toString(), inputJson);

verifyCase(inputCourtApplication, transformedJson, false);

final JsonObject inputDefendant = inputCourtApplication.read("$.defendant");
final JsonObject outputParties = (JsonObject) transformedJson.getJsonArray("parties").get(0);

assertThat(outputParties.getString("pncId"), is(inputDefendant.getString("pncIdentifier")));
}

private void verifyCase(final DocumentContext inputCase, final JsonObject outputCase, final boolean isCompany) {

assertThat(outputCase.getString("caseId"), is(((JsonString) inputCase.read("$.caseId")).getString()));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"caseId": "7e2f843e-d639-40b3-8611-8015f3a18958",
"urn": "22C22222222",
"enterpriseId": "2K2SLYFC743H",
"prosecutingAuthority": "TFL",
"costs": 1.23,
"postingDate": "2015-12-02",
"defendant": {
"id": "f06f6539-2a7c-4bc8-bca3-f1b17ebcfa47",
"title": "Mr",
"firstName": "David",
"lastName": "LLOYD",
"dateOfBirth": "1980-07-15",
"gender": "Male",
"numPreviousConvictions": 2,
"address": {
"address1": "14 Tottenham Court Road",
"address2": "London",
"address3": "England",
"address4": "UK",
"address5": "Greater London",
"postcode": "W1T 1JY"
},
"asn": "asnNumber",
"offences": [
{
"id": "7e2f843e-d639-40b3-8611-8015f3a18954",
"offenceSequenceNo": 1,
"libraOffenceCode": "PS00001",
"chargeDate": "2016-01-01",
"libraOffenceDateCode": 1,
"offenceCommittedDate": "2016-01-01",
"offenceWording": "Committed some offence",
"offenceWordingWelsh": "Welsh wording: Committed some offence",
"prosecutionFacts": "No ticket at the gates, forgery",
"witnessStatement": "Jumped over the barriers",
"compensation": 2.34
}
],
"pncIdentifier": "2026/1234567D"
},
"createdOn": "2018-01-11T16:17:15.294Z",
"expectedDateReady": "2015-12-30"
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"address5": "parties[0].address5",
"postcode": "parties[0].postCode"
},
"asn": "parties[0].arrestSummonsNumber"
"asn": "parties[0].arrestSummonsNumber",
"pncIdentifier": "parties[0].pncId"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion sjp-event/sjp-event-listener/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-event</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion sjp-event/sjp-event-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-event</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion sjp-healthchecks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-parent</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion sjp-integration-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<artifactId>sjp-parent</artifactId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sjp-json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<artifactId>sjp-parent</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"items": {
"$ref" : "http://justice.gov.uk/json/schemas/domains/sjp/events/case-received.offence.json"
}
},
"pncIdentifier": {
"type": "string"
}
}
}
2 changes: 1 addition & 1 deletion sjp-query/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-parent</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion sjp-query/sjp-query-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-query</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion sjp-query/sjp-query-view/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-query</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion sjp-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<artifactId>sjp-parent</artifactId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>
<artifactId>sjp-service</artifactId>
<packaging>war</packaging>
Expand Down
2 changes: 1 addition & 1 deletion sjp-viewstore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-parent</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sjp-viewstore</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sjp-viewstore/sjp-viewstore-liquibase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<artifactId>sjp-viewstore</artifactId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>

<artifactId>sjp-viewstore-liquibase</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sjp-viewstore/sjp-viewstore-persistence/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sjp-viewstore</artifactId>
<groupId>uk.gov.moj.cpp.sjp</groupId>
<version>17.103.175-SNAPSHOT</version>
<version>17.103.175-CADB-3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Loading