Skip to content

Commit

Permalink
DW-983: Add test for fix-563 (#582)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomoDC authored and jesica-fera committed Mar 14, 2022
1 parent 7e2ea97 commit 537037c
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 1 deletion.
2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ This section describes some problems you might experience using Maven and how to
|Slow build | - |If you know your downloads are up-to-date, you can use the offline option using the following command: `mvn -o` |
| Conflicting transitive dependencies | Transitive dependencies in m2 are both powerful and problematic at times. For example, you may have conflicting library versions or when unwanted libraries are in your classpath.| Use the debug option to display the effective classpath in a tree format, making it easy to see where each library is coming from: `mvn -x` |
| Running a goal for a specific project| By default, Maven execute a goal for a project and all sub-projects in its hierarchy. | If you want to run the goal for a specific project only (and not its children), you can use the non-recursive option: `mvn -N` |
| Debugging test failures | Surefire, the default Maven test runner, outputs all reports as a set of XML and text files. Any test failure details and stack traces are written to those files instead of the console, so it can be time consuming to open files to find problems. | You can redirect the output to the console temporarily by adding the following option: `mvn -Dsurefire.useFile=false`. This option skips creation ofthe text report, but still makes the XML report available for transformation by tools. |
| Debugging test failures | Surefire, the default Maven test runner, outputs all reports as a set of XML and text files. Any test failure details and stack traces are written to those files instead of the console, so it can be time consuming to open files to find problems. | You can redirect the output to the console temporarily by adding the following option: `mvn -Dsurefire.useFile=false`. This option skips creation of the text report, but still makes the XML report available for transformation by tools. |
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2020, Mulesoft, LLC. All rights reserved.
* Use of this source code is governed by a BSD 3-Clause License
* license that can be found in the LICENSE.txt file.
*/
package com.mulesoft.tools.migration.e2e;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;


@RunWith(Parameterized.class)
public class SecureConfigPropertyMigrationTestCase extends AbstractEndToEndTestCase {

@Parameters(name = "{0}")
public static Object[] params() {
return new Object[] {
"secure-property"
};
}

private final String appToMigrate;

public SecureConfigPropertyMigrationTestCase(String appToMigrate) {
this.appToMigrate = appToMigrate;
}

@Test
public void test() throws Exception {
simpleCase(appToMigrate);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:secure-property-placeholder="http://www.mulesoft.org/schema/mule/secure-property-placeholder" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/secure-property-placeholder http://www.mulesoft.org/schema/mule/secure-property-placeholder/current/mule-secure-property-placeholder.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
<secure-property-placeholder:config name="Secure_Property_Placeholder" encryptionAlgorithm="Blowfish" encryptionMode="OFB" key="qfefdsvcefqewfdsaf" location="app.property" doc:name="Secure Property Placeholder"/>
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
<flow name="sec-config-propFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<logger message="${password}" level="INFO" doc:name="Logger"/>
</flow>
</mule>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"level": "WARN",
"lineNumber": 4,
"columnNumber": 111,
"message": "In Mule 4, property keys referencing secure properties must contain the 'secure::' prefix. For example, a secure property called 'db.password' must be referenced as ${secure::db.password}. Review the usage of the secure properties defined in the referenced file and add the 'secure::' prefix accordingly.",
"filePath": "src/main/mule/mule-config.xml",
"documentationLinks": []
},
{
"level": "WARN",
"lineNumber": 18,
"columnNumber": 113,
"message": "Avoid using an outbound property to determine the status code.",
"filePath": "src/main/mule/mule-config.xml",
"documentationLinks": []
},
{
"level": "WARN",
"lineNumber": 24,
"columnNumber": 141,
"message": "Avoid using an outbound property to determine the status code.",
"filePath": "src/main/mule/mule-config.xml",
"documentationLinks": []
},
{
"level": "WARN",
"lineNumber": 32,
"columnNumber": 57,
"message": "Expressions that query 'inboundProperties' from the message should instead query the message 'attributes'. Remove this component if there are no uses of 'inboundProperties' in expressions or components that rely on 'inboundProperties' (such as 'copy-properties').",
"filePath": "src/main/mule/mule-config.xml",
"documentationLinks": []
},
{
"level": "WARN",
"lineNumber": 41,
"columnNumber": 51,
"message": "Instead of using outbound properties in the flow, move the expression that sets the property into the XML attribute (such as 'method') of the operation or listener that accepts the expression.",
"filePath": "src/main/mule/mule-config.xml",
"documentationLinks": []
}
]

0 comments on commit 537037c

Please sign in to comment.