use of com.mulesoft.tools.migration.project.model.pom.Dependency in project mule-migration-assistant by mulesoft.
the class ProxyRequestHeadersProcessorMigrationStepTestCase method migrateElementAndPomTest.
@Test
public void migrateElementAndPomTest() throws Exception {
final ProxyRequestHeadersProcessorMigrationStep step = new ProxyRequestHeadersProcessorMigrationStep();
Element element = appModel.getNode(XPATH_NODE_EXPRESSION);
step.setApplicationModel(appModel);
step.execute(element, reportMock);
assertThat(element.getName(), is(REQUEST_HEADERS));
assertThat(element.getNamespace(), is(PROXY_NAMESPACE));
assertThat(element.getAttributes().size(), is(2));
assertThat(element.getAttribute(CONFIG_REF).getValue(), is(PROXY_CONFIG));
assertThat(element.getAttribute(TARGET).getValue(), is(PROXY_REQUEST_HEADERS));
assertThat(element.getContent().size(), is(0));
assertConfigElement(element);
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.Dependency in project mule-migration-assistant by mulesoft.
the class ProxyResponseHeadersProcessorMigrationStepTestCase method migrateElementAndPomTest.
@Test
public void migrateElementAndPomTest() throws Exception {
final ProxyResponseHeadersProcessorMigrationStep step = new ProxyResponseHeadersProcessorMigrationStep();
Element element = appModel.getNode(XPATH_NODE_EXPRESSION);
step.setApplicationModel(appModel);
step.execute(element, reportMock);
assertThat(element.getName(), is(RESPONSE_HEADERS));
assertThat(element.getNamespace(), is(PROXY_NAMESPACE));
assertThat(element.getAttributes().size(), is(2));
assertThat(element.getAttribute(CONFIG_REF).getValue(), is(PROXY_CONFIG));
assertThat(element.getAttribute(TARGET).getValue(), is(PROXY_RESPONSE_HEADERS));
assertThat(element.getContent().size(), is(0));
assertConfigElement(element);
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.Dependency in project mule-migration-assistant by mulesoft.
the class IpFilterPomContributionMigrationStepTestCase method pomContributionTest.
@Test
public void pomContributionTest() {
PomModel pm = new PomModel();
IpFilterPomContributionMigrationStep step = new IpFilterPomContributionMigrationStep();
step.execute(pm, reportMock);
assertThat(pm.getDependencies().size(), is(1));
Dependency ipFilterExtension = pm.getDependencies().get(0);
assertThat(ipFilterExtension.getGroupId(), is(COM_MULESOFT_ANYPOINT_GROUP_ID));
assertThat(ipFilterExtension.getArtifactId(), is(MULE_IP_FILTER_EXTENSION_ARTIFACT_ID));
assertThat(ipFilterExtension.getVersion(), is(notNullValue()));
assertThat(ipFilterExtension.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
}
use of com.mulesoft.tools.migration.project.model.pom.Dependency in project mule-migration-assistant by mulesoft.
the class HttpTransformPomContributionMigrationStepTestCase method pomContributionTest.
@Test
public void pomContributionTest() {
PomModel pm = new PomModel();
HttpTransformPomContributionMigrationStep step = new HttpTransformPomContributionMigrationStep();
step.execute(pm, mock(MigrationReport.class));
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));
}
use of com.mulesoft.tools.migration.project.model.pom.Dependency in project mule-migration-assistant by mulesoft.
the class DWWsdlPropertyAttributeValueMigrationStepTestCase method wsdlPomContributionTest.
@Test
public void wsdlPomContributionTest() throws Exception {
final DWWsdlPropertyAttributeValueMigrationStep step = new DWWsdlPropertyAttributeValueMigrationStep();
step.setApplicationModel(appModel);
Element element = appModel.getNode(XPATH_NODE_EXPRESSION);
step.execute(element, reportMock);
PomModel pm = appModel.getPomModel().get();
assertThat(pm.getDependencies().size(), is(1));
Dependency wsdlExtensionDependency = pm.getDependencies().get(0);
assertThat(wsdlExtensionDependency.getGroupId(), is(COM_MULESOFT_ANYPOINT_GROUP_ID));
assertThat(wsdlExtensionDependency.getArtifactId(), is(MULE_WSDL_FUNCTIONS_EXTENSION_ARTIFACT_ID));
assertThat(wsdlExtensionDependency.getVersion(), is(notNullValue()));
assertThat(wsdlExtensionDependency.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
assertThat(element.getAttributeValue(PORT_ATTRIBUTE), is(EXPECTED_FUNCTION_PORT));
assertThat(element.getAttributeValue(HOST_ATTRIBUTE), is(EXPECTED_FUNCTION_HOST));
}
Aggregations