-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e2ea97
commit 537037c
Showing
4 changed files
with
93 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...src/test/java/com/mulesoft/tools/migration/e2e/SecureConfigPropertyMigrationTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...-tool-e2e-tests/src/test/resources/e2e/secure-property/input/src/main/app/mule-config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
42 changes: 42 additions & 0 deletions
42
...migration-tool-e2e-tests/src/test/resources/e2e/secure-property/output/report/report.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": [] | ||
} | ||
] |