Skip to content

Commit 0a69766

Browse files
committed
Format ControlCommandsTest
1 parent c92486f commit 0a69766

File tree

1 file changed

+33
-26
lines changed

1 file changed

+33
-26
lines changed

src/test/java/redis/clients/jedis/commands/jedis/ControlCommandsTest.java

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ public void roleMaster() {
149149
@Test
150150
public void roleSlave() {
151151
EndpointConfig primaryEndpoint = HostAndPorts.getRedisEndpoint("standalone0");
152-
EndpointConfig secondaryEndpoint = HostAndPorts.getRedisEndpoint(
153-
"standalone4-replica-of-standalone1");
152+
EndpointConfig secondaryEndpoint = HostAndPorts
153+
.getRedisEndpoint("standalone4-replica-of-standalone1");
154154

155155
try (Jedis slave = new Jedis(secondaryEndpoint.getHostAndPort(),
156156
secondaryEndpoint.getClientConfigBuilder().build())) {
@@ -227,18 +227,18 @@ public void configGet() {
227227
Map<String, String> info = jedis.configGet("m*");
228228
assertNotNull(info);
229229
assertFalse(info.isEmpty());
230-
// assertTrue(info.size() % 2 == 0);
230+
// assertTrue(info.size() % 2 == 0);
231231
Map<byte[], byte[]> infoBinary = jedis.configGet("m*".getBytes());
232232
assertNotNull(infoBinary);
233233
assertFalse(infoBinary.isEmpty());
234-
// assertTrue(infoBinary.size() % 2 == 0);
234+
// assertTrue(infoBinary.size() % 2 == 0);
235235
}
236236

237237
@Test
238238
public void configSet() {
239239
Map<String, String> info = jedis.configGet("maxmemory");
240-
// assertEquals("maxmemory", info.get(0));
241-
// String memory = info.get(1);
240+
// assertEquals("maxmemory", info.get(0));
241+
// String memory = info.get(1);
242242
String memory = info.get("maxmemory");
243243
assertNotNull(memory);
244244
assertEquals("OK", jedis.configSet("maxmemory", "200"));
@@ -249,8 +249,8 @@ public void configSet() {
249249
public void configSetBinary() {
250250
byte[] maxmemory = SafeEncoder.encode("maxmemory");
251251
Map<byte[], byte[]> info = jedis.configGet(maxmemory);
252-
// assertArrayEquals(maxmemory, info.get(0));
253-
// byte[] memory = info.get(1);
252+
// assertArrayEquals(maxmemory, info.get(0));
253+
// byte[] memory = info.get(1);
254254
byte[] memory = info.get(maxmemory);
255255
assertNotNull(memory);
256256
assertEquals("OK", jedis.configSet(maxmemory, Protocol.toByteArray(200)));
@@ -260,13 +260,15 @@ public void configSetBinary() {
260260
@Test
261261
@SinceRedisVersion(value = "7.0.0", message = "Starting with Redis version 7.0.0: Added the ability to pass multiple pattern parameters in one call")
262262
public void configGetSetMulti() {
263-
String[] params = new String[]{"hash-max-listpack-entries", "set-max-intset-entries", "zset-max-listpack-entries"};
263+
String[] params = new String[] { "hash-max-listpack-entries", "set-max-intset-entries",
264+
"zset-max-listpack-entries" };
264265
Map<String, String> info = jedis.configGet(params);
265266
assertEquals(3, info.size());
266267
assertEquals("OK", jedis.configSet(info));
267268

268-
byte[][] bparams = new byte[][]{SafeEncoder.encode("hash-max-listpack-entries"),
269-
SafeEncoder.encode("set-max-intset-entries"), SafeEncoder.encode("zset-max-listpack-entries")};
269+
byte[][] bparams = new byte[][] { SafeEncoder.encode("hash-max-listpack-entries"),
270+
SafeEncoder.encode("set-max-intset-entries"),
271+
SafeEncoder.encode("zset-max-listpack-entries") };
270272
Map<byte[], byte[]> binfo = jedis.configGet(bparams);
271273
assertEquals(3, binfo.size());
272274
assertEquals("OK", jedis.configSetBinary(binfo));
@@ -430,23 +432,23 @@ public void memoryUsageBinary() {
430432
// Note: It has been recommended not to base MEMORY USAGE test on exact value, as the response
431433
// may subject to be 'tuned' especially targeting a major Redis release.
432434

433-
byte[] bfoo = {0x01, 0x02, 0x03, 0x04};
434-
byte[] bbar = {0x05, 0x06, 0x07, 0x08};
435-
byte[] bfoobar = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
435+
byte[] bfoo = { 0x01, 0x02, 0x03, 0x04 };
436+
byte[] bbar = { 0x05, 0x06, 0x07, 0x08 };
437+
byte[] bfoobar = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 };
436438

437439
jedis.set(bfoo, bbar);
438440
assertThat(jedis.memoryUsage(bfoo), greaterThan(20l));
439441

440-
jedis.lpush(bfoobar, new byte[]{0x01, 0x02}, new byte[]{0x05, 0x06}, new byte[]{0x00});
442+
jedis.lpush(bfoobar, new byte[] { 0x01, 0x02 }, new byte[] { 0x05, 0x06 }, new byte[] { 0x00 });
441443
assertThat(jedis.memoryUsage(bfoobar, 2), greaterThanOrEqualTo(40l));
442444

443445
assertNull(jedis.memoryUsage("roo", 2));
444446
}
445447

446448
@Test
447449
public void memoryPurge() {
448-
String memoryPurge = jedis.memoryPurge();
449-
assertNotNull(memoryPurge);
450+
String memoryPurge = jedis.memoryPurge();
451+
assertNotNull(memoryPurge);
450452
}
451453

452454
@Test
@@ -490,15 +492,16 @@ public void commandDocs() {
490492

491493
CommandDocument sortDoc = docs.get("sort");
492494
assertEquals("generic", sortDoc.getGroup());
493-
MatcherAssert.assertThat(sortDoc.getSummary(), Matchers.isOneOf(
494-
"Sort the elements in a list, set or sorted set",
495+
MatcherAssert.assertThat(sortDoc.getSummary(),
496+
Matchers.isOneOf("Sort the elements in a list, set or sorted set",
495497
"Sorts the elements in a list, a set, or a sorted set, optionally storing the result."));
496498
assertNull(sortDoc.getHistory());
497499

498500
CommandDocument setDoc = docs.get("set");
499501
assertEquals("1.0.0", setDoc.getSince());
500502
assertEquals("O(1)", setDoc.getComplexity());
501-
assertEquals("2.6.12: Added the `EX`, `PX`, `NX` and `XX` options.", setDoc.getHistory().get(0));
503+
assertEquals("2.6.12: Added the `EX`, `PX`, `NX` and `XX` options.",
504+
setDoc.getHistory().get(0));
502505
}
503506

504507
@Test
@@ -507,7 +510,8 @@ public void commandGetKeys() {
507510
List<String> keys = jedis.commandGetKeys("SORT", "mylist", "ALPHA", "STORE", "outlist");
508511
assertEquals(2, keys.size());
509512

510-
List<KeyValue<String, List<String>>> keySandFlags = jedis.commandGetKeysAndFlags("SET", "k1", "v1");
513+
List<KeyValue<String, List<String>>> keySandFlags = jedis.commandGetKeysAndFlags("SET", "k1",
514+
"v1");
511515
assertEquals("k1", keySandFlags.get(0).getKey());
512516
assertEquals(2, keySandFlags.get(0).getValue().size());
513517
}
@@ -582,17 +586,20 @@ public void commandList() {
582586
List<String> commands = jedis.commandList();
583587
assertTrue(commands.size() > 100);
584588

585-
commands = jedis.commandListFilterBy(CommandListFilterByParams.commandListFilterByParams().filterByModule("JSON"));
589+
commands = jedis.commandListFilterBy(
590+
CommandListFilterByParams.commandListFilterByParams().filterByModule("JSON"));
586591
assertEquals(0, commands.size()); // json module was not loaded
587592

588-
commands = jedis.commandListFilterBy(CommandListFilterByParams.commandListFilterByParams().filterByAclCat("admin"));
593+
commands = jedis.commandListFilterBy(
594+
CommandListFilterByParams.commandListFilterByParams().filterByAclCat("admin"));
589595
assertTrue(commands.size() > 10);
590596

591-
commands = jedis.commandListFilterBy(CommandListFilterByParams.commandListFilterByParams().filterByPattern("a*"));
597+
commands = jedis.commandListFilterBy(
598+
CommandListFilterByParams.commandListFilterByParams().filterByPattern("a*"));
592599
assertTrue(commands.size() > 10);
593600

594-
assertThrows(IllegalArgumentException.class, () ->
595-
jedis.commandListFilterBy(CommandListFilterByParams.commandListFilterByParams()));
601+
assertThrows(IllegalArgumentException.class,
602+
() -> jedis.commandListFilterBy(CommandListFilterByParams.commandListFilterByParams()));
596603
}
597604

598605
@Test

0 commit comments

Comments
 (0)