Skip to content

Commit 61bd841

Browse files
committed
format
1 parent 5dd1ec0 commit 61bd841

File tree

3 files changed

+18
-30
lines changed

3 files changed

+18
-30
lines changed

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@
340340
<include>src/main/java/redis/clients/jedis/annots/*.java</include>
341341
<include>src/main/java/redis/clients/jedis/mcf/*.java</include>
342342
<include>src/test/java/redis/clients/jedis/failover/*.java</include>
343+
<include>src/test/java/redis/clients/jedis/mcf/*.java</include>
343344
<include>src/test/java/redis/clients/jedis/misc/AutomaticFailoverTest.java</include>
344345
<include>src/main/java/redis/clients/jedis/providers/MultiClusterPooledConnectionProvider.java</include>
345346
<include>src/main/java/redis/clients/jedis/MultiClusterClientConfig.java</include>

src/test/java/redis/clients/jedis/mcf/HealthCheckIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private MultiClusterPooledConnectionProvider getMCCF(MultiClusterClientConfig.St
9393
Function<ClusterConfig.Builder, ClusterConfig.Builder> modifier = builder -> strategySupplier == null
9494
? builder.healthCheckEnabled(false)
9595
: builder.healthCheckStrategySupplier(strategySupplier);
96-
96+
9797
List<ClusterConfig> clusterConfigs = Arrays
9898
.stream(new EndpointConfig[] { endpoint1 }).map(e -> modifier
9999
.apply(MultiClusterClientConfig.ClusterConfig.builder(e.getHostAndPort(), clientConfig)).build())

src/test/java/redis/clients/jedis/mcf/HealthCheckTest.java

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -275,14 +275,11 @@ void testEchoStrategyDefaultSupplier() {
275275
void testNewFieldLocations() {
276276
// Test new field locations in ClusterConfig and MultiClusterClientConfig
277277
MultiClusterClientConfig.ClusterConfig clusterConfig = MultiClusterClientConfig.ClusterConfig
278-
.builder(testEndpoint, testConfig)
279-
.weight(2.5f)
280-
.build();
278+
.builder(testEndpoint, testConfig).weight(2.5f).build();
281279

282-
MultiClusterClientConfig multiConfig = new MultiClusterClientConfig.Builder(new MultiClusterClientConfig.ClusterConfig[]{clusterConfig})
283-
.retryOnFailover(true)
284-
.failbackSupported(false)
285-
.build();
280+
MultiClusterClientConfig multiConfig = new MultiClusterClientConfig.Builder(
281+
new MultiClusterClientConfig.ClusterConfig[] { clusterConfig }).retryOnFailover(true)
282+
.failbackSupported(false).build();
286283

287284
assertEquals(2.5f, clusterConfig.getWeight());
288285
assertTrue(multiConfig.isRetryOnFailover());
@@ -293,15 +290,15 @@ void testNewFieldLocations() {
293290
void testDefaultValues() {
294291
// Test default values in ClusterConfig
295292
MultiClusterClientConfig.ClusterConfig clusterConfig = MultiClusterClientConfig.ClusterConfig
296-
.builder(testEndpoint, testConfig)
297-
.build();
293+
.builder(testEndpoint, testConfig).build();
298294

299295
assertEquals(1.0f, clusterConfig.getWeight()); // Default weight
300-
assertEquals(EchoStrategy.DEFAULT, clusterConfig.getHealthCheckStrategySupplier()); // Default is null (no health check)
296+
assertEquals(EchoStrategy.DEFAULT, clusterConfig.getHealthCheckStrategySupplier()); // Default is null (no
297+
// health check)
301298

302299
// Test default values in MultiClusterClientConfig
303-
MultiClusterClientConfig multiConfig = new MultiClusterClientConfig.Builder(new MultiClusterClientConfig.ClusterConfig[]{clusterConfig})
304-
.build();
300+
MultiClusterClientConfig multiConfig = new MultiClusterClientConfig.Builder(
301+
new MultiClusterClientConfig.ClusterConfig[] { clusterConfig }).build();
305302

306303
assertFalse(multiConfig.isRetryOnFailover()); // Default is false
307304
assertTrue(multiConfig.isFailbackSupported()); // Default is true
@@ -314,9 +311,7 @@ void testClusterConfigWithHealthCheckStrategy() {
314311
MultiClusterClientConfig.StrategySupplier supplier = (hostAndPort, jedisClientConfig) -> customStrategy;
315312

316313
MultiClusterClientConfig.ClusterConfig clusterConfig = MultiClusterClientConfig.ClusterConfig
317-
.builder(testEndpoint, testConfig)
318-
.healthCheckStrategySupplier(supplier)
319-
.build();
314+
.builder(testEndpoint, testConfig).healthCheckStrategySupplier(supplier).build();
320315

321316
assertNotNull(clusterConfig.getHealthCheckStrategySupplier());
322317
HealthCheckStrategy result = clusterConfig.getHealthCheckStrategySupplier().get(testEndpoint, testConfig);
@@ -330,9 +325,7 @@ void testClusterConfigWithStrategySupplier() {
330325
};
331326

332327
MultiClusterClientConfig.ClusterConfig clusterConfig = MultiClusterClientConfig.ClusterConfig
333-
.builder(testEndpoint, testConfig)
334-
.healthCheckStrategySupplier(customSupplier)
335-
.build();
328+
.builder(testEndpoint, testConfig).healthCheckStrategySupplier(customSupplier).build();
336329

337330
assertEquals(customSupplier, clusterConfig.getHealthCheckStrategySupplier());
338331
}
@@ -344,9 +337,7 @@ void testClusterConfigWithEchoStrategy() {
344337
};
345338

346339
MultiClusterClientConfig.ClusterConfig clusterConfig = MultiClusterClientConfig.ClusterConfig
347-
.builder(testEndpoint, testConfig)
348-
.healthCheckStrategySupplier(echoSupplier)
349-
.build();
340+
.builder(testEndpoint, testConfig).healthCheckStrategySupplier(echoSupplier).build();
350341

351342
MultiClusterClientConfig.StrategySupplier supplier = clusterConfig.getHealthCheckStrategySupplier();
352343
assertNotNull(supplier);
@@ -356,8 +347,7 @@ void testClusterConfigWithEchoStrategy() {
356347
@Test
357348
void testClusterConfigWithDefaultHealthCheck() {
358349
MultiClusterClientConfig.ClusterConfig clusterConfig = MultiClusterClientConfig.ClusterConfig
359-
.builder(testEndpoint, testConfig)
360-
.build(); // Should use default EchoStrategy
350+
.builder(testEndpoint, testConfig).build(); // Should use default EchoStrategy
361351

362352
assertNotNull(clusterConfig.getHealthCheckStrategySupplier());
363353
assertEquals(EchoStrategy.DEFAULT, clusterConfig.getHealthCheckStrategySupplier());
@@ -366,19 +356,15 @@ void testClusterConfigWithDefaultHealthCheck() {
366356
@Test
367357
void testClusterConfigWithDisabledHealthCheck() {
368358
MultiClusterClientConfig.ClusterConfig clusterConfig = MultiClusterClientConfig.ClusterConfig
369-
.builder(testEndpoint, testConfig)
370-
.healthCheckEnabled(false)
371-
.build();
359+
.builder(testEndpoint, testConfig).healthCheckEnabled(false).build();
372360

373361
assertNull(clusterConfig.getHealthCheckStrategySupplier());
374362
}
375363

376364
@Test
377365
void testClusterConfigHealthCheckEnabledExplicitly() {
378366
MultiClusterClientConfig.ClusterConfig clusterConfig = MultiClusterClientConfig.ClusterConfig
379-
.builder(testEndpoint, testConfig)
380-
.healthCheckEnabled(true)
381-
.build();
367+
.builder(testEndpoint, testConfig).healthCheckEnabled(true).build();
382368

383369
assertNotNull(clusterConfig.getHealthCheckStrategySupplier());
384370
assertEquals(EchoStrategy.DEFAULT, clusterConfig.getHealthCheckStrategySupplier());
@@ -391,6 +377,7 @@ void testHealthCheckRecoversAfterException() throws InterruptedException {
391377
// Create a mock strategy that alternates between healthy and throwing an exception
392378
HealthCheckStrategy alternatingStrategy = new HealthCheckStrategy() {
393379
volatile boolean isHealthy = true;
380+
394381
@Override
395382
public int getInterval() {
396383
return 1;

0 commit comments

Comments
 (0)