Skip to content

Commit

Permalink
Use only SENTINEL REPLICAS in tests
Browse files Browse the repository at this point in the history
Related to and downmerge of: Deprecate SENTINEL SLAVES and change tests (#2673)
  • Loading branch information
sazzad16 committed Dec 12, 2021
1 parent a420462 commit 8187515
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void sentinel() {
Integer.parseInt(masterHostAndPort.get(1)));
assertEquals(master, masterFromSentinel);

List<Map<String, String>> slaves = j.sentinelSlaves(MASTER_NAME);
List<Map<String, String>> slaves = j.sentinelReplicas(MASTER_NAME);
assertTrue(!slaves.isEmpty());
assertEquals(master.getPort(), Integer.parseInt(slaves.get(0).get("master-port")));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,10 @@ public void masterMasters() {
}

@Test
public void replicasSlaves() {
String runId;
public void replicas() {
try (Jedis sentinel = new Jedis(sentinel2_1)) {
Map<String, String> details = sentinel.sentinelReplicas("mymaster").get(0);
assertEquals(Integer.toString(replica2.getPort()), details.get("port"));
runId = details.get("runid");
}

try (Jedis sentinel2 = new Jedis(sentinel2_2)) {
Map<String, String> details = sentinel2.sentinelSlaves("mymaster").get(0);
assertEquals(runId, details.get("runid"));
}
}
}

0 comments on commit 8187515

Please sign in to comment.