@Test public void testWithAWSCredentialsFailed() { String test = StringUtils.join( new String[] { "streamName = a", "applicationName = b", "AWSCredentialsProvider = " + credentialName2, "failoverTimeMillis = 100", "shardSyncIntervalMillis = 500" }, '\n'); InputStream input = new ByteArrayInputStream(test.getBytes()); try { MultiLangDaemonConfiguration config = configurator.getConfiguration(input); config.getKinesisCredentialsProvider().build(AwsCredentialsProvider.class).resolveCredentials(); fail("expect failure with wrong credentials provider"); } catch (Exception e) { } }
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);  }