Skip to content

Commit

Permalink
IT test for non-existent config file.
Browse files Browse the repository at this point in the history
  • Loading branch information
SanHalacogluImproving committed Mar 5, 2024
1 parent 0771ba6 commit e094f5f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions java/integTest/src/test/java/glide/cluster/CommandTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static glide.api.models.configuration.RequestRoutingConfiguration.SlotType.PRIMARY;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

import glide.api.RedisClusterClient;
Expand All @@ -28,7 +29,9 @@
import glide.api.models.configuration.NodeAddress;
import glide.api.models.configuration.RedisClusterClientConfiguration;
import glide.api.models.configuration.RequestRoutingConfiguration.SlotKeyRoute;
import glide.api.models.exceptions.RequestException;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import lombok.SneakyThrows;
import org.junit.jupiter.api.AfterAll;
Expand Down Expand Up @@ -294,4 +297,12 @@ public void config_reset_stat() {
int value_after = getValueFromInfo(firstNodeInfo, "total_net_input_bytes");
assertTrue(value_after < value_before);
}

@Test
@SneakyThrows
public void config_rewrite_non_existent_config_file() {
ExecutionException executionException =
assertThrows(ExecutionException.class, () -> clusterClient.configRewrite().get());
assertTrue(executionException.getCause() instanceof RequestException);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,12 @@ public void config_reset_stat() {
int value_after = getValueFromInfo(data, "total_net_input_bytes");
assertTrue(value_after < value_before);
}

@Test
@SneakyThrows
public void config_rewrite_non_existent_config_file() {
ExecutionException executionException =
assertThrows(ExecutionException.class, () -> regularClient.configRewrite().get());
assertTrue(executionException.getCause() instanceof RequestException);
}
}

0 comments on commit e094f5f

Please sign in to comment.