slawekjaranowski commented on code in PR #11829:
URL: https://github.com/apache/maven/pull/11829#discussion_r2983811169


##########
impl/maven-testing/src/main/java/org/apache/maven/api/plugin/testing/MojoExtension.java:
##########
@@ -331,23 +333,23 @@ private static String 
getGoalFromMojoImplementationClass(Class<?> cl) throws IOE
     @Override
     @SuppressWarnings("checkstyle:MethodLength")
     public void beforeEach(ExtensionContext context) throws Exception {
-        if (pluginBasedir == null) {
-            pluginBasedir = MavenDIExtension.getBasedir();
-        }
-        basedir = 
AnnotationSupport.findAnnotation(context.getElement().orElseThrow(), 
Basedir.class)
+        setContext(context);
+
+        String pluginBasedir = MavenDIExtension.getBasedir();
+
+        String basedir = 
AnnotationSupport.findAnnotation(context.getElement().orElseThrow(), 
Basedir.class)
                 .map(Basedir::value)
-                .orElse(pluginBasedir);
-        if (basedir != null) {
-            if (basedir.isEmpty()) {
-                basedir = pluginBasedir + "/target/tests/"
-                        + context.getRequiredTestClass().getSimpleName() + "/"
-                        + context.getRequiredTestMethod().getName();
-            } else {
-                basedir = basedir.replace("${basedir}", pluginBasedir);
-            }
+                .orElse(null);

Review Comment:
   looks like `basedir` can be only empty if system property `basedir` will be 
empty
   more tests are needed for basedir annotation



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to