Skip to content

Commit f8a522a

Browse files
resolve conflicts
Signed-off-by: prashanna-frsh <prashanna.rajendran@freshworks.com>
1 parent 4fa9acc commit f8a522a

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
@@ -186,222 +186,56 @@ public void testAclMethodSignatures() throws NoSuchMethodException {
186186
public void testSetMethodSignatures() throws NoSuchMethodException {
187187
Class<Jedis> jedisClass = Jedis.class;
188188

189-
Method saddString = jedisClass.getMethod("sadd", String.class, String[].class);
190-
assertEquals(long.class, saddString.getReturnType());
191-
192-
Method saddBinary = jedisClass.getMethod("sadd", byte[].class, byte[][].class);
193-
assertEquals(long.class, saddBinary.getReturnType());
194-
195-
Method sremString = jedisClass.getMethod("srem", String.class, String[].class);
196-
assertEquals(long.class, sremString.getReturnType());
197-
198-
Method sremBinary = jedisClass.getMethod("srem", byte[].class, byte[][].class);
199-
assertEquals(long.class, sremBinary.getReturnType());
200-
201-
Method smembersString = jedisClass.getMethod("smembers", String.class);
202-
assertEquals(Set.class, smembersString.getReturnType());
203-
204-
Method smembersBinary = jedisClass.getMethod("smembers", byte[].class);
205-
assertEquals(Set.class, smembersBinary.getReturnType());
206-
}
207-
208-
@Test
209-
public void saddStringSignatureAndReturnType() throws NoSuchMethodException {
210-
Method m = Jedis.class.getMethod("sadd", String.class, String[].class);
211-
assertEquals(long.class, m.getReturnType());
212-
assertEquals(2, m.getParameterCount());
213-
assertEquals(String.class, m.getParameterTypes()[0]);
214-
assertEquals(String[].class, m.getParameterTypes()[1]);
215-
}
216-
217-
@Test
218-
public void saddBinarySignatureAndReturnType() throws NoSuchMethodException {
219-
Method m = Jedis.class.getMethod("sadd", byte[].class, byte[][].class);
220-
assertEquals(long.class, m.getReturnType());
221-
assertEquals(2, m.getParameterCount());
222-
assertEquals(byte[].class, m.getParameterTypes()[0]);
223-
assertEquals(byte[][].class, m.getParameterTypes()[1]);
224-
}
225-
226-
@Test
227-
public void sremStringSignatureAndReturnType() throws NoSuchMethodException {
228-
Method m = Jedis.class.getMethod("srem", String.class, String[].class);
229-
assertEquals(long.class, m.getReturnType());
230-
assertEquals(2, m.getParameterCount());
231-
assertEquals(String.class, m.getParameterTypes()[0]);
232-
assertEquals(String[].class, m.getParameterTypes()[1]);
233-
}
234-
235-
@Test
236-
public void sremBinarySignatureAndReturnType() throws NoSuchMethodException {
237-
Method m = Jedis.class.getMethod("srem", byte[].class, byte[][].class);
238-
assertEquals(long.class, m.getReturnType());
239-
assertEquals(2, m.getParameterCount());
240-
assertEquals(byte[].class, m.getParameterTypes()[0]);
241-
assertEquals(byte[][].class, m.getParameterTypes()[1]);
242-
}
189+
Method aclList = jedisClass.getMethod("aclList");
190+
assertEquals(List.class, aclList.getReturnType());
243191

244-
@Test
245-
public void smembersStringSignatureAndReturnType() throws NoSuchMethodException {
246-
Method m = Jedis.class.getMethod("smembers", String.class);
247-
assertEquals(Set.class, m.getReturnType());
248-
assertEquals(1, m.getParameterCount());
249-
assertEquals(String.class, m.getParameterTypes()[0]);
250-
}
192+
Method aclGetUser = jedisClass.getMethod("aclGetUser", String.class);
193+
assertEquals(AccessControlUser.class, aclGetUser.getReturnType());
251194

252-
@Test
253-
public void smembersBinarySignatureAndReturnType() throws NoSuchMethodException {
254-
Method m = Jedis.class.getMethod("smembers", byte[].class);
255-
assertEquals(Set.class, m.getReturnType());
256-
assertEquals(1, m.getParameterCount());
257-
assertEquals(byte[].class, m.getParameterTypes()[0]);
258-
}
195+
Method aclSetUserNoRules = jedisClass.getMethod("aclSetUser", String.class);
196+
assertEquals(String.class, aclSetUserNoRules.getReturnType());
259197

260-
@Test
261-
public void scardMethodsExist() throws NoSuchMethodException {
262-
assertNotNull(Jedis.class.getMethod("scard", String.class));
263-
assertNotNull(Jedis.class.getMethod("scard", byte[].class));
264-
assertEquals(long.class, Jedis.class.getMethod("scard", String.class).getReturnType());
265-
assertEquals(long.class, Jedis.class.getMethod("scard", byte[].class).getReturnType());
266-
}
198+
Method aclSetUserWithRules = jedisClass.getMethod("aclSetUser", String.class, String[].class);
199+
assertEquals(String.class, aclSetUserWithRules.getReturnType());
267200

268-
@Test
269-
public void sismemberMethodsExist() throws NoSuchMethodException {
270-
assertNotNull(Jedis.class.getMethod("sismember", String.class, String.class));
271-
assertNotNull(Jedis.class.getMethod("sismember", byte[].class, byte[].class));
272-
assertEquals(
273-
boolean.class,
274-
Jedis.class.getMethod("sismember", String.class, String.class).getReturnType());
275-
assertEquals(
276-
boolean.class,
277-
Jedis.class.getMethod("sismember", byte[].class, byte[].class).getReturnType());
278-
}
201+
Method aclDelUser = jedisClass.getMethod("aclDelUser", String[].class);
202+
assertEquals(long.class, aclDelUser.getReturnType());
279203

280-
@Test
281-
public void smismemberMethodsExist() throws NoSuchMethodException {
282-
assertNotNull(Jedis.class.getMethod("smismember", String.class, String[].class));
283-
assertNotNull(Jedis.class.getMethod("smismember", byte[].class, byte[][].class));
284-
assertEquals(
285-
java.util.List.class,
286-
Jedis.class.getMethod("smismember", String.class, String[].class).getReturnType());
287-
assertEquals(
288-
java.util.List.class,
289-
Jedis.class.getMethod("smismember", byte[].class, byte[][].class).getReturnType());
290-
}
204+
Method aclCatNoArg = jedisClass.getMethod("aclCat");
205+
assertEquals(List.class, aclCatNoArg.getReturnType());
291206

292-
@Test
293-
public void spopMethodsExist() throws NoSuchMethodException {
294-
assertNotNull(Jedis.class.getMethod("spop", String.class));
295-
assertNotNull(Jedis.class.getMethod("spop", byte[].class));
296-
assertNotNull(Jedis.class.getMethod("spop", String.class, long.class));
297-
assertNotNull(Jedis.class.getMethod("spop", byte[].class, long.class));
298-
}
207+
Method aclCatCategory = jedisClass.getMethod("aclCat", String.class);
208+
assertEquals(List.class, aclCatCategory.getReturnType());
299209

300-
@Test
301-
public void srandmemberMethodsExist() throws NoSuchMethodException {
302-
assertNotNull(Jedis.class.getMethod("srandmember", String.class));
303-
assertNotNull(Jedis.class.getMethod("srandmember", byte[].class));
304-
assertNotNull(Jedis.class.getMethod("srandmember", String.class, int.class));
305-
assertNotNull(Jedis.class.getMethod("srandmember", byte[].class, int.class));
306-
}
210+
Method aclGenPassNoArg = jedisClass.getMethod("aclGenPass");
211+
assertEquals(String.class, aclGenPassNoArg.getReturnType());
307212

308-
@Test
309-
public void smoveMethodsExist() throws NoSuchMethodException {
310-
assertNotNull(Jedis.class.getMethod("smove", String.class, String.class, String.class));
311-
assertNotNull(Jedis.class.getMethod("smove", byte[].class, byte[].class, byte[].class));
312-
assertEquals(
313-
long.class,
314-
Jedis.class.getMethod("smove", String.class, String.class, String.class).getReturnType());
315-
assertEquals(
316-
long.class,
317-
Jedis.class.getMethod("smove", byte[].class, byte[].class, byte[].class).getReturnType());
318-
}
213+
Method aclGenPassBits = jedisClass.getMethod("aclGenPass", int.class);
214+
assertEquals(String.class, aclGenPassBits.getReturnType());
319215

320-
@Test
321-
public void sinterMethodsExist() throws NoSuchMethodException {
322-
assertNotNull(Jedis.class.getMethod("sinter", String[].class));
323-
assertNotNull(Jedis.class.getMethod("sinter", byte[][].class));
324-
assertEquals(Set.class, Jedis.class.getMethod("sinter", String[].class).getReturnType());
325-
assertEquals(Set.class, Jedis.class.getMethod("sinter", byte[][].class).getReturnType());
326-
}
216+
Method aclLogNoArg = jedisClass.getMethod("aclLog");
217+
assertEquals(List.class, aclLogNoArg.getReturnType());
327218

328-
@Test
329-
public void sunionMethodsExist() throws NoSuchMethodException {
330-
assertNotNull(Jedis.class.getMethod("sunion", String[].class));
331-
assertNotNull(Jedis.class.getMethod("sunion", byte[][].class));
332-
assertEquals(Set.class, Jedis.class.getMethod("sunion", String[].class).getReturnType());
333-
assertEquals(Set.class, Jedis.class.getMethod("sunion", byte[][].class).getReturnType());
334-
}
219+
Method aclLogCount = jedisClass.getMethod("aclLog", int.class);
220+
assertEquals(List.class, aclLogCount.getReturnType());
335221

336-
@Test
337-
public void sdiffMethodsExist() throws NoSuchMethodException {
338-
assertNotNull(Jedis.class.getMethod("sdiff", String[].class));
339-
assertNotNull(Jedis.class.getMethod("sdiff", byte[][].class));
340-
assertEquals(Set.class, Jedis.class.getMethod("sdiff", String[].class).getReturnType());
341-
assertEquals(Set.class, Jedis.class.getMethod("sdiff", byte[][].class).getReturnType());
342-
}
222+
Method aclLogReset = jedisClass.getMethod("aclLogReset");
223+
assertEquals(String.class, aclLogReset.getReturnType());
343224

344-
@Test
345-
public void sintercardMethodsExist() throws NoSuchMethodException {
346-
assertNotNull(Jedis.class.getMethod("sintercard", String[].class));
347-
assertNotNull(Jedis.class.getMethod("sintercard", long.class, String[].class));
348-
assertNotNull(Jedis.class.getMethod("sintercard", byte[][].class));
349-
assertNotNull(Jedis.class.getMethod("sintercard", long.class, byte[][].class));
350-
assertEquals(long.class, Jedis.class.getMethod("sintercard", String[].class).getReturnType());
351-
assertEquals(
352-
long.class,
353-
Jedis.class.getMethod("sintercard", long.class, String[].class).getReturnType());
354-
assertEquals(long.class, Jedis.class.getMethod("sintercard", byte[][].class).getReturnType());
355-
assertEquals(
356-
long.class,
357-
Jedis.class.getMethod("sintercard", long.class, byte[][].class).getReturnType());
358-
}
225+
Method aclWhoAmI = jedisClass.getMethod("aclWhoAmI");
226+
assertEquals(String.class, aclWhoAmI.getReturnType());
359227

360-
@Test
361-
public void sinterstoreMethodsExist() throws NoSuchMethodException {
362-
assertNotNull(Jedis.class.getMethod("sinterstore", String.class, String[].class));
363-
assertNotNull(Jedis.class.getMethod("sinterstore", byte[].class, byte[][].class));
364-
assertEquals(
365-
long.class,
366-
Jedis.class.getMethod("sinterstore", String.class, String[].class).getReturnType());
367-
assertEquals(
368-
long.class,
369-
Jedis.class.getMethod("sinterstore", byte[].class, byte[][].class).getReturnType());
370-
}
228+
Method aclUsers = jedisClass.getMethod("aclUsers");
229+
assertEquals(List.class, aclUsers.getReturnType());
371230

372-
@Test
373-
public void sunionstoreMethodsExist() throws NoSuchMethodException {
374-
assertNotNull(Jedis.class.getMethod("sunionstore", String.class, String[].class));
375-
assertNotNull(Jedis.class.getMethod("sunionstore", byte[].class, byte[][].class));
376-
assertEquals(
377-
long.class,
378-
Jedis.class.getMethod("sunionstore", String.class, String[].class).getReturnType());
379-
assertEquals(
380-
long.class,
381-
Jedis.class.getMethod("sunionstore", byte[].class, byte[][].class).getReturnType());
382-
}
231+
Method aclSave = jedisClass.getMethod("aclSave");
232+
assertEquals(String.class, aclSave.getReturnType());
383233

384-
@Test
385-
public void sdiffstoreMethodsExist() throws NoSuchMethodException {
386-
assertNotNull(Jedis.class.getMethod("sdiffstore", String.class, String[].class));
387-
assertNotNull(Jedis.class.getMethod("sdiffstore", byte[].class, byte[][].class));
388-
assertEquals(
389-
long.class,
390-
Jedis.class.getMethod("sdiffstore", String.class, String[].class).getReturnType());
391-
assertEquals(
392-
long.class,
393-
Jedis.class.getMethod("sdiffstore", byte[].class, byte[][].class).getReturnType());
394-
}
234+
Method aclLoad = jedisClass.getMethod("aclLoad");
235+
assertEquals(String.class, aclLoad.getReturnType());
395236

396-
@Test
397-
public void sscanMethodsExist() throws NoSuchMethodException {
398-
assertNotNull(Jedis.class.getMethod("sscan", String.class, String.class));
399-
assertNotNull(
400-
Jedis.class.getMethod(
401-
"sscan", String.class, String.class, redis.clients.jedis.params.ScanParams.class));
402-
assertNotNull(Jedis.class.getMethod("sscan", byte[].class, byte[].class));
403-
assertNotNull(
404-
Jedis.class.getMethod(
405-
"sscan", byte[].class, byte[].class, redis.clients.jedis.params.ScanParams.class));
237+
Method aclDryRun =
238+
jedisClass.getMethod("aclDryRun", String.class, String.class, String[].class);
239+
assertEquals(String.class, aclDryRun.getReturnType());
406240
}
407241
}

0 commit comments

Comments
 (0)