66import static org .mockito .Mockito .times ;
77import static org .mockito .Mockito .verify ;
88import static org .mockito .Mockito .when ;
9+ import static uk .gov .hmcts .reform .iacaseapi .domain .entities .AsylumCaseFieldDefinition .IS_ACCELERATED_DETAINED_APPEAL ;
10+ import static uk .gov .hmcts .reform .iacaseapi .domain .entities .ccd .field .YesOrNo .*;
911
1012import java .util .Optional ;
1113import org .junit .jupiter .api .Test ;
@@ -42,8 +44,8 @@ void should_write_detention_status_to_accelerated() {
4244 when (callback .getCaseDetails ()).thenReturn (caseDetails );
4345 when (caseDetails .getCaseData ()).thenReturn (asylumCase );
4446 when (callback .getEvent ()).thenReturn (Event .START_APPEAL );
45- when (asylumCase .read (AsylumCaseFieldDefinition .APPELLANT_IN_DETENTION , YesOrNo .class )).thenReturn (Optional .of (YesOrNo . YES ));
46- when (asylumCase .read (AsylumCaseFieldDefinition .IS_ACCELERATED_DETAINED_APPEAL , YesOrNo .class )).thenReturn (Optional .of (YesOrNo . YES ));
47+ when (asylumCase .read (AsylumCaseFieldDefinition .APPELLANT_IN_DETENTION , YesOrNo .class )).thenReturn (Optional .of (YES ));
48+ when (asylumCase .read (AsylumCaseFieldDefinition .IS_ACCELERATED_DETAINED_APPEAL , YesOrNo .class )).thenReturn (Optional .of (YES ));
4749
4850 detentionStatusHandler .handle (PreSubmitCallbackStage .ABOUT_TO_SUBMIT , callback );
4951
@@ -57,8 +59,8 @@ void should_write_detention_status_to_detained() {
5759 when (callback .getCaseDetails ()).thenReturn (caseDetails );
5860 when (caseDetails .getCaseData ()).thenReturn (asylumCase );
5961 when (callback .getEvent ()).thenReturn (Event .START_APPEAL );
60- when (asylumCase .read (AsylumCaseFieldDefinition .APPELLANT_IN_DETENTION , YesOrNo .class )).thenReturn (Optional .of (YesOrNo . YES ));
61- when (asylumCase .read (AsylumCaseFieldDefinition .IS_ACCELERATED_DETAINED_APPEAL , YesOrNo .class )).thenReturn (Optional .of (YesOrNo . NO ));
62+ when (asylumCase .read (AsylumCaseFieldDefinition .APPELLANT_IN_DETENTION , YesOrNo .class )).thenReturn (Optional .of (YES ));
63+ when (asylumCase .read (AsylumCaseFieldDefinition .IS_ACCELERATED_DETAINED_APPEAL , YesOrNo .class )).thenReturn (Optional .of (NO ));
6264
6365 detentionStatusHandler .handle (PreSubmitCallbackStage .ABOUT_TO_SUBMIT , callback );
6466
@@ -72,6 +74,7 @@ void should_mark_appeal_as_detained() {
7274 when (callback .getCaseDetails ()).thenReturn (caseDetails );
7375 when (caseDetails .getCaseData ()).thenReturn (asylumCase );
7476 when (callback .getEvent ()).thenReturn (Event .MARK_APPEAL_AS_DETAINED );
77+ when (asylumCase .read (IS_ACCELERATED_DETAINED_APPEAL , YesOrNo .class )).thenReturn (Optional .of (YES ));
7578
7679 detentionStatusHandler .handle (PreSubmitCallbackStage .ABOUT_TO_SUBMIT , callback );
7780
0 commit comments