use of com.mulesoft.tools.migration.project.model.pom.PomModel in project mule-migration-assistant by mulesoft.
the class ProxyMigrationTaskTestCase method execute.
@Test
public void execute() throws Exception {
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
steps.forEach(step -> migrate((AbstractApplicationModelMigrationStep) step));
String xmlString = outputter.outputString(doc);
assertThat(xmlString, isSimilarTo(IOUtils.toString(this.getClass().getClassLoader().getResource(targetPath.toString()).toURI(), UTF_8)).ignoreComments().normalizeWhitespace());
PomModel pm = appModel.getPomModel().get();
String filename = configPath.toFile().getName();
if (filename.equals("wsdl-mule3.xml")) {
assertThat(pm.getDependencies().size(), is(3));
assertWsdlDependency(pm, 2);
} else if (filename.equals("custom-processor-mule3.xml")) {
assertThat(pm.getDependencies().size(), is(3));
assertCustomProcessorDependency(pm);
} else {
assertThat(pm.getDependencies().size(), is(4));
assertCustomProcessorDependency(pm);
assertWsdlDependency(pm, 3);
}
}
use of com.mulesoft.tools.migration.project.model.pom.PomModel in project mule-migration-assistant by mulesoft.
the class ClientIdEnforcementMigrationTaskTestCase method assertPomModel.
private void assertPomModel() {
PomModel pomModel = appModel.getPomModel().get();
assertThat(pomModel.getDependencies().size(), is(4));
Dependency clientIdEnforcementDependency = pomModel.getDependencies().get(3);
assertThat(clientIdEnforcementDependency.getGroupId(), is(COM_MULESOFT_ANYPOINT_GROUP_ID));
assertThat(clientIdEnforcementDependency.getArtifactId(), is(MULE_CLIENT_ID_ENFORCEMENT_EXTENSION_ARTIFACT_ID));
assertThat(clientIdEnforcementDependency.getVersion(), is(notNullValue()));
assertThat(clientIdEnforcementDependency.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
}
use of com.mulesoft.tools.migration.project.model.pom.PomModel in project mule-migration-assistant by mulesoft.
the class FederationMigrationTaskTestCase method assertPomModel.
private void assertPomModel() {
PomModel pomModel = appModel.getPomModel().get();
assertThat(pomModel.getDependencies().size(), is(2));
Dependency httpPolicyTransformExtension = pomModel.getDependencies().get(0);
assertThat(httpPolicyTransformExtension.getGroupId(), is(COM_MULESOFT_ANYPOINT_GROUP_ID));
assertThat(httpPolicyTransformExtension.getArtifactId(), is(MULE_HTTP_POLICY_TRANSFORM_EXTENSION_ARTIFACT_ID));
assertThat(httpPolicyTransformExtension.getVersion(), is(notNullValue()));
assertThat(httpPolicyTransformExtension.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
Dependency federationExtensionDependency = pomModel.getDependencies().get(1);
assertThat(federationExtensionDependency.getGroupId(), is(COM_MULESOFT_ANYPOINT_GROUP_ID));
assertThat(federationExtensionDependency.getArtifactId(), is(MULE_FEDERATION_EXTENSION_ARTIFACT_ID));
assertThat(federationExtensionDependency.getVersion(), is(notNullValue()));
assertThat(federationExtensionDependency.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
}
use of com.mulesoft.tools.migration.project.model.pom.PomModel in project mule-migration-assistant by mulesoft.
the class ProxyResponseHeadersProcessorMigrationStepTestCase method customProcessorPomContributionTest.
@Test
public void customProcessorPomContributionTest() throws Exception {
final ProxyResponseHeadersProcessorMigrationStep step = new ProxyResponseHeadersProcessorMigrationStep();
step.setApplicationModel(appModel);
step.execute(appModel.getNode(XPATH_NODE_EXPRESSION), reportMock);
PomModel pm = appModel.getPomModel().get();
assertThat(pm.getDependencies().size(), is(1));
Dependency customProcessorDependency = pm.getDependencies().get(0);
assertThat(customProcessorDependency.getGroupId(), is(COM_MULESOFT_ANYPOINT_GROUP_ID));
assertThat(customProcessorDependency.getArtifactId(), is(MULE_HTTP_PROXY_EXTENSION_ARTIFACT_ID));
assertThat(customProcessorDependency.getVersion(), is(notNullValue()));
assertThat(customProcessorDependency.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
}
use of com.mulesoft.tools.migration.project.model.pom.PomModel in project mule-migration-assistant by mulesoft.
the class SetPropertyMigrationStepTestCase method pomContributionsInSetPropertyTest.
@Test
public void pomContributionsInSetPropertyTest() {
SetPropertyMigrationStep step = new SetPropertyMigrationStep();
step.setApplicationModel(appModel);
Element element = appModel.getNodes(XPATH_NODE_EXPRESSION).get(0);
step.execute(element, reportMock);
PomModel pm = appModel.getPomModel().get();
assertThat(pm.getDependencies().size(), is(1));
Dependency httpPolicyTransformExtension = pm.getDependencies().get(0);
assertThat(httpPolicyTransformExtension.getGroupId(), is(COM_MULESOFT_ANYPOINT_GROUP_ID));
assertThat(httpPolicyTransformExtension.getArtifactId(), is(MULE_HTTP_POLICY_TRANSFORM_EXTENSION_ARTIFACT_ID));
assertThat(httpPolicyTransformExtension.getVersion(), is(notNullValue()));
assertThat(httpPolicyTransformExtension.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
}
Aggregations