Skip to content
Open
Show file tree
Hide file tree
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 Feb 20, 2026
be89628
SSCSFT-88 Update decision notices
alibaseit Feb 20, 2026
5211a77
SSCSFT-88 Update final decision sentences
alibaseit Feb 23, 2026
1d131ef
SSCSFT-88 Include other parties in the body of Notice
alibaseit Feb 24, 2026
eb812fd
SSCSFT-88 Add other part details to body of the notice
alibaseit Feb 25, 2026
1f9efd4
SSCSFT-88 Add other part details to body of the notice
alibaseit Feb 25, 2026
f5534f2
SSCSFT-88 Add other part details to body of the notice
alibaseit Feb 25, 2026
34e0cf5
SSCSFT-88 Add other part details to body of the notice
alibaseit Feb 25, 2026
ba1abe7
SSCSFT-88 Add other part details to body of the notice
alibaseit Feb 27, 2026
4a72b0e
SSCSFT-88 Add other part details to body of the notice
alibaseit Feb 27, 2026
c992f88
SSCSFT-88 Add other part details to body of the notice
alibaseit Feb 27, 2026
8e55517
SSCSFT-88 Add other part details to body of the notice
alibaseit Mar 2, 2026
d2bb5fd
SSCSFT-88 Add other part details to body of the notice
alibaseit Mar 2, 2026
00cd2fe
SSCSFT-88 Add other part details to body of the notice
alibaseit Mar 2, 2026
77215c5
SSCSFT-88 Add other part details to body of the notice
alibaseit Mar 3, 2026
67d910f
SSCSFT-88 Add other part details to body of the notice
alibaseit Mar 3, 2026
eae99f7
SSCSFT-88 Add other part details to body of the notice
alibaseit Mar 3, 2026
8ca19b8
SSCSFT-88 Add other part details to body of the notice
alibaseit Mar 3, 2026
4463c13
SSCSFT-88 Add other part details to body of the notice
alibaseit Mar 3, 2026
c5fd7e1
Merge branch 'master' into SSCSFT-88
alibaseit Mar 3, 2026
076d6a1
Trigger Build
alibaseit Mar 3, 2026
f8cd3e0
Trigger Build
alibaseit Mar 3, 2026
35f1717
Trigger Build
alibaseit Mar 4, 2026
19bd67f
Merge branch 'master' into SSCSFT-88
alibaseit Mar 5, 2026
b4178a2
SSCSFT-88 Address comments
alibaseit Mar 6, 2026
59d3a75
SSCSFT-88 Address comments
alibaseit Mar 9, 2026
7c2cac3
SSCSFT-88 Address comments
alibaseit Mar 9, 2026
9a1128d
SSCSFT-88 Address comments
alibaseit Mar 9, 2026
3468d7a
SSCSFT-88 Address comments
alibaseit Mar 9, 2026
fd558a7
SSCSFT-88 Address comments
alibaseit Mar 9, 2026
999945f
Merge branch 'master' into SSCSFT-88
alibaseit Mar 10, 2026
4b15c8b
SSCSFT-88 Address comments
alibaseit Mar 10, 2026
15cc87b
SSCSFT-88 Address comments
alibaseit Mar 10, 2026
9603570
SSCSFT-88 Address comments
alibaseit Mar 10, 2026
6e7dba4
SSCSFT-88 Address comments
alibaseit Mar 10, 2026
14c4a59
Merge branch 'master' into SSCSFT-88
alibaseit Mar 10, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class UcDecisionNoticeFunctionalTest extends BaseFunctionTest {
public final SpringMethodRule smr = new SpringMethodRule();

@Autowired
protected ObjectMapper objectMapper;
private ObjectMapper objectMapper;

// The Scenarios are defined https://tools.hmcts.net/confluence/display/SSCS/ESA+DN+template+content+-+judges+input
@Test
Expand All @@ -58,7 +58,7 @@ public void scenario1_refused_non_support_group_less_than_15pts_sch6_sch8Para4No
assertThat(pdfTextWithoutNewLines, containsString("5. Reasons for decision 1"));
assertThat(pdfTextWithoutNewLines, containsString("6. Reasons for decision 2"));
assertThat(pdfTextWithoutNewLines, containsString("7. Anything else."));
assertThat(pdfTextWithoutNewLines, containsString("8. This has been a remote hearing in the form of a video hearing. Joe Bloggs the appellant attended and the Tribunal considered the appeal bundle to page B7. First Tier Agency representative attended on behalf of the Respondent."));
assertThat(pdfTextWithoutNewLines, containsString("8. This has been a remote hearing in the form of a video hearing. The following people attended: Joe Bloggs the appellant and a representative from the First Tier Agency. The Tribunal considered the appeal bundle to page B7."));
assertThat(pdfTextWithoutNewLines, not(containsString("9.")));
}
}
Expand Down Expand Up @@ -98,7 +98,7 @@ public void scenario3_allowed_isSupportGroup_noSch7_Sch9Para4Applies() throws IO
assertThat(pdfTextWithoutNewLines, containsString("6. The tribunal applied Schedule 9, paragraph 4 because there would be a substantial risk to the mental or physical health of any person if the appellant were found not to have limited capability for work-related activity."));
assertThat(pdfTextWithoutNewLines, containsString("7. Reasons for decision"));
assertThat(pdfTextWithoutNewLines, containsString("8. Anything else"));
assertThat(pdfTextWithoutNewLines, containsString("9. This has been an oral (face to face) hearing. Joe Bloggs the appellant attended the hearing today and the Tribunal considered the appeal bundle to page B7. First Tier Agency representative did not attend."));
assertThat(pdfTextWithoutNewLines, containsString("9. This has been an oral (face to face) hearing. The following people attended: Joe Bloggs the appellant. A representative from the First Tier Agency did not attend. The Tribunal considered the appeal bundle to page B7."));
assertThat(pdfTextWithoutNewLines, containsString("10. Any recommendation given below does not form part of the Tribunal's decision and is not binding on the Secretary of State. The Tribunal recommends that the Department does not reassess Joe Bloggs within 3 months from today's date."));
assertThat(pdfTextWithoutNewLines, not(containsString("11.")));
}
Expand Down Expand Up @@ -142,7 +142,7 @@ public void scenario5_allowed_notSupportGroup_moreThan15Points_noSch7_NoSch9Para
assertThat(pdfTextWithoutNewLines, containsString("15 points"));
assertThat(pdfTextWithoutNewLines, containsString("6. Reasons for decision"));
assertThat(pdfTextWithoutNewLines, containsString("7. Anything else"));
assertThat(pdfTextWithoutNewLines, containsString("8. This has been a remote hearing in the form of a telephone hearing. Joe Bloggs the appellant attended and the Tribunal considered the appeal bundle to page B7. First Tier Agency representative did not attend."));
assertThat(pdfTextWithoutNewLines, containsString("8. This has been a remote hearing in the form of a telephone hearing. The following people attended: Joe Bloggs the appellant. A representative from the First Tier Agency did not attend. The Tribunal considered the appeal bundle to page B7."));
assertThat(pdfTextWithoutNewLines, containsString("9. Any recommendation given below does not form part of the Tribunal's decision and is not binding on the Secretary of State. The Tribunal makes no recommendation as to when the Department should reassess Joe Bloggs."));
assertThat(pdfTextWithoutNewLines, not(containsString("10.")));
}
Expand All @@ -166,7 +166,7 @@ public void scenario12_allowed_notSupportGroup_moreThan15Points_noSch7_Sch9Para4
assertThat(pdfTextWithoutNewLines, containsString("6. The tribunal applied Schedule 9, paragraph 4 because there would be a substantial risk to the mental or physical health of any person if the appellant were found not to have limited capability for work-related activity."));
assertThat(pdfTextWithoutNewLines, containsString("7. Reasons for decision"));
assertThat(pdfTextWithoutNewLines, containsString("8. Anything else"));
assertThat(pdfTextWithoutNewLines, containsString("9. This has been a remote hearing in the form of a telephone hearing. Joe Bloggs the appellant attended and the Tribunal considered the appeal bundle to page B7. First Tier Agency representative did not attend."));
assertThat(pdfTextWithoutNewLines, containsString("9. This has been a remote hearing in the form of a telephone hearing. The following people attended: Joe Bloggs the appellant. A representative from the First Tier Agency did not attend. The Tribunal considered the appeal bundle to page B7."));
assertThat(pdfTextWithoutNewLines, containsString("10. Any recommendation given below does not form part of the Tribunal's decision and is not binding on the Secretary of State. The Tribunal makes no recommendation as to when the Department should reassess Joe Bloggs."));
assertThat(pdfTextWithoutNewLines, not(containsString("11.")));
}
Expand Down Expand Up @@ -262,7 +262,7 @@ public void scenario10_refused_nonWca() throws IOException {
assertThat(pdfTextWithoutNewLines, containsString("4. Reasons for decision 1"));
assertThat(pdfTextWithoutNewLines, containsString("5. Reasons for decision 2"));
assertThat(pdfTextWithoutNewLines, containsString("6. Anything else."));
assertThat(pdfTextWithoutNewLines, containsString("7. This has been a remote hearing in the form of a telephone hearing. Joe Bloggs the appellant attended and the Tribunal considered the appeal bundle to page B7. First Tier Agency representative attended on behalf of the Respondent."));
assertThat(pdfTextWithoutNewLines, containsString("7. This has been a remote hearing in the form of a telephone hearing. The following people attended: Joe Bloggs the appellant, and a representative from the First Tier Agency. The Tribunal considered the appeal bundle to page B7."));
assertThat(pdfTextWithoutNewLines, not(containsString("8.")));
}
}
Expand All @@ -280,7 +280,7 @@ public void scenario11_allowed_nonWcaAppeal() throws IOException {
assertThat(pdfTextWithoutNewLines, containsString("4. Reasons for decision 1"));
assertThat(pdfTextWithoutNewLines, containsString("5. Reasons for decision 2"));
assertThat(pdfTextWithoutNewLines, containsString("6. Anything else."));
assertThat(pdfTextWithoutNewLines, containsString("7. This has been a remote hearing in the form of a telephone hearing. Joe Bloggs the appellant attended and the Tribunal considered the appeal bundle to page B7. First Tier Agency representative attended on behalf of the Respondent."));
assertThat(pdfTextWithoutNewLines, containsString("7. This has been a remote hearing in the form of a telephone hearing. The following people attended: Joe Bloggs the appellant, and a representative from the First Tier Agency. The Tribunal considered the appeal bundle to page B7."));
assertThat(pdfTextWithoutNewLines, not(containsString("8.")));
}
}
Expand Down
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);
}
}
Loading
Loading