Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable AddExtensionIT.testAddExtensionWithASingleExtensionToSubmodule #16564

Merged
merged 1 commit into from
Apr 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@
import java.io.UnsupportedEncodingException;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.Properties;

import org.apache.maven.model.Dependency;
import org.apache.maven.model.DependencyManagement;
import org.apache.maven.model.Model;
import org.apache.maven.shared.invoker.DefaultInvocationRequest;
import org.apache.maven.shared.invoker.InvocationRequest;
import org.apache.maven.shared.invoker.Invoker;
import org.apache.maven.shared.invoker.InvokerLogger;
import org.apache.maven.shared.invoker.MavenInvocationException;
import org.apache.maven.shared.invoker.PrintStreamLogger;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

@DisableForNative
Expand Down Expand Up @@ -48,7 +49,6 @@ void testAddExtensionWithASingleExtension() throws MavenInvocationException, IOE
}

@Test
@Disabled("TODO: https://github.com/quarkusio/quarkus/issues/14164")
void testAddExtensionWithASingleExtensionToSubmodule() throws MavenInvocationException, IOException {
testDir = initProject("projects/multimodule", "projects/testAddExtensionWithASingleExtensionToSubmodule");
testDir = new File(testDir, "runner");
Expand All @@ -61,7 +61,8 @@ void testAddExtensionWithASingleExtensionToSubmodule() throws MavenInvocationExc
expected.setArtifactId(VERTX_ARTIFACT_ID);
assertThat(contains(model.getDependencies(), expected)).isTrue();

assertThat(model.getDependencyManagement().getDependencies()).isEmpty();
assertThat(Optional.ofNullable(model.getDependencyManagement())
.map(DependencyManagement::getDependencies).orElse(Collections.emptyList())).isEmpty();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about model.getDependencyManagement() == null ? Collections.emptyList() : model.getDependencyManagement().getDependencies();

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guillaume merged it already. 😉
I'm a bit of a DRY fanatic, so I personally don't like the redudant calls that come with that pattern.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't your code result in more calls? And, I guess, it's a lot more JVM "work" for the same result.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, more calls and thus a bit more work, but no repetition.
It's a matter of personal preference, YMMV.
If your version is more in line with what is usually being used in Quarkus then I'll try to remember that next time.

}

@Test
Expand Down