Skip to content

Commit 78d1ada

Browse files
committed
Fix server selection spec test names
1 parent b0ea446 commit 78d1ada

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

driver-core/src/test/unit/com/mongodb/connection/ServerSelectionSelectionTest.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public ServerSelectionSelectionTest(final String description, final BsonDocument
7575
@Test
7676
public void shouldPassAllOutcomes() {
7777
// skip this test because the driver prohibits maxStaleness or tagSets with mode of primary at a much lower level
78-
assumeTrue(!description.equals("max-staleness/server_selection/ReplicaSetWithPrimary/MaxStalenessWithModePrimary.json"));
78+
assumeTrue(!description.equals("max-staleness/ReplicaSetWithPrimary/MaxStalenessWithModePrimary.json"));
7979

8080
ServerSelector serverSelector = null;
8181
List<ServerDescription> suitableServers = buildServerDescriptions(definition.getArray("suitable_servers", new BsonArray()));
@@ -105,16 +105,21 @@ public void shouldPassAllOutcomes() {
105105
public static Collection<Object[]> data() throws URISyntaxException, IOException {
106106
List<Object[]> data = new ArrayList<Object[]>();
107107
for (File file : JsonPoweredTestHelper.getTestFiles("/server-selection/server_selection")) {
108-
data.add(new Object[]{getDescription("server-selection/server_selection", file), JsonPoweredTestHelper.getTestDocument(file)});
108+
data.add(new Object[]{getServerSelectionTestDescription(file), JsonPoweredTestHelper.getTestDocument(file)});
109109
}
110110
for (File file : JsonPoweredTestHelper.getTestFiles("/max-staleness/server_selection")) {
111-
data.add(new Object[]{getDescription("max-staleness/server_selection", file), JsonPoweredTestHelper.getTestDocument(file)});
111+
data.add(new Object[]{getMaxStalenessTestDescription(file), JsonPoweredTestHelper.getTestDocument(file)});
112112
}
113113
return data;
114114
}
115115

116-
private static String getDescription(final String root, final File file) {
117-
return root + "/" + file.getParentFile().getName() + "/" + file.getName();
116+
private static String getServerSelectionTestDescription(final File file) {
117+
return "server-selection" + "/" + file.getParentFile().getParentFile().getName() + "/" + file.getParentFile().getName() + "/"
118+
+ file.getName();
119+
}
120+
121+
private static String getMaxStalenessTestDescription(final File file) {
122+
return "max-staleness" + "/" + file.getParentFile().getName() + "/" + file.getName();
118123
}
119124

120125
public static ClusterDescription buildClusterDescription(final BsonDocument topologyDescription,

0 commit comments

Comments
 (0)