Polish "Derive package name from groupId and artifactId"

Closes gh-423
This commit is contained in:
Stephane Nicoll
2017-05-11 16:29:16 +02:00
parent bb578d6fdf
commit 767203b7d5
8 changed files with 139 additions and 78 deletions

View File

@@ -149,8 +149,8 @@ public class ProjectGenerationSmokeTests
HomePage page = toHome();
page.groupId("org.foo");
page.submit();
zipProjectAssert(from("demo.zip")).hasBaseDir("demo").isJavaProject("org.foo",
"DemoApplication");
zipProjectAssert(from("demo.zip")).hasBaseDir("demo")
.isJavaProject("org.foo.demo", "DemoApplication");
}
@Test
@@ -159,7 +159,16 @@ public class ProjectGenerationSmokeTests
page.artifactId("my-project");
page.submit();
zipProjectAssert(from("my-project.zip")).hasBaseDir("my-project")
.isJavaProject("com.example", "MyProjectApplication");
.isJavaProject("com.example.myproject", "MyProjectApplication");
}
@Test
public void customArtifactIdWithInvalidPackageNameIsHandled() throws Exception {
HomePage page = toHome();
page.artifactId("42my-project");
page.submit();
zipProjectAssert(from("42my-project.zip")).hasBaseDir("42my-project")
.isJavaProject("com.example.myproject", "Application");
}
@Test
@@ -333,7 +342,7 @@ public class ProjectGenerationSmokeTests
page.submit();
ProjectAssert projectAssert = zipProjectAssert(from("my-project.zip"));
projectAssert.hasBaseDir("my-project").isMavenProject()
.isJavaProject("com.example.acme", "MyProjectApplication")
.isJavaProject("com.example.acme.myproject", "MyProjectApplication")
.hasStaticAndTemplatesResources(false).pomAssert()
.hasGroupId("com.example.acme").hasArtifactId("my-project")
.hasDependenciesCount(2).hasSpringBootStarterRootDependency()