@@ -302,7 +302,7 @@ void getControlBlocksForMatchingFCDA_should_return_expected_Items(LN0 ln0, TServ
302302 List <ControlBlock > controlBlocks = ln0Adapter .getControlBlocksForMatchingFCDA (extRefInfo ).toList ();
303303 // Then
304304 assertThat (controlBlocks ).hasSize (1 );
305- assertThat (controlBlocks .get ( 0 ).getServiceType ()).isEqualTo (serviceType );
305+ assertThat (controlBlocks .getFirst ( ).getServiceType ()).isEqualTo (serviceType );
306306 }
307307
308308 private static Stream <Arguments > provideServiceType () {
@@ -335,7 +335,7 @@ void getDOIAdapters_should_return_expected_list_of_DOIAdapter() {
335335 LN0Adapter ln0Adapter = new LN0Adapter (null , ln0 );
336336 // When Then
337337 assertThat (ln0Adapter .getDOIAdapters ()).isNotEmpty ();
338- assertThat (ln0Adapter .getDOIAdapters ().get ( 0 ).getCurrentElem ().getName ()).isEqualTo ("Do" );
338+ assertThat (ln0Adapter .getDOIAdapters ().getFirst ( ).getCurrentElem ().getName ()).isEqualTo ("Do" );
339339 }
340340
341341 @ Test
@@ -434,7 +434,7 @@ void testFindMatch() {
434434 // When Then
435435 AbstractDAIAdapter <?> daiAdapter = (AbstractDAIAdapter <?>) assertDoesNotThrow (() -> ln0Adapter .findMatch (doTypeName , daTypeName ).get ());
436436 assertThat (daiAdapter .getCurrentElem ().getName ()).isEqualTo ("bda3" );
437- assertThat (daiAdapter .getCurrentElem ().getVal ().get ( 0 ).getValue ()).isEqualTo ("Completed-diff" );
437+ assertThat (daiAdapter .getCurrentElem ().getVal ().getFirst ( ).getValue ()).isEqualTo ("Completed-diff" );
438438 DoTypeName doTypeName2 = new DoTypeName ("Do.sdo1" );
439439 // When Then
440440 assertThat (ln0Adapter .findMatch (doTypeName2 , daTypeName )).isEmpty ();
@@ -540,7 +540,7 @@ void testGetDAI() {
540540 var dataAttributeRefs = ln0Adapter .getDAI (filter , false );
541541 // Then
542542 assertThat (dataAttributeRefs ).hasSize (1 );
543- assertThat (dataAttributeRefs .get ( 0 ).getDaName ().getType ()).isEqualTo ("BehaviourModeKind" );
543+ assertThat (dataAttributeRefs .getFirst ( ).getDaName ().getType ()).isEqualTo ("BehaviourModeKind" );
544544 }
545545
546546 @ Test
@@ -864,7 +864,7 @@ void createControlBlockIfNotExists_should_create_SampledValueControl() {
864864 // Then
865865 assertThat (sourceLn0 .getCurrentElem ().getSampledValueControl ())
866866 .hasSize (1 );
867- TSampledValueControl tSampledValueControl = sourceLn0 .getCurrentElem ().getSampledValueControl ().get ( 0 );
867+ TSampledValueControl tSampledValueControl = sourceLn0 .getCurrentElem ().getSampledValueControl ().getFirst ( );
868868 assertThat (tSampledValueControl )
869869 .extracting (TControl ::getName , TSampledValueControl ::getSmvID , TControl ::getDatSet ,
870870 TSampledValueControl ::isMulticast , TSampledValueControl ::getSmpRate , TSampledValueControl ::getNofASDU , TSampledValueControl ::getSmpMod , TSampledValueControl ::getSecurityEnable ,
@@ -895,7 +895,7 @@ void createControlBlockIfNotExists_should_create_ReportControl() {
895895 // Then
896896 assertThat (sourceLn0 .getCurrentElem ().getReportControl ())
897897 .hasSize (1 );
898- TReportControl tReportControl = sourceLn0 .getCurrentElem ().getReportControl ().get ( 0 );
898+ TReportControl tReportControl = sourceLn0 .getCurrentElem ().getReportControl ().getFirst ( );
899899 assertThat (tReportControl )
900900 .extracting (TControl ::getName , TReportControl ::getRptID , TControl ::getDatSet ,
901901 TReportControl ::isBuffered , TReportControl ::getBufTime , TReportControl ::isIndexed , TControlWithTriggerOpt ::getIntgPd , TReportControl ::getConfRev )
@@ -1140,6 +1140,42 @@ void updateDoInRef_when_ExtRef_desc_matches_should_update_setSrcRef_and_setSrcCB
11401140 assertThat (sclReportItems ).isEmpty ();
11411141 }
11421142
1143+ @ Test
1144+ void updateDoInRef_when_DAI_purpose_of_Ldevice_LDEPF_ends_with_BOOLEAN_should_match_desc_that_ends_with_enum_and_update_setSrcRef_and_setSrcCB_and_setTstRef_and_setTstCB () {
1145+ // Given
1146+ SCL scd = SclTestMarshaller .getSCLFromFile ("/scd-test-update-inref/scd_update_inref_test.xml" );
1147+ LN0Adapter sourceLn0 = findLn0 (scd , "IED_NAME1" , "LDEPF" );
1148+ String doiNameInRef = "InRef3" ;
1149+ String originalSetSrcCB = getDaiValue (sourceLn0 , doiNameInRef , SETSRCCB_DA_NAME );
1150+ String expectedSrcRef = "IED_NAME1LDEPF/PRANCR1.Do11.sdo11" ;
1151+ String expectedSrcCb = "IED_NAME1LDEPF/prefixANCR1.GSE1" ;
1152+ String originalSetTstCB = getDaiValue (sourceLn0 , doiNameInRef , SETTSTCB_DA_NAME );
1153+ String expectedTstRef = "IED_NAME1LDEPF/PRANCR1.Do11.sdo11" ;
1154+ String expectedTstCB = "IED_NAME1LDEPF/prefixANCR3.GSE3" ;
1155+
1156+ // When
1157+ List <SclReportItem > sclReportItems = sourceLn0 .updateDoInRef ();
1158+ // Then
1159+
1160+ String finalSetSrcRef = getDaiValue (sourceLn0 , doiNameInRef , SETSRCREF_DA_NAME );
1161+ String finalSetSrcCB = getDaiValue (sourceLn0 , doiNameInRef , SETSRCCB_DA_NAME );
1162+ String finalSetTstRef = getDaiValue (sourceLn0 , doiNameInRef , SETTSTREF_DA_NAME );
1163+ String finalSetTstCB = getDaiValue (sourceLn0 , doiNameInRef , SETTSTCB_DA_NAME );
1164+ assertThat (finalSetSrcRef )
1165+ .isNotBlank ()
1166+ .isEqualTo (expectedSrcRef );
1167+ assertThat (finalSetSrcCB )
1168+ .isNotEqualTo (originalSetSrcCB )
1169+ .isEqualTo (expectedSrcCb );
1170+ assertThat (finalSetTstRef )
1171+ .isNotBlank ()
1172+ .isEqualTo (expectedTstRef );
1173+ assertThat (finalSetTstCB )
1174+ .isNotEqualTo (originalSetTstCB )
1175+ .isEqualTo (expectedTstCB );
1176+ assertThat (sclReportItems ).isEmpty ();
1177+ }
1178+
11431179 @ Test
11441180 void updateDoInRef_when_ExtRef_desc_matches_and_dais_not_updatable_should_not_update_setSrcRef_and_setSrcCB_and_setTstRef_and_setTstCB () {
11451181 // Given
0 commit comments