6464public class RediscoveryTest
6565{
6666
67- private static ClusterCompositionResponse .Success Success ( ClusterComposition cluster )
67+ private static ClusterCompositionResponse .Success success ( ClusterComposition cluster )
6868 {
6969 return new ClusterCompositionResponse .Success ( cluster );
7070 }
7171
72- private static ClusterCompositionResponse .Failure Failure ( RuntimeException e )
72+ private static ClusterCompositionResponse .Failure failure ( RuntimeException e )
7373 {
7474 return new ClusterCompositionResponse .Failure ( e );
7575 }
@@ -87,7 +87,7 @@ public void shouldTryConfiguredMaxRoutingFailures() throws Exception
8787
8888 ClusterCompositionProvider mockedProvider = mock ( ClusterCompositionProvider .class );
8989 when ( mockedProvider .getClusterComposition ( any ( Connection .class ) ) )
90- .thenReturn ( Success ( INVALID_CLUSTER_COMPOSITION ) );
90+ .thenReturn ( success ( INVALID_CLUSTER_COMPOSITION ) );
9191
9292 Rediscovery rediscovery = new Rediscovery ( settings , mock ( Clock .class ), DEV_NULL_LOGGER , mockedProvider );
9393
@@ -124,7 +124,7 @@ public void shouldForgetRouterAndTryNextRouterWhenFailedToConnect() throws Throw
124124 ClusterCompositionProvider
125125 mockedProvider = mock ( ClusterCompositionProvider .class );
126126 when ( mockedProvider .getClusterComposition ( healthyConn ) )
127- .thenReturn ( Success ( ClusterCompositionUtil .VALID_CLUSTER_COMPOSITION ) );
127+ .thenReturn ( success ( ClusterCompositionUtil .VALID_CLUSTER_COMPOSITION ) );
128128
129129 // When
130130 ClusterComposition clusterComposition = rediscover ( mockedConnections , routingTable , mockedProvider );
@@ -152,7 +152,7 @@ public void shouldThrowServiceUnavailableWhenNoProcedureFound() throws Throwable
152152 ClusterCompositionProvider
153153 mockedProvider = mock ( ClusterCompositionProvider .class );
154154 when ( mockedProvider .getClusterComposition ( healthyConn ) )
155- .thenReturn ( Failure ( new ServiceUnavailableException ( "No such procedure" ) ) );
155+ .thenReturn ( failure ( new ServiceUnavailableException ( "No such procedure" ) ) );
156156
157157 // When & When
158158 try
@@ -203,9 +203,9 @@ public void shouldTryNextRouterWhenNoWriters() throws Throwable
203203
204204 ClusterCompositionProvider
205205 mockedProvider = mock ( ClusterCompositionProvider .class );
206- when ( mockedProvider .getClusterComposition ( noWriterConn ) ).thenReturn ( Success ( noWriters ) );
206+ when ( mockedProvider .getClusterComposition ( noWriterConn ) ).thenReturn ( success ( noWriters ) );
207207 when ( mockedProvider .getClusterComposition ( healthyConn ) )
208- .thenReturn ( Success ( ClusterCompositionUtil .VALID_CLUSTER_COMPOSITION ) );
208+ .thenReturn ( success ( ClusterCompositionUtil .VALID_CLUSTER_COMPOSITION ) );
209209
210210 // When
211211 ClusterComposition clusterComposition = rediscover ( mockedConnections , routingTable , mockedProvider );
@@ -226,7 +226,7 @@ public void shouldThrowServiceUnavailableWhenNoNextRouter() throws Throwable
226226
227227 ClusterCompositionProvider
228228 mockedProvider = mock ( ClusterCompositionProvider .class );
229- when ( mockedProvider .getClusterComposition ( noWriterConn ) ).thenReturn ( Success ( noWriters ) );
229+ when ( mockedProvider .getClusterComposition ( noWriterConn ) ).thenReturn ( success ( noWriters ) );
230230
231231 // When & THen
232232 try
@@ -278,7 +278,7 @@ public void shouldUpdateRoutingTableWithTheNewOne() throws Throwable
278278
279279 ClusterCompositionProvider
280280 mockedProvider = mock ( ClusterCompositionProvider .class );
281- when ( mockedProvider .getClusterComposition ( healthyConn ) ).thenReturn ( Success ( atLeastOneOfEach ) );
281+ when ( mockedProvider .getClusterComposition ( healthyConn ) ).thenReturn ( success ( atLeastOneOfEach ) );
282282
283283 // When
284284 ClusterComposition clusterComposition = rediscover ( mockedConnections , routingTable , mockedProvider );
@@ -303,7 +303,7 @@ public void shouldProtocolErrorWhenFailedToPaseClusterCompositin() throws Throwa
303303
304304 ClusterCompositionProvider mockedProvider = mock ( ClusterCompositionProvider .class );
305305 ProtocolException exception = new ProtocolException ( "Failed to parse result" );
306- when ( mockedProvider .getClusterComposition ( healthyConn ) ).thenReturn ( Failure ( exception ) );
306+ when ( mockedProvider .getClusterComposition ( healthyConn ) ).thenReturn ( failure ( exception ) );
307307
308308 // When & When
309309 try
0 commit comments