-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support geodist, getbit, setbit and xack with GlideString #1635
support geodist, getbit, setbit and xack with GlideString #1635
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add IT
* members do not exist, or if the key does not exist, returns <code>null</code>. | ||
* @example | ||
* <pre>{@code | ||
* Double result = client.geodist("mySortedSet", "Palermo", "Catania", GeoUnit.KILOMETERS).get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Double result = client.geodist("mySortedSet", "Palermo", "Catania", GeoUnit.KILOMETERS).get(); | |
* Double result = client.geodist(gs("mySortedSet"), gs("Palermo"), gs("Catania"), GeoUnit.KILOMETERS).get(); |
@@ -4737,6 +4755,8 @@ public void setbit(BaseClient client) { | |||
|
|||
assertEquals(0, client.setbit(key1, 0, 1).get()); | |||
assertEquals(1, client.setbit(key1, 0, 0).get()); | |||
assertEquals(0, client.setbit(gs(key1.getBytes()), 0, 1).get()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use gs(key1)
no need for getBytes
assertEquals(OK, client.set(key1, value).get()); | ||
assertEquals(1, client.getbit(key1, 1).get()); | ||
assertEquals(0, client.getbit(key1, 1000).get()); | ||
assertEquals(0, client.getbit(missingKey, 1).get()); | ||
assertEquals(1, client.getbit(gs(key1.getBytes()), 1).get()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
Double actualKM = client.geodist(key1, member1, member2, geoUnitKM).get(); | ||
Double actualKM = | ||
client | ||
.geodist(gs(key1.getBytes()), gs(member1.getBytes()), gs(member2.getBytes()), geoUnitKM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment below: gs
can accept string directly
assertEquals( | ||
2L, | ||
client | ||
.xack(gs(key), gs(groupName), new GlideString[] {gs(streamid_1), gs(streamid_2)}) | ||
.get()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please duplicate the test instead of leaving old xack
untested - like you did for setbit
.
Double actual = client.geodist(gs(key1), gs(member1), gs(member2)).get(); | ||
assertEquals(expected, actual, delta); | ||
|
||
// assert correct result with manual metric specification kilometers | ||
Double actualKM = client.geodist(key1, member1, member2, geoUnitKM).get(); | ||
Double actualKM = client.geodist(gs(key1), gs(member1), gs(member2), geoUnitKM).get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for geodist
…1635) * support geodist, getbit, setbit and xack with GlideString * add to integration tests the use of the API with GlideString parameters * nit: apply spotlessApply * remove calls to getBytes()
support geodist, getbit, setbit and xack with GlideString