File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ package org .springframework .boot .autoconfigure .cassandra ;
2
+
3
+ import com .datastax .oss .driver .api .core .config .OptionsMap ;
4
+ import com .datastax .oss .driver .api .core .config .TypedDriverOption ;
5
+ import org .junit .jupiter .api .Test ;
6
+
7
+ import static org .assertj .core .api .Assertions .assertThat ;
8
+
9
+ /**
10
+ * Tests for {@link CassandraProperties}.
11
+ *
12
+ * @author Chris Bono
13
+ */
14
+ class CassandraPropertiesTest {
15
+
16
+ @ Test
17
+ void defaultValuesAreConsistent () {
18
+ CassandraProperties properties = new CassandraProperties ();
19
+ OptionsMap optionsMap = OptionsMap .driverDefaults ();
20
+
21
+ assertThat (properties .getConnection ().getConnectTimeout ())
22
+ .isEqualTo (optionsMap .get (TypedDriverOption .CONNECTION_CONNECT_TIMEOUT ));
23
+
24
+ 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
+
29
+ assertThat (properties .getRequest ().getPageSize ())
30
+ .isEqualTo (optionsMap .get (TypedDriverOption .REQUEST_PAGE_SIZE ));
31
+
32
+ assertThat (properties .getRequest ().getThrottler ().getType ().type ())
33
+ .isEqualTo (optionsMap .get (TypedDriverOption .REQUEST_THROTTLER_CLASS ));
34
+
35
+ assertThat (properties .getPool ().getHeartbeatInterval ())
36
+ .isEqualTo (optionsMap .get (TypedDriverOption .HEARTBEAT_INTERVAL ));
37
+ }
38
+
39
+ }
You can’t perform that action at this time.
0 commit comments