@Test public void differentRfThanConfigThrows() { KsDef ksDef = new KsDef("test", CassandraConstants.SIMPLE_STRATEGY, ImmutableList.of()); ksDef.setStrategy_options(ImmutableMap.of(DC_1, "1", DC_2, "2")); when(config.replicationFactor()).thenReturn(1); assertThatThrownBy(() -> CassandraVerifier.sanityCheckReplicationFactor(ksDef, config, ImmutableSortedSet.of(DC_1, DC_2))) .isInstanceOf(UnsupportedOperationException.class); }
static void sanityCheckReplicationFactor(KsDef ks, CassandraKeyValueServiceConfig config, Set<String> dcs) { checkRfsSpecified(config, dcs, ks.getStrategy_options()); checkRfsMatchConfig(ks, config, dcs, ks.getStrategy_options()); }
CassandraVerifier { static void sanityCheckReplicationFactor(KsDef ks, CassandraKeyValueServiceConfig config, Set<String> dcs) { checkRfsSpecified(config, dcs, ks.getStrategy_options()); checkRfsMatchConfig(ks, config, dcs, ks.getStrategy_options()); } }
CassandraVerifier { static void sanityCheckReplicationFactor(KsDef ks, CassandraKeyValueServiceConfig config, Set<String> dcs) { checkRfsSpecified(config, dcs, ks.getStrategy_options()); checkRfsMatchConfig(ks, config, dcs, ks.getStrategy_options()); } private  CassandraVerifier(); }
CassandraVerifier { static void sanityCheckReplicationFactor(KsDef ks, CassandraKeyValueServiceConfig config, Set<String> dcs) { checkRfsSpecified(config, dcs, ks.getStrategy_options()); checkRfsMatchConfig(ks, config, dcs, ks.getStrategy_options()); } private  CassandraVerifier();  }
CassandraVerifier { static void sanityCheckReplicationFactor(KsDef ks, CassandraKeyValueServiceConfig config, Set<String> dcs) { checkRfsSpecified(config, dcs, ks.getStrategy_options()); checkRfsMatchConfig(ks, config, dcs, ks.getStrategy_options()); } private  CassandraVerifier();   }