Skip to content

Commit e509869

Browse files
committed
Polish "Validate Cassandra defaults"
See gh-25130
1 parent f71ab69 commit e509869

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2012-2021 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package org.springframework.boot.autoconfigure.cassandra;
218

319
import com.datastax.oss.driver.api.core.config.OptionsMap;
@@ -16,24 +32,19 @@ class CassandraPropertiesTest {
1632
@Test
1733
void defaultValuesAreConsistent() {
1834
CassandraProperties properties = new CassandraProperties();
19-
OptionsMap optionsMap = OptionsMap.driverDefaults();
20-
35+
OptionsMap driverDefaults = OptionsMap.driverDefaults();
2136
assertThat(properties.getConnection().getConnectTimeout())
22-
.isEqualTo(optionsMap.get(TypedDriverOption.CONNECTION_CONNECT_TIMEOUT));
23-
37+
.isEqualTo(driverDefaults.get(TypedDriverOption.CONNECTION_CONNECT_TIMEOUT));
2438
assertThat(properties.getConnection().getInitQueryTimeout())
25-
.isEqualTo(optionsMap.get(TypedDriverOption.CONNECTION_INIT_QUERY_TIMEOUT));
26-
27-
assertThat(properties.getRequest().getTimeout()).isEqualTo(optionsMap.get(TypedDriverOption.REQUEST_TIMEOUT));
28-
39+
.isEqualTo(driverDefaults.get(TypedDriverOption.CONNECTION_INIT_QUERY_TIMEOUT));
40+
assertThat(properties.getRequest().getTimeout())
41+
.isEqualTo(driverDefaults.get(TypedDriverOption.REQUEST_TIMEOUT));
2942
assertThat(properties.getRequest().getPageSize())
30-
.isEqualTo(optionsMap.get(TypedDriverOption.REQUEST_PAGE_SIZE));
31-
43+
.isEqualTo(driverDefaults.get(TypedDriverOption.REQUEST_PAGE_SIZE));
3244
assertThat(properties.getRequest().getThrottler().getType().type())
33-
.isEqualTo(optionsMap.get(TypedDriverOption.REQUEST_THROTTLER_CLASS));
34-
45+
.isEqualTo(driverDefaults.get(TypedDriverOption.REQUEST_THROTTLER_CLASS));
3546
assertThat(properties.getPool().getHeartbeatInterval())
36-
.isEqualTo(optionsMap.get(TypedDriverOption.HEARTBEAT_INTERVAL));
47+
.isEqualTo(driverDefaults.get(TypedDriverOption.HEARTBEAT_INTERVAL));
3748
}
3849

3950
}

0 commit comments

Comments
 (0)