-
Notifications
You must be signed in to change notification settings - Fork 4
SSCSFT-88 Other party details not included in the body of the notice #5083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alibaseit
wants to merge
36
commits into
master
Choose a base branch
from
SSCSFT-88
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
042f210
SSCSFT-88 Update decision notices
alibaseit be89628
SSCSFT-88 Update decision notices
alibaseit 5211a77
SSCSFT-88 Update final decision sentences
alibaseit 1d131ef
SSCSFT-88 Include other parties in the body of Notice
alibaseit eb812fd
SSCSFT-88 Add other part details to body of the notice
alibaseit 1f9efd4
SSCSFT-88 Add other part details to body of the notice
alibaseit f5534f2
SSCSFT-88 Add other part details to body of the notice
alibaseit 34e0cf5
SSCSFT-88 Add other part details to body of the notice
alibaseit ba1abe7
SSCSFT-88 Add other part details to body of the notice
alibaseit 4a72b0e
SSCSFT-88 Add other part details to body of the notice
alibaseit c992f88
SSCSFT-88 Add other part details to body of the notice
alibaseit 8e55517
SSCSFT-88 Add other part details to body of the notice
alibaseit d2bb5fd
SSCSFT-88 Add other part details to body of the notice
alibaseit 00cd2fe
SSCSFT-88 Add other part details to body of the notice
alibaseit 77215c5
SSCSFT-88 Add other part details to body of the notice
alibaseit 67d910f
SSCSFT-88 Add other part details to body of the notice
alibaseit eae99f7
SSCSFT-88 Add other part details to body of the notice
alibaseit 8ca19b8
SSCSFT-88 Add other part details to body of the notice
alibaseit 4463c13
SSCSFT-88 Add other part details to body of the notice
alibaseit c5fd7e1
Merge branch 'master' into SSCSFT-88
alibaseit 076d6a1
Trigger Build
alibaseit f8cd3e0
Trigger Build
alibaseit 35f1717
Trigger Build
alibaseit 19bd67f
Merge branch 'master' into SSCSFT-88
alibaseit b4178a2
SSCSFT-88 Address comments
alibaseit 59d3a75
SSCSFT-88 Address comments
alibaseit 7c2cac3
SSCSFT-88 Address comments
alibaseit 9a1128d
SSCSFT-88 Address comments
alibaseit 3468d7a
SSCSFT-88 Address comments
alibaseit fd558a7
SSCSFT-88 Address comments
alibaseit 999945f
Merge branch 'master' into SSCSFT-88
alibaseit 4b15c8b
SSCSFT-88 Address comments
alibaseit 15cc87b
SSCSFT-88 Address comments
alibaseit 9603570
SSCSFT-88 Address comments
alibaseit 6e7dba4
SSCSFT-88 Address comments
alibaseit 14c4a59
Merge branch 'master' into SSCSFT-88
alibaseit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
70 changes: 70 additions & 0 deletions
70
.../java/uk/gov/hmcts/reform/sscs/functional/ccd/WriteFinalDecisionNoticeFunctionalTest.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| package uk.gov.hmcts.reform.sscs.functional.ccd; | ||
| import static org.hamcrest.MatcherAssert.assertThat; | ||
| import static org.hamcrest.Matchers.containsString; | ||
| import static org.hamcrest.Matchers.is; | ||
| import static org.hamcrest.Matchers.not; | ||
| import static org.hamcrest.Matchers.nullValue; | ||
| import static uk.gov.hmcts.reform.sscs.functional.handlers.BaseHandler.getJsonCallbackForTest; | ||
|
|
||
| import com.fasterxml.jackson.databind.ObjectMapper; | ||
| import java.io.IOException; | ||
| import org.apache.http.HttpResponse; | ||
| import org.apache.http.entity.StringEntity; | ||
| import org.apache.http.util.EntityUtils; | ||
| import org.apache.pdfbox.Loader; | ||
| import org.apache.pdfbox.pdmodel.PDDocument; | ||
| import org.apache.pdfbox.text.PDFTextStripper; | ||
| import org.junit.Test; | ||
| import org.springframework.beans.factory.annotation.Autowired; | ||
| import org.springframework.test.context.TestPropertySource; | ||
| import uk.gov.hmcts.reform.sscs.functional.mya.BaseFunctionTest; | ||
|
|
||
|
|
||
| @TestPropertySource(locations = "classpath:config/application_functional.properties") | ||
| public class WriteFinalDecisionNoticeFunctionalTest extends BaseFunctionTest { | ||
|
|
||
| @Autowired | ||
| private ObjectMapper objectMapper; | ||
|
|
||
| @Test | ||
| public void shouldGenerateExpectedDecisionTextWithOtherPartiesIncluded() throws IOException { | ||
|
|
||
| String json = getJsonCallbackForTest("handlers/writefinaldecision/writeFinalDecisionWithOtherParties.json"); | ||
|
|
||
| byte[] bytes = callPreviewFinalDecision(json); | ||
| try (PDDocument document = Loader.loadPDF(bytes)) { | ||
| String pdfText = new PDFTextStripper().getText(document); | ||
| String pdfTextWithoutNewLines = replaceNewLines(pdfText); | ||
|
|
||
| assertThat(pdfTextWithoutNewLines, containsString("1. The appeal is allowed.")); | ||
| assertThat(pdfTextWithoutNewLines, containsString("2. The decision made by the Secretary of State on 01/01/2026 is set aside.")); | ||
| assertThat(pdfTextWithoutNewLines, containsString("3. Decision")); | ||
| assertThat(pdfTextWithoutNewLines, containsString("4. Reason")); | ||
|
|
||
| assertThat(pdfTextWithoutNewLines, containsString("5. This has been an oral (face to face) hearing. " | ||
| + "The following people attended: Joe Bloggs the appellant, John Smith the second respondent, " | ||
| + "Jane Smith the third respondent, and a representative from the First Tier Agency. " | ||
| + "David Jones the fourth respondent, Sarah Jones the fifth respondent did not attend. " | ||
| + "The Tribunal considered the appeal bundle to page B7.")); | ||
|
|
||
| assertThat(pdfTextWithoutNewLines, not(containsString("6."))); | ||
| } | ||
| } | ||
|
|
||
| private String replaceNewLines(String pdfText) { | ||
| return pdfText.replaceAll("-\n", "-").replaceAll("[\\n\\t]", " ").replaceAll("\\s{2,}", " "); | ||
| } | ||
|
|
||
| private byte[] callPreviewFinalDecision(String json) throws IOException { | ||
| HttpResponse httpResponse = sscsMyaBackendRequests.midEvent(new StringEntity(json), "PreviewFinalDecision"); | ||
| CcdEventResponse ccdEventResponse = getCcdEventResponse(httpResponse); | ||
| assertThat(httpResponse.getStatusLine().getStatusCode(), is(200)); | ||
| assertThat(ccdEventResponse.getData().getSscsFinalDecisionCaseData().getWriteFinalDecisionPreviewDocument(), is(not(nullValue()))); | ||
| return sscsMyaBackendRequests.toBytes(ccdEventResponse.getData().getSscsFinalDecisionCaseData().getWriteFinalDecisionPreviewDocument().getDocumentUrl()); | ||
| } | ||
|
|
||
| private CcdEventResponse getCcdEventResponse(HttpResponse httpResponse) throws IOException { | ||
| String response = EntityUtils.toString(httpResponse.getEntity()); | ||
| return objectMapper.readValue(response, CcdEventResponse.class); | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.