Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
elharo committed Dec 6, 2024
1 parent 6940b5c commit 883a866
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -751,16 +751,19 @@ public abstract class AbstractInvokerMojo extends AbstractMojo {

private final ToolchainManagerPrivate toolchainManagerPrivate;

private final InterpolatorUtils interpolatorUtils;

public AbstractInvokerMojo(
Invoker invoker, SettingsBuilder settingsBuilder, ToolchainManagerPrivate toolchainManagerPrivate) {
Invoker invoker,
SettingsBuilder settingsBuilder,
ToolchainManagerPrivate toolchainManagerPrivate,
InterpolatorUtils interpolatorUtils) {
this.invoker = invoker;
this.settingsBuilder = settingsBuilder;
this.toolchainManagerPrivate = toolchainManagerPrivate;
this.interpolatorUtils = interpolatorUtils;
}

@Component
private InterpolatorUtils interpolatorUtils;

/**
* Invokes Maven on the configured test projects.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ public class IntegrationTestMojo extends AbstractInvokerMojo {

@Inject
public IntegrationTestMojo(
Invoker invoker, SettingsBuilder settingsBuilder, ToolchainManagerPrivate toolchainManagerPrivate) {
super(invoker, settingsBuilder, toolchainManagerPrivate);
Invoker invoker,
SettingsBuilder settingsBuilder,
ToolchainManagerPrivate toolchainManagerPrivate,
InterpolatorUtils interpolatorUtils) {
super(invoker, settingsBuilder, toolchainManagerPrivate, interpolatorUtils);
}

void processResults(InvokerSession invokerSession) throws MojoFailureException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ public class InvokerMojo extends AbstractInvokerMojo {

@Inject
public InvokerMojo(
Invoker invoker, SettingsBuilder settingsBuilder, ToolchainManagerPrivate toolchainManagerPrivate) {
super(invoker, settingsBuilder, toolchainManagerPrivate);
Invoker invoker,
SettingsBuilder settingsBuilder,
ToolchainManagerPrivate toolchainManagerPrivate,
InterpolatorUtils interpolaterUtils) {
super(invoker, settingsBuilder, toolchainManagerPrivate, interpolaterUtils);
}

void processResults(InvokerSession invokerSession) throws MojoFailureException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void testCompositeMap() {
@Test
void testPomInterpolation() throws Exception {
File interpolatedPomFile;
InvokerMojo invokerMojo = new InvokerMojo();
InvokerMojo invokerMojo = new InvokerMojo(null, null, null, null);
setVariableValueToObject(invokerMojo, "project", buildMavenProjectStub());
setVariableValueToObject(invokerMojo, "settings", new Settings());
Properties properties = new Properties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class InvokerMojoTest extends AbstractTestUtil {
private static final String INTERPOLATION_PROJECT = "interpolation" + File.separator + "pom.xml";
private static final String WITHOUT_POM_PROJECT = "without-pom-project-dir";

private final InvokerMojo invokerMojo = new InvokerMojo(null, null, null);
private final InvokerMojo invokerMojo = new InvokerMojo(null, null, null, null);

private MavenProject getMavenProject() {
MavenProject mavenProject = new MavenProject();
Expand All @@ -52,7 +52,6 @@ private MavenProject getMavenProject() {
void testSingleInvokerTest() throws Exception {
// given
MavenProject mavenProject = getMavenProject();
InvokerMojo invokerMojo = new InvokerMojo();
String dirPath = getBasedir() + "/src/test/resources/unit";
setVariableValueToObject(invokerMojo, "projectsDirectory", new File(dirPath));
setVariableValueToObject(invokerMojo, "invokerPropertiesFile", "invoker.properties");
Expand All @@ -72,7 +71,6 @@ void testSingleInvokerTest() throws Exception {
void testMultiInvokerTest() throws Exception {
// given
MavenProject mavenProject = getMavenProject();
InvokerMojo invokerMojo = new InvokerMojo();
String dirPath = getBasedir() + "/src/test/resources/unit";
setVariableValueToObject(invokerMojo, "projectsDirectory", new File(dirPath));
setVariableValueToObject(invokerMojo, "invokerPropertiesFile", "invoker.properties");
Expand All @@ -92,7 +90,6 @@ void testMultiInvokerTest() throws Exception {
void testFullPatternInvokerTest() throws Exception {
// given
MavenProject mavenProject = getMavenProject();
InvokerMojo invokerMojo = new InvokerMojo();
String dirPath = getBasedir() + "/src/test/resources/unit";
setVariableValueToObject(invokerMojo, "projectsDirectory", new File(dirPath));
setVariableValueToObject(invokerMojo, "invokerPropertiesFile", "invoker.properties");
Expand All @@ -115,7 +112,6 @@ void testFullPatternInvokerTest() throws Exception {
void testSetupInProjectList() throws Exception {
// given
MavenProject mavenProject = getMavenProject();
InvokerMojo invokerMojo = new InvokerMojo();
String dirPath = getBasedir() + "/src/test/resources/unit";
setVariableValueToObject(invokerMojo, "projectsDirectory", new File(dirPath));
setVariableValueToObject(invokerMojo, "invokerPropertiesFile", "invoker.properties");
Expand Down Expand Up @@ -147,6 +143,7 @@ void testSetupProjectIsFiltered() throws Exception {
String dirPath = getBasedir() + "/src/test/resources/unit";
setVariableValueToObject(invokerMojo, "projectsDirectory", new File(dirPath));
setVariableValueToObject(invokerMojo, "invokerPropertiesFile", "invoker.properties");
MavenProject mavenProject = getMavenProject();
setVariableValueToObject(invokerMojo, "project", mavenProject);
setVariableValueToObject(invokerMojo, "interpolatorUtils", new InterpolatorUtils(mavenProject));
setVariableValueToObject(invokerMojo, "settings", new Settings());
Expand Down

0 comments on commit 883a866

Please sign in to comment.