resolving system properties in test harness testcase

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

resolving system properties in test harness testcase

Christian Domsch-3
Hi,

in my plugin test case I want to inject system properties into the
execution of the test case. Reason for that is we want to run the test in
our ci environment and need to inject certain username/passwords that are
used to connect to another system.

For this I am using a SettingsStub that is configured using the following
test pom:

<project ...>

  ...

    <build>

        <plugins>

            <plugin>

                <groupId>mygroup</groupId>

                <artifactId>myartifact</artifactId>

                <version>...</version>

                <configuration>

                    <settings implementation="mypackage.SettingsStub">

                        <user>${jira.cloud.user}</user>

                        <token>${jira.cloud.password}</token>

                    </decrypter>

                </configuration>

            </plugin>

        </plugins>

    </build>

</project>


Using the SettingsStub in general works very well, but the expression is
not resolved. Digging through the code, I saw that
the org.apache.maven.plugin.testing.MojoRule (which we use) in
configureMojo uses an evaluator of class ResolverExpressionEvaluatorStub
which does not resolve the way I need it.


Is there a different way to do that, or do I need to resolve that manually
by myself (whoch I could in the SettingsStub).


Kind regards,


Christian