Skip to content

Commit

Permalink
Remove unused foobar profile from test
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Feb 5, 2025
1 parent 9d8a227 commit 937433c
Showing 1 changed file with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

import static java.util.stream.Collectors.groupingBy;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.junit.jupiter.api.Assertions.assertThrows;
Expand Down Expand Up @@ -1263,10 +1263,6 @@ class Profiles {
@Test
void activeByDefaultWithoutPomLocalActiveProfile() {
rewriteRun(
recipeSpec -> recipeSpec
.executionContext(MavenExecutionContextView.view(new InMemoryExecutionContext()))
// Trying to mimic settings.xml activeProfile or `mvn -Pfoobar`
.parser(MavenParser.builder().activeProfiles("foobar")),
mavenProject("c",
pomXml(
"""
Expand Down Expand Up @@ -1350,17 +1346,13 @@ void activeByDefaultWithoutPomLocalActiveProfile() {
.getDependencies()
.get(Scope.Compile)
.stream()
.collect(Collectors.groupingBy(ResolvedDependency::getArtifactId));
.collect(groupingBy(ResolvedDependency::getArtifactId));

assertThat(deps).hasEntrySatisfying("d", rds -> {
assertThat(rds).hasSize(1);
assertThat(rds.get(0).getVersion()).isEqualTo("0.1.0-SNAPSHOT");
});

assertThat(deps).hasEntrySatisfying("e", rds -> {
assertThat(rds).hasSize(1);
assertThat(rds.get(0).getVersion()).isEqualTo("0.2.0-SNAPSHOT");
});
assertThat(deps)
.hasEntrySatisfying("d", rds -> assertThat(rds)
.singleElement().extracting(ResolvedDependency::getVersion).isEqualTo("0.1.0-SNAPSHOT"))
.hasEntrySatisfying("e", rds -> assertThat(rds)
.singleElement().extracting(ResolvedDependency::getVersion).isEqualTo("0.2.0-SNAPSHOT"));
});
}
)
Expand Down

0 comments on commit 937433c

Please sign in to comment.