Skip to content

Commit d7d580b

Browse files
authored
Merge pull request #177 from companieshouse/feature/JU-89-java-21-migration-validation-errors
correcting custom validation errors to match pre-java-upgrade errors
2 parents dc8c053 + ffe696a commit d7d580b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/main/java/uk/gov/companieshouse/orders/api/validator/DeliveryDetailsValidator.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
@Component
1212
public class DeliveryDetailsValidator {
1313

14-
private static final String ADDRESS_LINE_1_VALIDATION = "delivery_details.address_line_1 may not be blank";
15-
private static final String COUNTRY_VALIDATION = "delivery_details.country may not be blank";
16-
private static final String FORENAME_VALIDATION = "delivery_details.forename may not be blank";
17-
private static final String SURNAME_VALIDATION = "delivery_details.surname may not be blank";
18-
private static final String LOCALITY_VALIDATION = "delivery_details.locality may not be blank";
14+
private static final String ADDRESS_LINE_1_VALIDATION = "delivery_details.address_line_1: must not be blank";
15+
private static final String COUNTRY_VALIDATION = "delivery_details.country: must not be blank";
16+
private static final String FORENAME_VALIDATION = "delivery_details.forename: must not be blank";
17+
private static final String SURNAME_VALIDATION = "delivery_details.surname: must not be blank";
18+
private static final String LOCALITY_VALIDATION = "delivery_details.locality: must not be blank";
1919
private static final String POSTAL_CODE_VALIDATION = "Postcode or Region is required";
2020

2121
public DeliveryDetailsValidator() { }

src/test/java/uk/gov/companieshouse/orders/api/controller/BasketControllerIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,7 @@ void addDeliveryDetailsFailsDueToFailedValidation() throws Exception {
15361536
.andExpect(status().isBadRequest())
15371537
.andDo(MockMvcResultHandlers.print())
15381538
.andReturn();
1539-
Assertions.assertTrue(result.getResponse().getContentAsString().contains("address_line_1 may not be blank"));
1539+
Assertions.assertTrue(result.getResponse().getContentAsString().contains("delivery_details.address_line_1: must not be blank"));
15401540
}
15411541

15421542
@Test

0 commit comments

Comments
 (0)