You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add arguments getter to Request interface and implementations.
Use cases
I'm testing about Verticle (Redis used), The purpose of the test is to test whether the processing about data received from Redis and check intented command sent to Redis. (Not about Redis connection)
I replaced the Redis object with a mock, but couldn't construct a proper assertion on the Request object passed to the RedisConnection.send method.
The Request object does not provide getters for Arguments entered so far, so the following code hard to implements.
If the Arguments getter method added to Request interface, the test code above can assert which arguments were included in the request, like so:
// Verify `conn.send` method call with specific argumentsverify(conn).send(argThat(request -> "TEST_KEY".equals(newString(request.getArgs().get(0))));
I have written examples of use only for testing purposes, but it can be used general purpose in areas such as logging or something else.
Contribution
I can implement this myself if you deem it a worthy feature request. In RequestImpl class, arguments are stored byte[] object, but since the main purpose is to add a simple getter method, only a few lines of code are required.
The text was updated successfully, but these errors were encountered:
Describe the feature
Add arguments getter to
Request
interface and implementations.Use cases
I'm testing about Verticle (Redis used), The purpose of the test is to test whether the processing about data received from Redis and check intented command sent to Redis. (Not about Redis connection)
I replaced the Redis object with a mock, but couldn't construct a proper assertion on the Request object passed to the RedisConnection.send method.
The Request object does not provide getters for Arguments entered so far, so the following code hard to implements.
If the Arguments getter method added to Request interface, the test code above can assert which arguments were included in the request, like so:
I have written examples of use only for testing purposes, but it can be used general purpose in areas such as logging or something else.
Contribution
I can implement this myself if you deem it a worthy feature request. In RequestImpl class, arguments are stored byte[] object, but since the main purpose is to add a simple getter method, only a few lines of code are required.
The text was updated successfully, but these errors were encountered: