diff --git a/src/test/java/ch/ivyteam/ivy/maven/ProjectMojoRule.java b/src/test/java/ch/ivyteam/ivy/maven/ProjectMojoRule.java index 7afbc8a5..9342bbd1 100644 --- a/src/test/java/ch/ivyteam/ivy/maven/ProjectMojoRule.java +++ b/src/test/java/ch/ivyteam/ivy/maven/ProjectMojoRule.java @@ -20,10 +20,18 @@ import java.io.UncheckedIOException; import java.nio.file.Files; import java.nio.file.Path; +import java.util.List; import org.apache.maven.plugin.Mojo; +import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.apache.maven.plugin.testing.MojoRule; import org.apache.maven.project.MavenProject; +import org.apache.maven.settings.crypto.SettingsDecrypter; +import org.apache.maven.settings.crypto.SettingsDecryptionRequest; +import org.apache.maven.settings.crypto.SettingsDecryptionResult; + +import com.google.inject.Binder; +import com.google.inject.Module; import ch.ivyteam.ivy.maven.util.PathUtils; @@ -45,6 +53,42 @@ public class ProjectMojoRule extends MojoRule { public MavenProject project; public ProjectMojoRule(Path srcDir, String mojoName) { + + super(new AbstractMojoTestCase() { + + @Override + protected void setUp() throws Exception { + // TODO Auto-generated method stub + super.setUp(); + } + + @Override + protected void setupContainer() { + // TODO Auto-generated method stub + super.setupContainer(); + } + + @Override + protected void addGuiceModules(List modules) { + // TODO Auto-generated method stub + modules.add(new Module() { + + @Override + public void configure(Binder binder) { + binder.bind(SettingsDecrypter.class).toInstance(new SettingsDecrypter() { + + @Override + public SettingsDecryptionResult decrypt(SettingsDecryptionRequest request) { + // TODO Auto-generated method stub + return null; + } + }); + } + }); + } + + }); + this.templateProjectDir = srcDir; this.mojoName = mojoName; } @@ -52,6 +96,8 @@ public ProjectMojoRule(Path srcDir, String mojoName) { @Override @SuppressWarnings("unchecked") protected void before() throws Throwable { + System.err.println("rock it"); + projectDir = Files.createTempDirectory("MyBaseProject"); copyDirectory(templateProjectDir, projectDir); project = readMavenProject(projectDir.toFile());