@Test public void testGenerateApplicationProperties() throws IOException { final ConnectorAction newAction = new ConnectorAction.Builder() .id(KeyGenerator.createKey()) .descriptor(new ConnectorDescriptor.Builder() .connectorId("new") .componentScheme("http4") .build()) .build(); final Connector newConnector = new Connector.Builder() .id("new") .addAction(newAction) .putProperty("username", new ConfigurationProperty.Builder() .componentProperty(false) .secret(true) .build()) .putProperty("password", new ConfigurationProperty.Builder() .componentProperty(false) .secret(true) .build()) .putProperty("token", new ConfigurationProperty.Builder() .componentProperty(true) .secret(true) .build()) .build(); Step s1 = new Step.Builder() .stepKind(StepKind.endpoint) .connection(new Connection.Builder() .id(KeyGenerator.createKey()) .connector(newConnector) .build()) .putConfiguredProperty("username", "my-username-2") .putConfiguredProperty("password", "my-password-2") .putConfiguredProperty("token", "my-token-2") .action(newAction) .build(); TestResourceManager resourceManager = new TestResourceManager(); ProjectGeneratorConfiguration configuration = new ProjectGeneratorConfiguration(); ProjectGenerator generator = new ProjectGenerator(configuration, resourceManager, TestConstants.MAVEN_PROPERTIES); Integration integration = new Integration.Builder() .createFrom(resourceManager.newIntegration(s1)) .putConfiguredProperty("integration", "property") .build(); Properties properties = generator.generateApplicationProperties(integration); assertThat(properties).containsOnly( entry("integration", "property"), entry("flow-0.http4-0.token", "my-token-2"), entry("flow-0.http4-0.username", "my-username-2"), entry("flow-0.http4-0.password", "my-password-2") ); }
@Override public Properties generateApplicationProperties(final Integration integrationDefinition) { final Integration integration = resourceManager.sanitize(integrationDefinition); final Properties properties = new Properties(); properties.putAll(integration.getConfiguredProperties()); addPropertiesFrom(properties, integration, resourceManager); return properties; }
ProjectGenerator implements IntegrationProjectGenerator { @Override public Properties generateApplicationProperties(final Integration integrationDefinition) { final Integration integration = resourceManager.sanitize(integrationDefinition); final Properties properties = new Properties(); properties.putAll(integration.getConfiguredProperties()); addPropertiesFrom(properties, integration, resourceManager); return properties; } }
ProjectGenerator implements IntegrationProjectGenerator { @Override public Properties generateApplicationProperties(final Integration integrationDefinition) { final Integration integration = resourceManager.sanitize(integrationDefinition); final Properties properties = new Properties(); properties.putAll(integration.getConfiguredProperties()); addPropertiesFrom(properties, integration, resourceManager); return properties; } ProjectGenerator(ProjectGeneratorConfiguration configuration, IntegrationResourceManager resourceManager, MavenProperties mavenProperties); }
ProjectGenerator implements IntegrationProjectGenerator { @Override public Properties generateApplicationProperties(final Integration integrationDefinition) { final Integration integration = resourceManager.sanitize(integrationDefinition); final Properties properties = new Properties(); properties.putAll(integration.getConfiguredProperties()); addPropertiesFrom(properties, integration, resourceManager); return properties; } ProjectGenerator(ProjectGeneratorConfiguration configuration, IntegrationResourceManager resourceManager, MavenProperties mavenProperties); @Override @SuppressWarnings("resource") InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler); @Override Properties generateApplicationProperties(final Integration integrationDefinition); @Override byte[] generatePom(final Integration integration); }
ProjectGenerator implements IntegrationProjectGenerator { @Override public Properties generateApplicationProperties(final Integration integrationDefinition) { final Integration integration = resourceManager.sanitize(integrationDefinition); final Properties properties = new Properties(); properties.putAll(integration.getConfiguredProperties()); addPropertiesFrom(properties, integration, resourceManager); return properties; } ProjectGenerator(ProjectGeneratorConfiguration configuration, IntegrationResourceManager resourceManager, MavenProperties mavenProperties); @Override @SuppressWarnings("resource") InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler); @Override Properties generateApplicationProperties(final Integration integrationDefinition); @Override byte[] generatePom(final Integration integration);  }