@Test public void testReplaceDeprecatedKeys() { Properties testConfig = new Properties(); testConfig.setProperty(AWSConfigConstants.AWS_REGION, "us-east-1"); testConfig.setProperty(ProducerConfigConstants.AGGREGATION_MAX_COUNT, "1"); testConfig.setProperty(ProducerConfigConstants.COLLECTION_MAX_COUNT, "2"); Properties replacedConfig = KinesisConfigUtil.replaceDeprecatedProducerKeys(testConfig); assertEquals("1", replacedConfig.getProperty(KinesisConfigUtil.AGGREGATION_MAX_COUNT)); assertEquals("2", replacedConfig.getProperty(KinesisConfigUtil.COLLECTION_MAX_COUNT)); }
public static Properties replaceDeprecatedProducerKeys(Properties configProps) { if (configProps.containsKey(ProducerConfigConstants.COLLECTION_MAX_COUNT)) { configProps.setProperty(COLLECTION_MAX_COUNT, configProps.getProperty(ProducerConfigConstants.COLLECTION_MAX_COUNT)); configProps.remove(ProducerConfigConstants.COLLECTION_MAX_COUNT); } if (configProps.containsKey(ProducerConfigConstants.AGGREGATION_MAX_COUNT)) { configProps.setProperty(AGGREGATION_MAX_COUNT, configProps.getProperty(ProducerConfigConstants.AGGREGATION_MAX_COUNT)); configProps.remove(ProducerConfigConstants.AGGREGATION_MAX_COUNT); } return configProps; }
KinesisConfigUtil { public static Properties replaceDeprecatedProducerKeys(Properties configProps) { if (configProps.containsKey(ProducerConfigConstants.COLLECTION_MAX_COUNT)) { configProps.setProperty(COLLECTION_MAX_COUNT, configProps.getProperty(ProducerConfigConstants.COLLECTION_MAX_COUNT)); configProps.remove(ProducerConfigConstants.COLLECTION_MAX_COUNT); } if (configProps.containsKey(ProducerConfigConstants.AGGREGATION_MAX_COUNT)) { configProps.setProperty(AGGREGATION_MAX_COUNT, configProps.getProperty(ProducerConfigConstants.AGGREGATION_MAX_COUNT)); configProps.remove(ProducerConfigConstants.AGGREGATION_MAX_COUNT); } return configProps; } }
KinesisConfigUtil { public static Properties replaceDeprecatedProducerKeys(Properties configProps) { if (configProps.containsKey(ProducerConfigConstants.COLLECTION_MAX_COUNT)) { configProps.setProperty(COLLECTION_MAX_COUNT, configProps.getProperty(ProducerConfigConstants.COLLECTION_MAX_COUNT)); configProps.remove(ProducerConfigConstants.COLLECTION_MAX_COUNT); } if (configProps.containsKey(ProducerConfigConstants.AGGREGATION_MAX_COUNT)) { configProps.setProperty(AGGREGATION_MAX_COUNT, configProps.getProperty(ProducerConfigConstants.AGGREGATION_MAX_COUNT)); configProps.remove(ProducerConfigConstants.AGGREGATION_MAX_COUNT); } return configProps; }  }
KinesisConfigUtil { public static Properties replaceDeprecatedProducerKeys(Properties configProps) { if (configProps.containsKey(ProducerConfigConstants.COLLECTION_MAX_COUNT)) { configProps.setProperty(COLLECTION_MAX_COUNT, configProps.getProperty(ProducerConfigConstants.COLLECTION_MAX_COUNT)); configProps.remove(ProducerConfigConstants.COLLECTION_MAX_COUNT); } if (configProps.containsKey(ProducerConfigConstants.AGGREGATION_MAX_COUNT)) { configProps.setProperty(AGGREGATION_MAX_COUNT, configProps.getProperty(ProducerConfigConstants.AGGREGATION_MAX_COUNT)); configProps.remove(ProducerConfigConstants.AGGREGATION_MAX_COUNT); } return configProps; }  static void validateConsumerConfiguration(Properties config); static Properties replaceDeprecatedProducerKeys(Properties configProps); static Properties backfillConsumerKeys(Properties configProps); static KinesisProducerConfiguration getValidatedProducerConfiguration(Properties config); static void validateAwsConfiguration(Properties config); }
KinesisConfigUtil { public static Properties replaceDeprecatedProducerKeys(Properties configProps) { if (configProps.containsKey(ProducerConfigConstants.COLLECTION_MAX_COUNT)) { configProps.setProperty(COLLECTION_MAX_COUNT, configProps.getProperty(ProducerConfigConstants.COLLECTION_MAX_COUNT)); configProps.remove(ProducerConfigConstants.COLLECTION_MAX_COUNT); } if (configProps.containsKey(ProducerConfigConstants.AGGREGATION_MAX_COUNT)) { configProps.setProperty(AGGREGATION_MAX_COUNT, configProps.getProperty(ProducerConfigConstants.AGGREGATION_MAX_COUNT)); configProps.remove(ProducerConfigConstants.AGGREGATION_MAX_COUNT); } return configProps; }  static void validateConsumerConfiguration(Properties config); static Properties replaceDeprecatedProducerKeys(Properties configProps); static Properties backfillConsumerKeys(Properties configProps); static KinesisProducerConfiguration getValidatedProducerConfiguration(Properties config); static void validateAwsConfiguration(Properties config);  }