Polishing.
Reorder methods. Move rewriteConfig directly implemented on connection to DefaultedRedisConnection respective DefaultedRedisClusterConnection. Add overload to run config rewrite on individual cluster nodes. Add tests. Add since tags and update Javadoc. See #1992 Original pull request: #2012.
This commit is contained in:
@@ -333,6 +333,27 @@ class JedisClusterConnectionUnitTests {
|
||||
verify(con3Mock, never()).configResetStat();
|
||||
}
|
||||
|
||||
@Test // GH-1992
|
||||
void rewriteConfigShouldBeExecutedOnAllNodes() {
|
||||
|
||||
connection.rewriteConfig();
|
||||
|
||||
verify(con1Mock, times(1)).configRewrite();
|
||||
verify(con2Mock, times(1)).configRewrite();
|
||||
verify(con3Mock, times(1)).configRewrite();
|
||||
}
|
||||
|
||||
@Test // GH-1992
|
||||
void rewriteConfigShouldBeExecutedOnSingleNodeCorrectly() {
|
||||
|
||||
connection.rewriteConfig(CLUSTER_NODE_2);
|
||||
|
||||
verify(con2Mock, times(1)).configRewrite();
|
||||
verify(con2Mock, atLeast(1)).close();
|
||||
verify(con1Mock, never()).configRewrite();
|
||||
verify(con3Mock, never()).configRewrite();
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-315
|
||||
void clusterTopologyProviderShouldCollectErrorsWhenLoadingNodes() {
|
||||
|
||||
|
||||
@@ -357,6 +357,26 @@ class LettuceClusterConnectionUnitTests {
|
||||
verify(clusterConnection1Mock, never()).configResetstat();
|
||||
}
|
||||
|
||||
@Test // GH-1992
|
||||
void rewriteConfigShouldBeExecutedOnAllNodes() {
|
||||
|
||||
connection.rewriteConfig();
|
||||
|
||||
verify(clusterConnection1Mock, times(1)).configRewrite();
|
||||
verify(clusterConnection2Mock, times(1)).configRewrite();
|
||||
verify(clusterConnection3Mock, times(1)).configRewrite();
|
||||
}
|
||||
|
||||
@Test // GH-1992
|
||||
void rewriteConfigShouldBeExecutedOnSingleNodeCorrectly() {
|
||||
|
||||
connection.rewriteConfig(CLUSTER_NODE_2);
|
||||
|
||||
verify(clusterConnection2Mock, times(1)).configRewrite();
|
||||
verify(clusterConnection1Mock, never()).configRewrite();
|
||||
verify(clusterConnection1Mock, never()).configRewrite();
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-731, DATAREDIS-545
|
||||
void shouldExecuteOnSharedConnection() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user