From 49ad8cb3a835bfc84648ad73164703c9f10c908c Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Mon, 17 Jun 2013 11:27:25 +0200 Subject: [PATCH] SONAR-4047 Fix UT --- .../batch/scan/maven/MavenProjectConverterTest.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sonar-batch/src/test/java/org/sonar/batch/scan/maven/MavenProjectConverterTest.java b/sonar-batch/src/test/java/org/sonar/batch/scan/maven/MavenProjectConverterTest.java index 9150be4031d..f4fc136cab9 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/scan/maven/MavenProjectConverterTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/scan/maven/MavenProjectConverterTest.java @@ -73,12 +73,12 @@ public class MavenProjectConverterTest { public void shouldConvertModules() throws IOException { File basedir = temp.newFolder(); - MavenProject root = new MavenProject(); + MavenProject root = newMavenProject("com.foo", "parent", "1.0-SNAPSHOT"); root.setFile(new File(basedir, "pom.xml")); root.getBuild().setDirectory("target"); root.getBuild().setOutputDirectory("target/classes"); root.getModules().add("module/pom.xml"); - MavenProject module = new MavenProject(); + MavenProject module = newMavenProject("com.foo", "moduleA", "1.0-SNAPSHOT"); module.setFile(new File(basedir, "module/pom.xml")); module.getBuild().setDirectory("target"); module.getBuild().setOutputDirectory("target/classes"); @@ -87,6 +87,14 @@ public class MavenProjectConverterTest { assertThat(project.getSubProjects().size(), is(1)); } + private MavenProject newMavenProject(String groupId, String artifactId, String version) { + Model model = new Model(); + model.setGroupId(groupId); + model.setArtifactId(artifactId); + model.setVersion(version); + return new MavenProject(model); + } + @Test public void shouldConvertProperties() { MavenProject pom = new MavenProject(); -- 2.39.5