Search in sources :

Example 6 with Repository

use of com.mulesoft.tools.migration.project.model.pom.Repository in project mule-migration-assistant by mulesoft.

the class UpdateRepositoriesTest method customerReposKept.

@Test
public void customerReposKept() throws Exception {
    Path pomPath = Paths.get(getClass().getResource(POM_WITH_REPOSITORIES).toURI());
    model = new PomModel.PomModelBuilder().withPom(pomPath).build();
    updateRpositories.execute(model, report.getReport());
    final Predicate<Repository> ownRepoMatcher = r -> "own".equals(r.getId()) && "customers own repo".equals(r.getName()) && "http://my.org/maven2/".equals(r.getUrl());
    model.getRepositories().stream().anyMatch(ownRepoMatcher);
    model.getPluginRepositories().stream().anyMatch(ownRepoMatcher);
}
Also used : Path(java.nio.file.Path) ReportVerification(com.mulesoft.tools.migration.tck.ReportVerification) Rule(org.junit.Rule) Paths(java.nio.file.Paths) Predicate(java.util.function.Predicate) Repository(com.mulesoft.tools.migration.project.model.pom.Repository) Test(org.junit.Test) PomModel(com.mulesoft.tools.migration.project.model.pom.PomModel) Path(java.nio.file.Path) Before(org.junit.Before) Repository(com.mulesoft.tools.migration.project.model.pom.Repository) PomModel(com.mulesoft.tools.migration.project.model.pom.PomModel) Test(org.junit.Test)

Example 7 with Repository

use of com.mulesoft.tools.migration.project.model.pom.Repository in project mule-migration-assistant by mulesoft.

the class UpdateRepositoriesTest method muleReposSchemeUpdated.

@Test
public void muleReposSchemeUpdated() throws Exception {
    Path pomPath = Paths.get(getClass().getResource(POM_WITH_REPOSITORIES).toURI());
    model = new PomModel.PomModelBuilder().withPom(pomPath).build();
    updateRpositories.execute(model, report.getReport());
    final Predicate<Repository> httpRepoMatcher = r -> r.getUrl().startsWith("http://repository.mulesoft.org");
    final Predicate<Repository> httpsRepoMatcher = r -> r.getUrl().startsWith("http://repository.mulesoft.org");
    model.getRepositories().stream().noneMatch(httpRepoMatcher);
    model.getRepositories().stream().anyMatch(httpsRepoMatcher);
    model.getPluginRepositories().stream().noneMatch(httpRepoMatcher);
    model.getPluginRepositories().stream().anyMatch(httpsRepoMatcher);
}
Also used : Path(java.nio.file.Path) ReportVerification(com.mulesoft.tools.migration.tck.ReportVerification) Rule(org.junit.Rule) Paths(java.nio.file.Paths) Predicate(java.util.function.Predicate) Repository(com.mulesoft.tools.migration.project.model.pom.Repository) Test(org.junit.Test) PomModel(com.mulesoft.tools.migration.project.model.pom.PomModel) Path(java.nio.file.Path) Before(org.junit.Before) Repository(com.mulesoft.tools.migration.project.model.pom.Repository) PomModel(com.mulesoft.tools.migration.project.model.pom.PomModel) Test(org.junit.Test)

Example 8 with Repository

use of com.mulesoft.tools.migration.project.model.pom.Repository in project mule-migration-assistant by mulesoft.

the class UpdateRepositoriesTest method exchangeRepoAdded.

@Test
public void exchangeRepoAdded() throws Exception {
    Path pomPath = Paths.get(getClass().getResource(POM_WITH_REPOSITORIES).toURI());
    model = new PomModel.PomModelBuilder().withPom(pomPath).build();
    updateRpositories.execute(model, report.getReport());
    final Predicate<Repository> excangeRepoMatcher = r -> "anypoint-exchange".equals(r.getId()) && "https://maven.anypoint.mulesoft.com/api/v1/maven".equals(r.getUrl());
    model.getRepositories().stream().anyMatch(excangeRepoMatcher);
    model.getPluginRepositories().stream().noneMatch(excangeRepoMatcher);
}
Also used : Path(java.nio.file.Path) ReportVerification(com.mulesoft.tools.migration.tck.ReportVerification) Rule(org.junit.Rule) Paths(java.nio.file.Paths) Predicate(java.util.function.Predicate) Repository(com.mulesoft.tools.migration.project.model.pom.Repository) Test(org.junit.Test) PomModel(com.mulesoft.tools.migration.project.model.pom.PomModel) Path(java.nio.file.Path) Before(org.junit.Before) Repository(com.mulesoft.tools.migration.project.model.pom.Repository) PomModel(com.mulesoft.tools.migration.project.model.pom.PomModel) Test(org.junit.Test)

Aggregations

Repository (com.mulesoft.tools.migration.project.model.pom.Repository)8 PomModel (com.mulesoft.tools.migration.project.model.pom.PomModel)4 DeploymentRepository (org.apache.maven.model.DeploymentRepository)4 Test (org.junit.Test)4 ReportVerification (com.mulesoft.tools.migration.tck.ReportVerification)3 Path (java.nio.file.Path)3 Paths (java.nio.file.Paths)3 Predicate (java.util.function.Predicate)3 Before (org.junit.Before)3 Rule (org.junit.Rule)3 Plugin (com.mulesoft.tools.migration.project.model.pom.Plugin)2 PluginExecution (com.mulesoft.tools.migration.project.model.pom.PluginExecution)2 Properties (java.util.Properties)2 Xpp3Dom (org.codehaus.plexus.util.xml.Xpp3Dom)2 PolicyDeployPropertiesPomContributionMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.utils.PolicyDeployPropertiesPomContributionMigrationStep)1 MigrationReport (com.mulesoft.tools.migration.step.category.MigrationReport)1