use of org.eclipse.jkube.kit.common.JavaProject in project jkube by eclipse.
the class MavenUtilTest method testJKubeProjectConversion.
@Test
public void testJKubeProjectConversion() throws DependencyResolutionRequiredException {
MavenProject mavenProject = getMavenProject();
JavaProject project = MavenUtil.convertMavenProjectToJKubeProject(mavenProject, getMavenSession());
assertEquals("testProject", project.getName());
assertEquals("org.eclipse.jkube", project.getGroupId());
assertEquals("test-project", project.getArtifactId());
assertEquals("0.1.0", project.getVersion());
assertEquals("test description", project.getDescription());
assertEquals("target", project.getOutputDirectory().getName());
assertEquals(".", project.getBuildDirectory().getName());
assertEquals("https://www.eclipse.org/jkube/", project.getDocumentationUrl());
assertEquals(1, mavenProject.getCompileClasspathElements().size());
assertEquals("./target", mavenProject.getCompileClasspathElements().get(0));
assertEquals("bar", project.getProperties().get("foo"));
assertEquals("https://projects.eclipse.org/projects/ecd.jkube", project.getUrl());
assertEquals(Collections.singletonList(org.eclipse.jkube.kit.common.Maintainer.builder().name("Dev1").email("dev1@eclipse.org").build()), project.getMaintainers());
}
use of org.eclipse.jkube.kit.common.JavaProject in project jkube by eclipse.
the class SpringBootUtilTest method getSpringBootPluginConfiguration_whenSpringBootGradlePluginPresent_thenReturnsPluginConfiguration.
@Test
public void getSpringBootPluginConfiguration_whenSpringBootGradlePluginPresent_thenReturnsPluginConfiguration() {
// Given
JavaProject javaProject = JavaProject.builder().plugin(Plugin.builder().groupId("org.springframework.boot").artifactId("org.springframework.boot.gradle.plugin").configuration(Collections.singletonMap("mainClass", "com.example.ExampleApplication")).build()).build();
// When
Map<String, Object> configuration = SpringBootUtil.getSpringBootPluginConfiguration(javaProject);
// Then
assertNotNull(configuration);
assertEquals("com.example.ExampleApplication", configuration.get("mainClass").toString());
}
Aggregations