@Test public void testWithUnsupportedClientConfigurationVariables() { MultiLangDaemonConfiguration config = getConfiguration(StringUtils.join( new String[] { "AWSCredentialsProvider = " + credentialName1 + ", " + credentialName2, "workerId = id", "kinesisClientConfig = {}", "streamName = stream", "applicationName = b" }, '\n')); assertEquals(config.getApplicationName(), "b"); assertEquals(config.getStreamName(), "stream"); assertEquals(config.getWorkerIdentifier(), "id"); }
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);  }