@Test public void testWithSetVariables() { MultiLangDaemonConfiguration config = getConfiguration(StringUtils.join(new String[] { "streamName = a", "applicationName = b", "AWSCredentialsProvider = ABCD," + credentialName1, "workerId = 1", "metricsEnabledDimensions = ShardId, WorkerIdentifier" }, '\n')); Set<String> expectedMetricsEnabledDimensions = ImmutableSet.<String> builder() .add("ShardId", "WorkerIdentifier").build(); assertThat(new HashSet<>(Arrays.asList(config.getMetricsEnabledDimensions())), equalTo(expectedMetricsEnabledDimensions)); }
public MultiLangDaemonConfiguration getConfiguration(Properties properties) { properties.entrySet().forEach(e -> { try { utilsBean.setProperty(configuration, (String) e.getKey(), e.getValue()); } catch (IllegalAccessException | InvocationTargetException ex) { throw new RuntimeException(ex); } }); Validate.notBlank(configuration.getApplicationName(), "Application name is required"); Validate.notBlank(configuration.getStreamName(), "Stream name is required"); Validate.isTrue(configuration.getKinesisCredentialsProvider().isDirty(), "A basic set of AWS credentials must be provided"); return configuration; }
KinesisClientLibConfigurator { public MultiLangDaemonConfiguration getConfiguration(Properties properties) { properties.entrySet().forEach(e -> { try { utilsBean.setProperty(configuration, (String) e.getKey(), e.getValue()); } catch (IllegalAccessException | InvocationTargetException ex) { throw new RuntimeException(ex); } }); Validate.notBlank(configuration.getApplicationName(), "Application name is required"); Validate.notBlank(configuration.getStreamName(), "Stream name is required"); Validate.isTrue(configuration.getKinesisCredentialsProvider().isDirty(), "A basic set of AWS credentials must be provided"); return configuration; } }
KinesisClientLibConfigurator { public MultiLangDaemonConfiguration getConfiguration(Properties properties) { properties.entrySet().forEach(e -> { try { utilsBean.setProperty(configuration, (String) e.getKey(), e.getValue()); } catch (IllegalAccessException | InvocationTargetException ex) { throw new RuntimeException(ex); } }); Validate.notBlank(configuration.getApplicationName(), "Application name is required"); Validate.notBlank(configuration.getStreamName(), "Stream name is required"); Validate.isTrue(configuration.getKinesisCredentialsProvider().isDirty(), "A basic set of AWS credentials must be provided"); return configuration; } KinesisClientLibConfigurator(); }
KinesisClientLibConfigurator { public MultiLangDaemonConfiguration getConfiguration(Properties properties) { properties.entrySet().forEach(e -> { try { utilsBean.setProperty(configuration, (String) e.getKey(), e.getValue()); } catch (IllegalAccessException | InvocationTargetException ex) { throw new RuntimeException(ex); } }); Validate.notBlank(configuration.getApplicationName(), "Application name is required"); Validate.notBlank(configuration.getStreamName(), "Stream name is required"); Validate.isTrue(configuration.getKinesisCredentialsProvider().isDirty(), "A basic set of AWS credentials must be provided"); return configuration; } KinesisClientLibConfigurator(); MultiLangDaemonConfiguration getConfiguration(Properties properties); MultiLangDaemonConfiguration getConfiguration(InputStream configStream); }
KinesisClientLibConfigurator { public MultiLangDaemonConfiguration getConfiguration(Properties properties) { properties.entrySet().forEach(e -> { try { utilsBean.setProperty(configuration, (String) e.getKey(), e.getValue()); } catch (IllegalAccessException | InvocationTargetException ex) { throw new RuntimeException(ex); } }); Validate.notBlank(configuration.getApplicationName(), "Application name is required"); Validate.notBlank(configuration.getStreamName(), "Stream name is required"); Validate.isTrue(configuration.getKinesisCredentialsProvider().isDirty(), "A basic set of AWS credentials must be provided"); return configuration; } KinesisClientLibConfigurator(); MultiLangDaemonConfiguration getConfiguration(Properties properties); MultiLangDaemonConfiguration getConfiguration(InputStream configStream);  }