File tree Expand file tree Collapse file tree
core/src/test/java/com/datastax/oss/driver/internal/core
manual/core/native_protocol Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424import static com .datastax .oss .driver .internal .core .DefaultProtocolFeature .DATE_TYPE ;
2525import static com .datastax .oss .driver .internal .core .DefaultProtocolFeature .SMALLINT_AND_TINYINT_TYPES ;
2626import static org .assertj .core .api .Assertions .assertThat ;
27+ import static org .assertj .core .api .Assertions .assertThatThrownBy ;
2728
2829import com .datastax .dse .driver .api .core .DseProtocolVersion ;
2930import 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 );
Original file line number Diff line number Diff line change @@ -62,12 +62,14 @@ the [configuration](../configuration/):
6262```
6363datastax-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+
7173If you force a version that is too high for the server, you'll get an error:
7274
7375```
You can’t perform that action at this time.
0 commit comments