@Test public void testGenerateTemplateStepProjectDependencies() throws Exception { TestResourceManager resourceManager = new TestResourceManager(); Integration integration = resourceManager.newIntegration( new Step.Builder() .stepKind(StepKind.endpoint) .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder() .putConfiguredProperty("name", "Test-Connector") .build()) .build()) .build(), new Step.Builder() .id("templating") .stepKind(StepKind.template) .action(new StepAction.Builder() .descriptor(new StepDescriptor.Builder() .kind(StepAction.Kind.STEP) .inputDataShape(new DataShape.Builder() .kind(DataShapeKinds.JSON_SCHEMA) .build()) .outputDataShape(new DataShape.Builder() .kind(DataShapeKinds.JSON_SCHEMA) .build()) .build()) .build()) .putConfiguredProperty("template", "{{text}}") .putConfiguredProperty("language", TemplateStepLanguage.MUSTACHE.toString()) .build(), new Step.Builder() .stepKind(StepKind.endpoint) .action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder() .putConfiguredProperty("name", "result") .build()) .build()) .build() ); ProjectGeneratorConfiguration configuration = new ProjectGeneratorConfiguration(); configuration.getTemplates().setOverridePath(this.basePath); configuration.getTemplates().getAdditionalResources().addAll(this.additionalResources); configuration.setSecretMaskingEnabled(true); Path runtimeDir = generate(integration, configuration, resourceManager); assertFileContents(configuration, runtimeDir.resolve("pom.xml"), "pom.xml"); assertThat(errors).isEmpty(); }
@Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedInputStream is = new PipedInputStream(); final ExecutorService executor = Executors.newSingleThreadExecutor(); final PipedOutputStream os = new PipedOutputStream(is); executor.execute(generateAddProjectTarEntries(integration, os, errorHandler)); return is; }
ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedInputStream is = new PipedInputStream(); final ExecutorService executor = Executors.newSingleThreadExecutor(); final PipedOutputStream os = new PipedOutputStream(is); executor.execute(generateAddProjectTarEntries(integration, os, errorHandler)); return is; } }
ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedInputStream is = new PipedInputStream(); final ExecutorService executor = Executors.newSingleThreadExecutor(); final PipedOutputStream os = new PipedOutputStream(is); executor.execute(generateAddProjectTarEntries(integration, os, errorHandler)); return is; } ProjectGenerator(ProjectGeneratorConfiguration configuration, IntegrationResourceManager resourceManager, MavenProperties mavenProperties); }
ProjectGenerator implements IntegrationProjectGenerator { @Override @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedInputStream is = new PipedInputStream(); final ExecutorService executor = Executors.newSingleThreadExecutor(); final PipedOutputStream os = new PipedOutputStream(is); executor.execute(generateAddProjectTarEntries(integration, os, errorHandler)); return is; } 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 @SuppressWarnings("resource") public InputStream generate(final Integration integrationDefinition, IntegrationErrorHandler errorHandler) throws IOException { final Integration integration = resourceManager.sanitize(integrationDefinition); final PipedInputStream is = new PipedInputStream(); final ExecutorService executor = Executors.newSingleThreadExecutor(); final PipedOutputStream os = new PipedOutputStream(is); executor.execute(generateAddProjectTarEntries(integration, os, errorHandler)); return is; } 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);  }