use of com.datastax.dse.driver.internal.core.insights.schema.SpecificExecutionProfile in project java-driver by datastax.
the class ExecutionProfilesInfoFinderTest method should_include_info_about_default_profile_and_only_difference_for_specific_profile.
@Test
@UseDataProvider("executionProfileProvider")
public void should_include_info_about_default_profile_and_only_difference_for_specific_profile(DriverExecutionProfile nonDefaultExecutionProfile, SpecificExecutionProfile expected) {
// given
DriverExecutionProfile defaultExecutionProfile = mockDefaultExecutionProfile();
Map<String, DriverExecutionProfile> profiles = ImmutableMap.of("default", defaultExecutionProfile, "non-default", nonDefaultExecutionProfile);
InternalDriverContext context = mockDriverContextWithProfiles(defaultExecutionProfile, profiles);
// when
Map<String, SpecificExecutionProfile> executionProfilesInfo = new ExecutionProfilesInfoFinder().getExecutionProfilesInfo(context);
// then
assertThat(executionProfilesInfo).isEqualTo(ImmutableMap.of("default", new SpecificExecutionProfile(100, new LoadBalancingInfo("LoadBalancingPolicyImpl", ImmutableMap.of("localDataCenter", "local-dc", "filterFunction", true), DEFAULT_LOAD_BALANCING_PACKAGE), new SpeculativeExecutionInfo("SpeculativeExecutionImpl", ImmutableMap.of("maxSpeculativeExecutions", 100, "delay", 20), DEFAULT_SPECULATIVE_EXECUTION_PACKAGE), "LOCAL_ONE", "SERIAL", ImmutableMap.of("source", "src-graph")), "non-default", expected));
}
Aggregations