Skip to content

Commit fc79bb7

Browse files
committed
Follow-up to previous commit
1 parent a572d5f commit fc79bb7

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

core/src/test/java/com/datastax/oss/driver/internal/core/DefaultProtocolVersionRegistryTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import static com.datastax.oss.driver.internal.core.DefaultProtocolFeature.DATE_TYPE;
2525
import static com.datastax.oss.driver.internal.core.DefaultProtocolFeature.SMALLINT_AND_TINYINT_TYPES;
2626
import static org.assertj.core.api.Assertions.assertThat;
27+
import static org.assertj.core.api.Assertions.assertThatThrownBy;
2728

2829
import com.datastax.dse.driver.api.core.DseProtocolVersion;
2930
import com.datastax.dse.driver.api.core.metadata.DseNodeProperties;
@@ -51,6 +52,15 @@ public void should_find_version_by_name() {
5152
assertThat(registry.fromName("DSE_V1")).isEqualTo(DseProtocolVersion.DSE_V1);
5253
}
5354

55+
56+
@Test
57+
public void should_fail_to_find_version_by_name_different_case() {
58+
assertThatThrownBy(() -> registry.fromName("v4")).isInstanceOf(IllegalArgumentException.class);
59+
assertThatThrownBy(() -> registry.fromName("dse_v1")).isInstanceOf(IllegalArgumentException.class);
60+
assertThatThrownBy(() -> registry.fromName("dDSE_v1")).isInstanceOf(IllegalArgumentException.class);
61+
assertThatThrownBy(() -> registry.fromName("dse_v1")).isInstanceOf(IllegalArgumentException.class);
62+
}
63+
5464
@Test
5565
public void should_downgrade_if_lower_version_available() {
5666
Optional<ProtocolVersion> downgraded = registry.downgrade(V4);

manual/core/native_protocol/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ the [configuration](../configuration/):
6262
```
6363
datastax-java-driver {
6464
advanced.protocol {
65-
# The V in the version parameter must be capitalized
6665
version = V3
6766
}
6867
}
6968
```
7069

70+
Note that the protocol version you specify above is case sensitive so make sure to only use uppercase letters.
71+
"V3" is correct, "v3" is not.
72+
7173
If you force a version that is too high for the server, you'll get an error:
7274

7375
```

0 commit comments

Comments
 (0)