@@ -616,7 +616,7 @@ void testConnectionTask_higherPriorityConnectionExists_withForce() {
616616
617617 assertThat (activeConnectionRef ).hasValue (newConnection );
618618
619- verify (activeConnection ).getNodeConfig ();
619+ verify (activeConnection , times ( 2 ) ).getNodeConfig ();
620620 verify (activeConnection ).close (true );
621621 verify (newConnection , times (2 )).getNodeConfig ();
622622 verify (newConnection ).createRequestPipeline ();
@@ -625,7 +625,6 @@ void testConnectionTask_higherPriorityConnectionExists_withForce() {
625625
626626 verifyNoMoreInteractions (activeConnection );
627627 verifyNoMoreInteractions (newConnection );
628- verifyNoInteractions (executorService );
629628 verifyNoMoreInteractions (bufferService );
630629 verifyNoMoreInteractions (metrics );
631630 }
@@ -832,8 +831,6 @@ void testConnectionTask_reschedule_failure() {
832831
833832 task .run ();
834833
835- assertThat (connections ).isEmpty (); // connection should be removed
836-
837834 verify (connection ).createRequestPipeline ();
838835 verify (executorService ).schedule (eq (task ), anyLong (), eq (TimeUnit .MILLISECONDS ));
839836 verify (connection , atLeast (1 )).getNodeConfig ();
@@ -920,40 +917,6 @@ void testConstructor_configFileNotFound() {
920917 assertThat (availableNodes ).isEmpty ();
921918 }
922919
923- @ Test
924- void testRestartConnection () {
925- final BlockNodeConnection connection = mock (BlockNodeConnection .class );
926- final BlockNodeConfig nodeConfig = newBlockNodeConfig (PBJ_UNIT_TEST_HOST , 8080 , 1 );
927- doReturn (nodeConfig ).when (connection ).getNodeConfig ();
928-
929- // Add the connection to the connections map and set it as active
930- final Map <BlockNodeConfig , BlockNodeConnection > connections = connections ();
931- final AtomicReference <BlockNodeConnection > activeConnectionRef = activeConnection ();
932- connections .put (nodeConfig , connection );
933- activeConnectionRef .set (connection );
934-
935- // Ensure the node config is available for selection
936- final List <BlockNodeConfig > availableNodes = availableNodes ();
937- availableNodes .clear ();
938- availableNodes .add (nodeConfig );
939-
940- connectionManager .connectionResetsTheStream (connection );
941-
942- // Verify the active connection reference was cleared
943- assertThat (activeConnectionRef ).hasNullValue ();
944- // Verify a new connection was created and added to the connections map
945- assertThat (connections ).containsKey (nodeConfig );
946- // Verify it's a different connection object (the old one was replaced)
947- assertThat (connections .get (nodeConfig )).isNotSameAs (connection );
948-
949- // Verify that scheduleConnectionAttempt was called with Duration.ZERO and the block number
950- verify (executorService ).schedule (any (BlockNodeConnectionTask .class ), eq (0L ), eq (TimeUnit .MILLISECONDS ));
951- verifyNoMoreInteractions (connection );
952- verifyNoInteractions (bufferService );
953- verifyNoInteractions (metrics );
954- verifyNoMoreInteractions (executorService );
955- }
956-
957920 @ Test
958921 void testRescheduleConnection_singleBlockNode () {
959922 // selectNewBlockNodeForStreaming should NOT be called
@@ -987,19 +950,6 @@ void testRescheduleConnection_singleBlockNode() {
987950 .schedule (any (BlockNodeConnectionTask .class ), eq (5000L ), eq (TimeUnit .MILLISECONDS ));
988951 }
989952
990- @ Test
991- void testConnectionResetsTheStream_streamingDisabled () {
992- useStreamingDisabledManager ();
993- final BlockNodeConnection connection = mock (BlockNodeConnection .class );
994-
995- connectionManager .connectionResetsTheStream (connection );
996-
997- verifyNoInteractions (connection );
998- verifyNoInteractions (bufferService );
999- verifyNoInteractions (executorService );
1000- verifyNoInteractions (metrics );
1001- }
1002-
1003953 @ Test
1004954 void testStart_streamingDisabled () {
1005955 useStreamingDisabledManager ();
@@ -1096,36 +1046,6 @@ void testRecordEndOfStreamAndCheckLimit_streamingDisabled() {
10961046 assertThat (limitExceeded ).isFalse ();
10971047 }
10981048
1099- @ Test
1100- void testConnectionResetsTheStream () {
1101- final BlockNodeConnection connection = mock (BlockNodeConnection .class );
1102- final BlockNodeConfig nodeConfig = newBlockNodeConfig (8080 , 1 );
1103- doReturn (nodeConfig ).when (connection ).getNodeConfig ();
1104- availableNodes ().add (nodeConfig );
1105-
1106- // Add the connection to the connections map and set it as active
1107- final Map <BlockNodeConfig , BlockNodeConnection > connections = connections ();
1108- final AtomicReference <BlockNodeConnection > activeConnectionRef = activeConnection ();
1109- connections .put (nodeConfig , connection );
1110- activeConnectionRef .set (connection );
1111-
1112- connectionManager .connectionResetsTheStream (connection );
1113-
1114- // Verify the active connection reference was cleared
1115- assertThat (activeConnectionRef ).hasNullValue ();
1116- // Verify a new connection was created and added to the connections map
1117- assertThat (connections ).containsKey (nodeConfig );
1118- // Verify it's a different connection object (the old one was replaced)
1119- assertThat (connections .get (nodeConfig )).isNotSameAs (connection );
1120-
1121- // Verify that selectNewBlockNodeForStreaming was called
1122- verify (executorService ).schedule (any (BlockNodeConnectionTask .class ), eq (0L ), eq (TimeUnit .MILLISECONDS ));
1123- verifyNoMoreInteractions (connection );
1124- verifyNoInteractions (bufferService );
1125- verifyNoInteractions (metrics );
1126- verifyNoMoreInteractions (executorService );
1127- }
1128-
11291049 @ Test
11301050 void testRecordEndOfStreamAndCheckLimit_withinLimit () {
11311051 final BlockNodeConfig nodeConfig = newBlockNodeConfig (PBJ_UNIT_TEST_HOST , 8080 , 1 );
0 commit comments