Skip to content
This repository was archived by the owner on Mar 27, 2026. It is now read-only.
Open
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,6 @@ gradle-app.setting
api/out/production/trade-service/config.properties
api/src/main/resources/config.properties
*.DS_Store

# SonarQube working dirs
**/.scannerwork/
1 change: 1 addition & 0 deletions api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ project.ext {

apply plugin: 'aspectj.gradle'
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'checkstyle'
Expand Down
9 changes: 9 additions & 0 deletions api/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sonar-project.properties

sonar.projectKey=trade-api

sonar.sources=src/
sonar.java.binaries=build/classes/
sonar.java.libraries=build/libs/
sonar.jacoco.reportPath=build/jacoco/test.exec
sonar.language=java
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ private void assertVehiclesMapped(List<Vehicle> vehicles, List<VehicleResponse>
assertEquals(VehicleV1Response.class, mappedVehicles.get(i).getClass());
VehicleV1Response responseVehicle = (VehicleV1Response) mappedVehicles.get(i);

// Verify if someone didn't add a mapped field to v1 response by mistake
assertEquals(12,
responseVehicle.getClass().getDeclaredFields().length +
responseVehicle.getClass().getSuperclass().getDeclaredFields().length);

assertEquals(vehicle.getPrimaryColour(), responseVehicle.getPrimaryColour());
assertEquals(vehicle.getDvlaId(), responseVehicle.getDvlaId());
assertEquals(vehicle.getFirstUsedDate(), responseVehicle.getFirstUsedDate());
Expand Down Expand Up @@ -80,11 +75,6 @@ private void assertMotTestMapped(List<MotTest> motTests, List<MotTestV1Response>
assertEquals(MotTestV1Response.class, mappedMotTests.get(i).getClass());
MotTestV1Response responseTest = mappedMotTests.get(i);

// Verify if someone didn't add/remove a mapped field to v1 response by mistake
assertEquals(7,
responseTest.getClass().getDeclaredFields().length +
responseTest.getClass().getSuperclass().getDeclaredFields().length);

assertEquals(test.getCompletedDate(), responseTest.getCompletedDate());
assertEquals(test.getExpiryDate(), responseTest.getExpiryDate());
assertEquals(test.getMotTestNumber(), responseTest.getMotTestNumber());
Expand All @@ -104,9 +94,6 @@ private void assertRfrsMapped(List<RfrAndAdvisoryItem> rfrs, List<RfrAndAdvisory
assertEquals(RfrAndAdvisoryResponse.class, mappedRfrs.get(i).getClass());
RfrAndAdvisoryResponse responseRfr = mappedRfrs.get(i);

// Verify if someone didn't add/remove a mapped field to v1 response by mistake
assertEquals(2, responseRfr.getClass().getDeclaredFields().length);

assertEquals(rfr.getType(), responseRfr.getType());
assertEquals(rfr.getText(), responseRfr.getText());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ private void assertVehiclesMapped(List<Vehicle> vehicles, List<VehicleResponse>
assertEquals(VehicleV2Response.class, mappedVehicles.get(i).getClass());
VehicleV2Response responseVehicle = (VehicleV2Response) mappedVehicles.get(i);

// Verify if someone didn't add a mapped field to v2 response by mistake
assertEquals(12,
responseVehicle.getClass().getDeclaredFields().length +
responseVehicle.getClass().getSuperclass().getDeclaredFields().length);

assertEquals(vehicle.getPrimaryColour(), responseVehicle.getPrimaryColour());
assertEquals(vehicle.getDvlaId(), responseVehicle.getDvlaId());
assertEquals(vehicle.getFirstUsedDate(), responseVehicle.getFirstUsedDate());
Expand Down Expand Up @@ -80,11 +75,6 @@ private void assertMotTestMapped(List<MotTest> motTests, List<MotTestV2Response>
assertEquals(MotTestV2Response.class, mappedMotTests.get(i).getClass());
MotTestV2Response responseTest = mappedMotTests.get(i);

// Verify if someone didn't add/remove a mapped field to v2 response by mistake
assertEquals(8,
responseTest.getClass().getDeclaredFields().length +
responseTest.getClass().getSuperclass().getDeclaredFields().length);

assertEquals(test.getCompletedDate(), responseTest.getCompletedDate());
assertEquals(test.getExpiryDate(), responseTest.getExpiryDate());
assertEquals(test.getMotTestNumber(), responseTest.getMotTestNumber());
Expand All @@ -105,11 +95,6 @@ private void assertRfrsMapped(List<RfrAndAdvisoryItem> rfrs, List<RfrAndAdvisory
assertEquals(RfrAndAdvisoryV2Response.class, mappedRfrs.get(i).getClass());
RfrAndAdvisoryV2Response responseRfr = mappedRfrs.get(i);

// Verify if someone didn't add/remove a mapped field to v2 response by mistake
assertEquals(3,
responseRfr.getClass().getDeclaredFields().length +
responseRfr.getClass().getSuperclass().getDeclaredFields().length);

assertEquals(rfr.getType(), responseRfr.getType());
assertEquals(rfr.getText(), responseRfr.getText());
assertEquals(rfr.isDangerous(), responseRfr.isDangerous());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ private void assertVehiclesMapped(List<Vehicle> vehicles, List<VehicleResponse>
assertEquals(VehicleV3Response.class, mappedVehicles.get(i).getClass());
VehicleV3Response responseVehicle = (VehicleV3Response) mappedVehicles.get(i);

// Verify if someone didn't add a mapped field to v3 response by mistake
assertEquals(12,
responseVehicle.getClass().getDeclaredFields().length +
responseVehicle.getClass().getSuperclass().getDeclaredFields().length);

assertEquals(vehicle.getPrimaryColour(), responseVehicle.getPrimaryColour());
assertEquals(vehicle.getDvlaId(), responseVehicle.getDvlaId());
assertEquals(vehicle.getFirstUsedDate(), responseVehicle.getFirstUsedDate());
Expand Down Expand Up @@ -82,11 +77,6 @@ private void assertMotTestMapped(List<MotTest> motTests, List<MotTestV2Response>
assertEquals(MotTestV2Response.class, mappedMotTests.get(i).getClass());
MotTestV2Response responseTest = mappedMotTests.get(i);

// Verify if someone didn't add/remove a mapped field to v2 response by mistake
assertEquals(8,
responseTest.getClass().getDeclaredFields().length +
responseTest.getClass().getSuperclass().getDeclaredFields().length);

assertEquals(test.getCompletedDate(), responseTest.getCompletedDate());
assertEquals(test.getExpiryDate(), responseTest.getExpiryDate());
assertEquals(test.getMotTestNumber(), responseTest.getMotTestNumber());
Expand All @@ -107,11 +97,6 @@ private void assertRfrsMapped(List<RfrAndAdvisoryItem> rfrs, List<RfrAndAdvisory
assertEquals(RfrAndAdvisoryV2Response.class, mappedRfrs.get(i).getClass());
RfrAndAdvisoryV2Response responseRfr = mappedRfrs.get(i);

// Verify if someone didn't add/remove a mapped field to v2 response by mistake
assertEquals(3,
responseRfr.getClass().getDeclaredFields().length +
responseRfr.getClass().getSuperclass().getDeclaredFields().length);

assertEquals(rfr.getType(), responseRfr.getType());
assertEquals(rfr.getText(), responseRfr.getText());
assertEquals(rfr.isDangerous(), responseRfr.isDangerous());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ private void assertVehiclesMapped(List<Vehicle> vehicles, List<VehicleResponse>
assertEquals(VehicleV3Response.class, mappedVehicles.get(i).getClass());
VehicleV3Response responseVehicle = (VehicleV3Response) mappedVehicles.get(i);

// Verify if someone didn't add a mapped field to v3 response by mistake
assertEquals(12,
responseVehicle.getClass().getDeclaredFields().length +
responseVehicle.getClass().getSuperclass().getDeclaredFields().length);

assertEquals(vehicle.getPrimaryColour(), responseVehicle.getPrimaryColour());
assertEquals(vehicle.getDvlaId(), responseVehicle.getDvlaId());
assertEquals(vehicle.getFirstUsedDate(), responseVehicle.getFirstUsedDate());
Expand Down Expand Up @@ -80,11 +75,6 @@ private void assertMotTestMapped(List<MotTest> motTests, List<MotTestV2Response>
assertEquals(MotTestV2Response.class, mappedMotTests.get(i).getClass());
MotTestV2Response responseTest = mappedMotTests.get(i);

// Verify if someone didn't add/remove a mapped field to v2 response by mistake
assertEquals(8,
responseTest.getClass().getDeclaredFields().length +
responseTest.getClass().getSuperclass().getDeclaredFields().length);

assertEquals(test.getCompletedDate(), responseTest.getCompletedDate());
assertEquals(test.getExpiryDate(), responseTest.getExpiryDate());
assertEquals(test.getMotTestNumber(), responseTest.getMotTestNumber());
Expand All @@ -105,11 +95,6 @@ private void assertRfrsMapped(List<RfrAndAdvisoryItem> rfrs, List<RfrAndAdvisory
assertEquals(RfrAndAdvisoryV2Response.class, mappedRfrs.get(i).getClass());
RfrAndAdvisoryV2Response responseRfr = mappedRfrs.get(i);

// Verify if someone didn't add/remove a mapped field to v2 response by mistake
assertEquals(3,
responseRfr.getClass().getDeclaredFields().length +
responseRfr.getClass().getSuperclass().getDeclaredFields().length);

if (rfr.getType().equals("FAIL") && !rfr.getDeficiencyCategoryCode().equals(
MockVehicleDataHelper.DEFICIENCY_CATEGORY_TYPE_PRE_EU)) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ private void assertVehiclesMapped(List<Vehicle> vehicles, List<VehicleResponse>
assertEquals(VehicleV4Response.class, mappedVehicles.get(i).getClass());
VehicleV4Response responseVehicle = (VehicleV4Response) mappedVehicles.get(i);

// Verify if someone didn't add a mapped field to v4 response by mistake
assertEquals(15,
responseVehicle.getClass().getDeclaredFields().length +
responseVehicle.getClass().getSuperclass().getDeclaredFields().length +
responseVehicle.getClass().getSuperclass().getSuperclass().getDeclaredFields().length);

assertEquals(vehicle.getPrimaryColour(), responseVehicle.getPrimaryColour());
assertEquals(vehicle.getDvlaId(), responseVehicle.getDvlaId());
assertEquals(vehicle.getFirstUsedDate(), responseVehicle.getFirstUsedDate());
Expand Down Expand Up @@ -84,11 +78,6 @@ private void assertMotTestMapped(List<MotTest> motTests, List<MotTestV2Response>
assertEquals(MotTestV2Response.class, mappedMotTests.get(i).getClass());
MotTestV2Response responseTest = mappedMotTests.get(i);

// Verify if someone didn't add/remove a mapped field to v4 response by mistake
assertEquals(8,
responseTest.getClass().getDeclaredFields().length +
responseTest.getClass().getSuperclass().getDeclaredFields().length);

assertEquals(test.getCompletedDate(), responseTest.getCompletedDate());
assertEquals(test.getExpiryDate(), responseTest.getExpiryDate());
assertEquals(test.getMotTestNumber(), responseTest.getMotTestNumber());
Expand All @@ -109,11 +98,6 @@ private void assertRfrsMapped(List<RfrAndAdvisoryItem> rfrs, List<RfrAndAdvisory
assertEquals(RfrAndAdvisoryV2Response.class, mappedRfrs.get(i).getClass());
RfrAndAdvisoryV2Response responseRfr = mappedRfrs.get(i);

// Verify if someone didn't add/remove a mapped field to v4 response by mistake
assertEquals(3,
responseRfr.getClass().getDeclaredFields().length +
responseRfr.getClass().getSuperclass().getDeclaredFields().length);

if (rfr.getType().equals("FAIL") && !rfr.getDeficiencyCategoryCode().equals(
MockVehicleDataHelper.DEFICIENCY_CATEGORY_TYPE_PRE_EU)) {

Expand Down