-
Notifications
You must be signed in to change notification settings - Fork 0
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
Added Configuration Tests and Configured Jacoco #56
Added Configuration Tests and Configured Jacoco #56
Conversation
3761294
to
71556d3
Compare
cb1966e
to
cada9b7
Compare
public static List createSetOptions(SetOptions options) { | ||
List optionArgs = new LinkedList(); |
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.
public static List createSetOptions(SetOptions options) { | |
List optionArgs = new LinkedList(); | |
public static List<String> createSetOptions(SetOptions options) { | |
List<String> optionArgs = new LinkedList<>(); |
} else { | ||
if (options.expiry.count == null) { | ||
throw new RequestException( | ||
"Set command received expiry type " + options.expiry.type + "but count was not set."); |
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.
"Set command received expiry type " + options.expiry.type + "but count was not set."); | |
"Set command received expiry type " + options.expiry.type + ", but count was not set."); |
java/client/src/main/java/glide/api/models/commands/SetOptions.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/models/configuration/BackoffStrategy.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Andrew Carbonetto <[email protected]>
* Add base command; add custom command --------- Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
…entloopGroup and channel configuration for Netty.
Removed wildcard imports. Fixed wording in documentation.
Signed-off-by: Andrew Carbonetto <[email protected]>
Applied Spotless. Removed RequestBuilder.
Signed-off-by: Andrew Carbonetto <[email protected]>
71556d3
to
b9c9ee4
Compare
Signed-off-by: Andrew Carbonetto <[email protected]>
…v_SanH_configuration_tests
Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
@@ -0,0 +1 @@ | |||
lombok.addLombokGeneratedAnnotation = true |
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.
newline?
assertEquals(new ArrayList<NodeAddress>(), redisClientConfiguration.getAddresses()); | ||
assertFalse(redisClientConfiguration.isUseTLS()); | ||
assertEquals(ReadFrom.PRIMARY, redisClientConfiguration.getReadFrom()); | ||
assertNull(redisClientConfiguration.getCredentials()); | ||
assertNull(redisClientConfiguration.getRequestTimeout()); | ||
assertNull(redisClientConfiguration.getDatabaseId()); | ||
assertNull(redisClientConfiguration.getReconnectStrategy()); |
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.
assertAll
?
() -> assertEquals(expectedNodeAddress.getPort(), actualNodeAddress.getPort())); | ||
} | ||
assertTrue(redisClientConfiguration.isUseTLS()); | ||
assertEquals(ReadFrom.PREFER_REPLICA, redisClientConfiguration.getReadFrom()); |
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.
and here (and below too)
assertEquals(connectionManager, client.connectionManager); | ||
assertEquals(commandManager, client.commandManager); | ||
} catch (Exception cancellationException) { | ||
assertTrue(cancellationException instanceof CancellationException); |
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.
Only one branch should succceed. If you test cancellation, add fail()
into try
block
assertEquals(connectionManager, client.connectionManager); | ||
assertEquals(commandManager, client.commandManager); | ||
} catch (Exception exception) { | ||
assertEquals(interruptedException, exception.getCause()); |
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.
And here is the same
|
||
@Test | ||
public void getOrCreateReturnsDefault() { | ||
(new ThreadPoolResourceAllocator.ShutdownHook()).run(); | ||
(new DefaultThreadPoolResourceHandler.ShutdownHook()).run(); |
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.
(new DefaultThreadPoolResourceHandler.ShutdownHook()).run(); | |
new DefaultThreadPoolResourceHandler.ShutdownHook().run(); |
@@ -38,6 +39,6 @@ public void getOrCreateReturnsDefault() { | |||
// remove the mocked resource | |||
EventLoopGroup mockedELG = mock(EventLoopGroup.class); | |||
when(mockedThreadPool.getEventLoopGroup()).thenReturn(mockedELG); | |||
(new ThreadPoolResourceAllocator.ShutdownHook()).run(); | |||
(new DefaultThreadPoolResourceHandler.ShutdownHook()).run(); |
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.
(new DefaultThreadPoolResourceHandler.ShutdownHook()).run(); | |
new DefaultThreadPoolResourceHandler.ShutdownHook().run(); |
5cc435d
to
26fc46d
Compare
Added Configuration Tests and added jacoco.
Applied Spotless.
Removed RequestBuilder.