Skip to content

Commit e693c93

Browse files
resolve conflicts
Signed-off-by: prashanna-frsh <prashanna.rajendran@freshworks.com>
1 parent 62d337e commit e693c93

File tree

1 file changed

+35
-201
lines changed

1 file changed

+35
-201
lines changed

java/jedis-compatibility/src/test/java/redis/clients/jedis/JedisMethodsTest.java

Lines changed: 35 additions & 201 deletions
Original file line numberDiff line numberDiff line change
@@ -292,222 +292,56 @@ public void testFunctionListMethodSignatures() throws NoSuchMethodException {
292292
public void testSetMethodSignatures() throws NoSuchMethodException {
293293
Class<Jedis> jedisClass = Jedis.class;
294294

295-
Method saddString = jedisClass.getMethod("sadd", String.class, String[].class);
296-
assertEquals(long.class, saddString.getReturnType());
295+
Method aclList = jedisClass.getMethod("aclList");
296+
assertEquals(List.class, aclList.getReturnType());
297297

298-
Method saddBinary = jedisClass.getMethod("sadd", byte[].class, byte[][].class);
299-
assertEquals(long.class, saddBinary.getReturnType());
298+
Method aclGetUser = jedisClass.getMethod("aclGetUser", String.class);
299+
assertEquals(AccessControlUser.class, aclGetUser.getReturnType());
300300

301-
Method sremString = jedisClass.getMethod("srem", String.class, String[].class);
302-
assertEquals(long.class, sremString.getReturnType());
301+
Method aclSetUserNoRules = jedisClass.getMethod("aclSetUser", String.class);
302+
assertEquals(String.class, aclSetUserNoRules.getReturnType());
303303

304-
Method sremBinary = jedisClass.getMethod("srem", byte[].class, byte[][].class);
305-
assertEquals(long.class, sremBinary.getReturnType());
304+
Method aclSetUserWithRules = jedisClass.getMethod("aclSetUser", String.class, String[].class);
305+
assertEquals(String.class, aclSetUserWithRules.getReturnType());
306306

307-
Method smembersString = jedisClass.getMethod("smembers", String.class);
308-
assertEquals(Set.class, smembersString.getReturnType());
307+
Method aclDelUser = jedisClass.getMethod("aclDelUser", String[].class);
308+
assertEquals(long.class, aclDelUser.getReturnType());
309309

310-
Method smembersBinary = jedisClass.getMethod("smembers", byte[].class);
311-
assertEquals(Set.class, smembersBinary.getReturnType());
312-
}
313-
314-
@Test
315-
public void saddStringSignatureAndReturnType() throws NoSuchMethodException {
316-
Method m = Jedis.class.getMethod("sadd", String.class, String[].class);
317-
assertEquals(long.class, m.getReturnType());
318-
assertEquals(2, m.getParameterCount());
319-
assertEquals(String.class, m.getParameterTypes()[0]);
320-
assertEquals(String[].class, m.getParameterTypes()[1]);
321-
}
322-
323-
@Test
324-
public void saddBinarySignatureAndReturnType() throws NoSuchMethodException {
325-
Method m = Jedis.class.getMethod("sadd", byte[].class, byte[][].class);
326-
assertEquals(long.class, m.getReturnType());
327-
assertEquals(2, m.getParameterCount());
328-
assertEquals(byte[].class, m.getParameterTypes()[0]);
329-
assertEquals(byte[][].class, m.getParameterTypes()[1]);
330-
}
331-
332-
@Test
333-
public void sremStringSignatureAndReturnType() throws NoSuchMethodException {
334-
Method m = Jedis.class.getMethod("srem", String.class, String[].class);
335-
assertEquals(long.class, m.getReturnType());
336-
assertEquals(2, m.getParameterCount());
337-
assertEquals(String.class, m.getParameterTypes()[0]);
338-
assertEquals(String[].class, m.getParameterTypes()[1]);
339-
}
340-
341-
@Test
342-
public void sremBinarySignatureAndReturnType() throws NoSuchMethodException {
343-
Method m = Jedis.class.getMethod("srem", byte[].class, byte[][].class);
344-
assertEquals(long.class, m.getReturnType());
345-
assertEquals(2, m.getParameterCount());
346-
assertEquals(byte[].class, m.getParameterTypes()[0]);
347-
assertEquals(byte[][].class, m.getParameterTypes()[1]);
348-
}
349-
350-
@Test
351-
public void smembersStringSignatureAndReturnType() throws NoSuchMethodException {
352-
Method m = Jedis.class.getMethod("smembers", String.class);
353-
assertEquals(Set.class, m.getReturnType());
354-
assertEquals(1, m.getParameterCount());
355-
assertEquals(String.class, m.getParameterTypes()[0]);
356-
}
357-
358-
@Test
359-
public void smembersBinarySignatureAndReturnType() throws NoSuchMethodException {
360-
Method m = Jedis.class.getMethod("smembers", byte[].class);
361-
assertEquals(Set.class, m.getReturnType());
362-
assertEquals(1, m.getParameterCount());
363-
assertEquals(byte[].class, m.getParameterTypes()[0]);
364-
}
365-
366-
@Test
367-
public void scardMethodsExist() throws NoSuchMethodException {
368-
assertNotNull(Jedis.class.getMethod("scard", String.class));
369-
assertNotNull(Jedis.class.getMethod("scard", byte[].class));
370-
assertEquals(long.class, Jedis.class.getMethod("scard", String.class).getReturnType());
371-
assertEquals(long.class, Jedis.class.getMethod("scard", byte[].class).getReturnType());
372-
}
373-
374-
@Test
375-
public void sismemberMethodsExist() throws NoSuchMethodException {
376-
assertNotNull(Jedis.class.getMethod("sismember", String.class, String.class));
377-
assertNotNull(Jedis.class.getMethod("sismember", byte[].class, byte[].class));
378-
assertEquals(
379-
boolean.class,
380-
Jedis.class.getMethod("sismember", String.class, String.class).getReturnType());
381-
assertEquals(
382-
boolean.class,
383-
Jedis.class.getMethod("sismember", byte[].class, byte[].class).getReturnType());
384-
}
385-
386-
@Test
387-
public void smismemberMethodsExist() throws NoSuchMethodException {
388-
assertNotNull(Jedis.class.getMethod("smismember", String.class, String[].class));
389-
assertNotNull(Jedis.class.getMethod("smismember", byte[].class, byte[][].class));
390-
assertEquals(
391-
java.util.List.class,
392-
Jedis.class.getMethod("smismember", String.class, String[].class).getReturnType());
393-
assertEquals(
394-
java.util.List.class,
395-
Jedis.class.getMethod("smismember", byte[].class, byte[][].class).getReturnType());
396-
}
310+
Method aclCatNoArg = jedisClass.getMethod("aclCat");
311+
assertEquals(List.class, aclCatNoArg.getReturnType());
397312

398-
@Test
399-
public void spopMethodsExist() throws NoSuchMethodException {
400-
assertNotNull(Jedis.class.getMethod("spop", String.class));
401-
assertNotNull(Jedis.class.getMethod("spop", byte[].class));
402-
assertNotNull(Jedis.class.getMethod("spop", String.class, long.class));
403-
assertNotNull(Jedis.class.getMethod("spop", byte[].class, long.class));
404-
}
313+
Method aclCatCategory = jedisClass.getMethod("aclCat", String.class);
314+
assertEquals(List.class, aclCatCategory.getReturnType());
405315

406-
@Test
407-
public void srandmemberMethodsExist() throws NoSuchMethodException {
408-
assertNotNull(Jedis.class.getMethod("srandmember", String.class));
409-
assertNotNull(Jedis.class.getMethod("srandmember", byte[].class));
410-
assertNotNull(Jedis.class.getMethod("srandmember", String.class, int.class));
411-
assertNotNull(Jedis.class.getMethod("srandmember", byte[].class, int.class));
412-
}
316+
Method aclGenPassNoArg = jedisClass.getMethod("aclGenPass");
317+
assertEquals(String.class, aclGenPassNoArg.getReturnType());
413318

414-
@Test
415-
public void smoveMethodsExist() throws NoSuchMethodException {
416-
assertNotNull(Jedis.class.getMethod("smove", String.class, String.class, String.class));
417-
assertNotNull(Jedis.class.getMethod("smove", byte[].class, byte[].class, byte[].class));
418-
assertEquals(
419-
long.class,
420-
Jedis.class.getMethod("smove", String.class, String.class, String.class).getReturnType());
421-
assertEquals(
422-
long.class,
423-
Jedis.class.getMethod("smove", byte[].class, byte[].class, byte[].class).getReturnType());
424-
}
319+
Method aclGenPassBits = jedisClass.getMethod("aclGenPass", int.class);
320+
assertEquals(String.class, aclGenPassBits.getReturnType());
425321

426-
@Test
427-
public void sinterMethodsExist() throws NoSuchMethodException {
428-
assertNotNull(Jedis.class.getMethod("sinter", String[].class));
429-
assertNotNull(Jedis.class.getMethod("sinter", byte[][].class));
430-
assertEquals(Set.class, Jedis.class.getMethod("sinter", String[].class).getReturnType());
431-
assertEquals(Set.class, Jedis.class.getMethod("sinter", byte[][].class).getReturnType());
432-
}
322+
Method aclLogNoArg = jedisClass.getMethod("aclLog");
323+
assertEquals(List.class, aclLogNoArg.getReturnType());
433324

434-
@Test
435-
public void sunionMethodsExist() throws NoSuchMethodException {
436-
assertNotNull(Jedis.class.getMethod("sunion", String[].class));
437-
assertNotNull(Jedis.class.getMethod("sunion", byte[][].class));
438-
assertEquals(Set.class, Jedis.class.getMethod("sunion", String[].class).getReturnType());
439-
assertEquals(Set.class, Jedis.class.getMethod("sunion", byte[][].class).getReturnType());
440-
}
325+
Method aclLogCount = jedisClass.getMethod("aclLog", int.class);
326+
assertEquals(List.class, aclLogCount.getReturnType());
441327

442-
@Test
443-
public void sdiffMethodsExist() throws NoSuchMethodException {
444-
assertNotNull(Jedis.class.getMethod("sdiff", String[].class));
445-
assertNotNull(Jedis.class.getMethod("sdiff", byte[][].class));
446-
assertEquals(Set.class, Jedis.class.getMethod("sdiff", String[].class).getReturnType());
447-
assertEquals(Set.class, Jedis.class.getMethod("sdiff", byte[][].class).getReturnType());
448-
}
328+
Method aclLogReset = jedisClass.getMethod("aclLogReset");
329+
assertEquals(String.class, aclLogReset.getReturnType());
449330

450-
@Test
451-
public void sintercardMethodsExist() throws NoSuchMethodException {
452-
assertNotNull(Jedis.class.getMethod("sintercard", String[].class));
453-
assertNotNull(Jedis.class.getMethod("sintercard", long.class, String[].class));
454-
assertNotNull(Jedis.class.getMethod("sintercard", byte[][].class));
455-
assertNotNull(Jedis.class.getMethod("sintercard", long.class, byte[][].class));
456-
assertEquals(long.class, Jedis.class.getMethod("sintercard", String[].class).getReturnType());
457-
assertEquals(
458-
long.class,
459-
Jedis.class.getMethod("sintercard", long.class, String[].class).getReturnType());
460-
assertEquals(long.class, Jedis.class.getMethod("sintercard", byte[][].class).getReturnType());
461-
assertEquals(
462-
long.class,
463-
Jedis.class.getMethod("sintercard", long.class, byte[][].class).getReturnType());
464-
}
331+
Method aclWhoAmI = jedisClass.getMethod("aclWhoAmI");
332+
assertEquals(String.class, aclWhoAmI.getReturnType());
465333

466-
@Test
467-
public void sinterstoreMethodsExist() throws NoSuchMethodException {
468-
assertNotNull(Jedis.class.getMethod("sinterstore", String.class, String[].class));
469-
assertNotNull(Jedis.class.getMethod("sinterstore", byte[].class, byte[][].class));
470-
assertEquals(
471-
long.class,
472-
Jedis.class.getMethod("sinterstore", String.class, String[].class).getReturnType());
473-
assertEquals(
474-
long.class,
475-
Jedis.class.getMethod("sinterstore", byte[].class, byte[][].class).getReturnType());
476-
}
334+
Method aclUsers = jedisClass.getMethod("aclUsers");
335+
assertEquals(List.class, aclUsers.getReturnType());
477336

478-
@Test
479-
public void sunionstoreMethodsExist() throws NoSuchMethodException {
480-
assertNotNull(Jedis.class.getMethod("sunionstore", String.class, String[].class));
481-
assertNotNull(Jedis.class.getMethod("sunionstore", byte[].class, byte[][].class));
482-
assertEquals(
483-
long.class,
484-
Jedis.class.getMethod("sunionstore", String.class, String[].class).getReturnType());
485-
assertEquals(
486-
long.class,
487-
Jedis.class.getMethod("sunionstore", byte[].class, byte[][].class).getReturnType());
488-
}
337+
Method aclSave = jedisClass.getMethod("aclSave");
338+
assertEquals(String.class, aclSave.getReturnType());
489339

490-
@Test
491-
public void sdiffstoreMethodsExist() throws NoSuchMethodException {
492-
assertNotNull(Jedis.class.getMethod("sdiffstore", String.class, String[].class));
493-
assertNotNull(Jedis.class.getMethod("sdiffstore", byte[].class, byte[][].class));
494-
assertEquals(
495-
long.class,
496-
Jedis.class.getMethod("sdiffstore", String.class, String[].class).getReturnType());
497-
assertEquals(
498-
long.class,
499-
Jedis.class.getMethod("sdiffstore", byte[].class, byte[][].class).getReturnType());
500-
}
340+
Method aclLoad = jedisClass.getMethod("aclLoad");
341+
assertEquals(String.class, aclLoad.getReturnType());
501342

502-
@Test
503-
public void sscanMethodsExist() throws NoSuchMethodException {
504-
assertNotNull(Jedis.class.getMethod("sscan", String.class, String.class));
505-
assertNotNull(
506-
Jedis.class.getMethod(
507-
"sscan", String.class, String.class, redis.clients.jedis.params.ScanParams.class));
508-
assertNotNull(Jedis.class.getMethod("sscan", byte[].class, byte[].class));
509-
assertNotNull(
510-
Jedis.class.getMethod(
511-
"sscan", byte[].class, byte[].class, redis.clients.jedis.params.ScanParams.class));
343+
Method aclDryRun =
344+
jedisClass.getMethod("aclDryRun", String.class, String.class, String[].class);
345+
assertEquals(String.class, aclDryRun.getReturnType());
512346
}
513347
}

0 commit comments

Comments
 (0)