Repository navigation
Removed sending data to the server in case of load - #184
Conversation
eolivelli
left a comment
There was a problem hiding this comment.
LGTM
please note that this is a wire protocol change.
but the "old" server did not use the "data" field, so the new client is still backward compatible with old servers
|
I kindly suggest to add test cases to cover this changes and the protocol. |
a8927b5 to
72a6295
Compare
|
@eolivelli @dmercuriali I added a new class RequestParametersTest where I text the message format of requests of type PUT, LOAD, INVALID AND FETCH |
4a8f70a to
307aa02
Compare
307aa02 to
ab2cd26
Compare
| client.setInternalClientListener(new InternalClientListener() { | ||
| @Override | ||
| public void onRequestSent(Message message) { | ||
| assertTrue(message.type == Message.TYPE_PUT_ENTRY); |
| assertTrue(message.type == Message.TYPE_PUT_ENTRY); | ||
| assertTrue(message.parameters.get("data") != null); | ||
| assertTrue(message.parameters.get("key") != null); | ||
| assertTrue(message.parameters.get("expiretime") != null); |
There was a problem hiding this comment.
we should also validate the number of entries. To test that there is nothing more that what is expected
There was a problem hiding this comment.
for expiretime we can at least verify the type
| public void onRequestSent(Message message) { | ||
| assertTrue(message.type == Message.TYPE_PUT_ENTRY); | ||
| assertTrue(message.parameters.get("data") != null); | ||
| assertTrue(message.parameters.get("key") != null); |
There was a problem hiding this comment.
we know the key, we can use assertEquals
| @Override | ||
| public void onRequestSent(Message message) { | ||
| assertTrue(message.type == Message.TYPE_PUT_ENTRY); | ||
| assertTrue(message.parameters.get("data") != null); |
There was a problem hiding this comment.
we know the payload, we can use assertEquals
|
@dmercuriali @eolivelli PTAL |
Removed sending data to the server in case of load.
In case of load, on the server side, the data is not necessary as it is never used.