use of com.datastax.oss.driver.internal.core.connection.ConstantReconnectionPolicy in project java-driver by datastax.
the class ReconnectionPolicyInfoFinderTest method should_find_an_info_about_constant_reconnection_policy.
@Test
public void should_find_an_info_about_constant_reconnection_policy() {
// given
DriverExecutionProfile driverExecutionProfile = mock(DriverExecutionProfile.class);
when(driverExecutionProfile.getDuration(DefaultDriverOption.RECONNECTION_BASE_DELAY)).thenReturn(Duration.ofMillis(100));
ReconnectionPolicy constantReconnectionPolicy = mock(ConstantReconnectionPolicy.class);
// when
ReconnectionPolicyInfo reconnectionPolicyInfo = new ReconnectionPolicyInfoFinder().getReconnectionPolicyInfo(constantReconnectionPolicy, driverExecutionProfile);
// then
assertThat(reconnectionPolicyInfo.getOptions()).contains(MapEntry.entry("delayMs", 100L));
assertThat(reconnectionPolicyInfo.getType()).contains("ConstantReconnectionPolicy");
}
Aggregations