Open
Conversation
CCD diff summary👉 Full report: https://github.com/hmcts/pcs-api/actions/runs/23585426217?check_suite_focus=true No change |
toby-plunkett
approved these changes
Mar 24, 2026
tvr-hmcts
reviewed
Mar 24, 2026
| return DynamicStringListElement.builder().code(value.name()).label(value.getLabel()).build(); | ||
| } | ||
|
|
||
|
|
| return; | ||
| } | ||
|
|
||
| Iterator<Map.Entry<String, JsonNode>> fields = patch.fields(); |
Contributor
There was a problem hiding this comment.
fields() is depricated so you can use patch.properties().iterator();
| * Fully replaces the old address rather than merging individual fields. | ||
| */ | ||
| private void clearAddressFieldsInBase(JsonNode base, JsonNode patch) { | ||
| clearAddressFieldsRecursively(base, patch); |
Contributor
There was a problem hiding this comment.
Is there a need for this to actually have this wrapping method?
| JsonNode baseChild = base.get(fieldName); | ||
|
|
||
| if ("address".equalsIgnoreCase(fieldName) && patchChild.isObject() && baseChild.isObject()) { | ||
| clearAddressFields((ObjectNode) baseChild); |
Contributor
There was a problem hiding this comment.
Does this need checking before casting?
| import uk.gov.hmcts.reform.pcs.config.JacksonConfiguration; | ||
|
|
||
| import com.fasterxml.jackson.databind.JsonNode; | ||
| import static org.assertj.core.api.Assertions.assertThat; |
Contributor
There was a problem hiding this comment.
the static usually goes at the footer of the list
|
|
||
| @Test | ||
| void shouldClearAddressFieldsWhenPatchContainsAddress() throws Exception { | ||
| String baseJson = """ |
|
|
||
| @Test | ||
| void shouldNotClearAddressIfPatchDoesNotContainAddress() throws Exception { | ||
| String baseJson = """ |
src/main/java/uk/gov/hmcts/reform/pcs/ccd/service/DraftCaseJsonMerger.java
Show resolved
Hide resolved
Contributor
Plan Result (aat) |
scottstewart-sl
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira link
See HDPI-4131
Change description
Update full address on merge to ensure that changes to the optional field county are reflected in the db.
Testing done
Security Vulnerability Assessment
CVE Suppression: Are there any CVEs present in the codebase (either newly introduced or pre-existing) that are being intentionally suppressed or ignored by this commit?
Checklist