@Override protected Properties useOverridePropertiesWithPropertiesComponent() { try { ProjectGeneratorConfiguration configuration = new ProjectGeneratorConfiguration(); ProjectGenerator projectGenerator = new ProjectGenerator(configuration, new ResourceManager()); return projectGenerator.generateApplicationProperties(newIntegration()); } catch (IOException e) { Assertions.fail("Unable to generate integration properties", e); } return null; }
private void assertFileContents(ProjectGeneratorConfiguration generatorConfiguration, Path actualFilePath, String expectedFileName) throws URISyntaxException, IOException { URL resource = null; String overridePath = generatorConfiguration.getTemplates().getOverridePath(); String methodName = testName.getMethodName(); int index = methodName.indexOf('['); if (index != -1) { methodName = methodName.substring(0, index); } if (!StringUtils.isEmpty(overridePath)) { resource = ProjectGeneratorTest.class.getResource(methodName + "/" + overridePath + "/" + expectedFileName); } if (resource == null) { resource = ProjectGeneratorTest.class.getResource(methodName + "/" + expectedFileName); } if (resource == null) { throw new IllegalArgumentException("Unable to find te required resource (" + expectedFileName + ")"); } final String actual = new String(Files.readAllBytes(actualFilePath), StandardCharsets.UTF_8).trim(); final String expected = new String(Files.readAllBytes(Paths.get(resource.toURI())), StandardCharsets.UTF_8).trim(); assertThat(actual).isEqualTo(expected); }
); ProjectGeneratorConfiguration configuration = new ProjectGeneratorConfiguration(); configuration.getMavenProperties().addRepository("maven.central", "https://repo1.maven.org/maven2"); configuration.getMavenProperties().addRepository("redhat.ga", "https://maven.repository.redhat.com/ga"); configuration.getMavenProperties().addRepository("jboss.ea", "https://repository.jboss.org/nexus/content/groups/ea"); configuration.getTemplates().setOverridePath(this.basePath); configuration.getTemplates().getAdditionalResources().addAll(this.additionalResources); configuration.setSecretMaskingEnabled(true);
.build(); ProjectGeneratorConfiguration configuration = new ProjectGeneratorConfiguration(); configuration.getTemplates().setOverridePath(this.basePath); configuration.getTemplates().getAdditionalResources().addAll(this.additionalResources); configuration.setSecretMaskingEnabled(true);
); ProjectGeneratorConfiguration configuration = new ProjectGeneratorConfiguration(); configuration.getTemplates().setOverridePath(this.basePath); configuration.getTemplates().getAdditionalResources().addAll(this.additionalResources); configuration.setSecretMaskingEnabled(true);
@Override protected Properties useOverridePropertiesWithPropertiesComponent() { try { ProjectGeneratorConfiguration configuration = new ProjectGeneratorConfiguration(); ProjectGenerator projectGenerator = new ProjectGenerator(configuration, new ResourceManager(), new MavenProperties()); return projectGenerator.generateApplicationProperties(newIntegration()); } catch (IOException e) { Assertions.fail("Unable to generate integration properties", e); } return null; }
private void assertFileContentsJson(ProjectGeneratorConfiguration generatorConfiguration, Path actualFilePath, String expectedFileName) throws URISyntaxException, IOException, JSONException { URL resource = null; String overridePath = generatorConfiguration.getTemplates().getOverridePath(); String methodName = testName.getMethodName(); int index = methodName.indexOf('['); if (index != -1) { methodName = methodName.substring(0, index); } if (!StringUtils.isEmpty(overridePath)) { resource = ProjectGeneratorTest.class.getResource(methodName + "/" + overridePath + "/" + expectedFileName); } if (resource == null) { resource = ProjectGeneratorTest.class.getResource(methodName + "/" + expectedFileName); } if (resource == null) { throw new IllegalArgumentException("Unable to find te required resource (" + expectedFileName + ")"); } final String actual = new String(Files.readAllBytes(actualFilePath), StandardCharsets.UTF_8).trim(); final String expected = new String(Files.readAllBytes(Paths.get(resource.toURI())), StandardCharsets.UTF_8).trim(); JSONAssert.assertEquals(expected, actual, JSONCompareMode.STRICT); }
ProjectGeneratorConfiguration configuration = new ProjectGeneratorConfiguration(); ProjectGenerator generator = new ProjectGenerator(configuration, resourceManager, TestConstants.MAVEN_PROPERTIES); Integration integration = new Integration.Builder()
protected void assertFileContents(ProjectGeneratorConfiguration generatorConfiguration, Path actualFilePath, String expectedFileName) throws URISyntaxException, IOException { URL resource = null; String overridePath = generatorConfiguration.getTemplates().getOverridePath(); String methodName = testName.getMethodName(); int index = methodName.indexOf('['); if (index != -1) { methodName = methodName.substring(0, index); } if (!StringUtils.isEmpty(overridePath)) { resource = ProjectGeneratorTest.class.getResource(methodName + "/" + overridePath + "/" + expectedFileName); } if (resource == null) { resource = ProjectGeneratorTest.class.getResource(methodName + "/" + expectedFileName); } if (resource == null) { throw new IllegalArgumentException("Unable to find te required resource (" + expectedFileName + ")"); } final String actual = new String(Files.readAllBytes(actualFilePath), StandardCharsets.UTF_8).trim(); final String expected = new String(Files.readAllBytes(Paths.get(resource.toURI())), StandardCharsets.UTF_8).trim(); assertThat(actual).isEqualTo(expected); }