-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CU-86b35ftpj_PW-2113--parsing comments and extracting MT from multi-format message #135
CU-86b35ftpj_PW-2113--parsing comments and extracting MT from multi-format message #135
Conversation
…lti-format-message
Caution Review failedThe pull request is closed. 📝 Walkthrough<details>
<summary>📝 Walkthrough</summary>
## Walkthrough
The pull request introduces updates to the XML message handling capabilities within the software. It adds new methods for extracting comments from XML strings and for creating MT messages from multi-format inputs. The `MxParseUtils` class has been enhanced with several new parsing methods, and corresponding tests have been added to ensure functionality. Additionally, the changelog has been updated to reflect these changes, including bug fixes and enhancements across multiple versions.
## Changes
| File | Change Summary |
|----------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| `CHANGELOG.md` | Updated to include version 9.4.8 features: XML comment extraction and MT creation from multi-format messages. Documented bug fixes and updates from versions 9.4.7 to 9.5.4. |
| `iso20022-core/src/main/java/com/prowidesoftware/swift/model/mx/MxParseUtils.java` | Added methods: `parseComments`, `parseCommentsStartsWith`, `parseCommentsContains`, and `parseMtFromMultiformatMessage` to enhance XML parsing capabilities. Updated imports. |
| `iso20022-core/src/test/java/com/prowidesoftware/swift/model/mx/MxParseUtilsTest.java` | Added tests: `testParseComments`, `testParseCommentsStartsWith`, `testParseCommentsContains`, and `testParseMtFromMultiFormatMessage` to validate new parsing functionalities. Modified existing test methods for XML consistency. |
## Possibly related PRs
- #135: The changes in this PR directly relate to the addition of new APIs in the `MxParseUtils` class for extracting comments from XML and parsing multi-format messages, which aligns with the enhancements described in the main PR.
## Suggested reviewers
- zubri
</details> 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
CHANGELOG.md
(1 hunks)iso20022-core/src/main/java/com/prowidesoftware/swift/model/mx/MxParseUtils.java
(2 hunks)iso20022-core/src/test/java/com/prowidesoftware/swift/model/mx/MxParseUtilsTest.java
(4 hunks)
🧰 Additional context used
🪛 Markdownlint (0.37.0)
CHANGELOG.md
3-3: Expected: h2; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
4-4: Expected: 0; Actual: 2
Unordered list indentation
(MD007, ul-indent)
5-5: Expected: 0 or 2; Actual: 1
Trailing spaces
(MD009, no-trailing-spaces)
3-3: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines
(MD022, blanks-around-headings)
4-4: null
Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
🔇 Additional comments (1)
iso20022-core/src/test/java/com/prowidesoftware/swift/model/mx/MxParseUtilsTest.java (1)
423-426
:
Incorrect method used in testParseCommentsContents
In the testParseCommentsContents
method, you are calling parseCommentsStartsWith(xml, "TranslationResult");
, but based on the method name, it seems you intended to use parseCommentsContains
.
Please update the test to use parseCommentsContains
to accurately test the intended functionality.
- List<String> strings = MxParseUtils.parseCommentsStartsWith(xml, "TranslationResult");
+ List<String> strings = MxParseUtils.parseCommentsContains(xml, "TranslationResult");
Likely invalid or redundant comment.
iso20022-core/src/main/java/com/prowidesoftware/swift/model/mx/MxParseUtils.java
Outdated
Show resolved
Hide resolved
iso20022-core/src/main/java/com/prowidesoftware/swift/model/mx/MxParseUtils.java
Outdated
Show resolved
Hide resolved
iso20022-core/src/main/java/com/prowidesoftware/swift/model/mx/MxParseUtils.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
CHANGELOG.md
(1 hunks)iso20022-core/src/main/java/com/prowidesoftware/swift/model/mx/MxParseUtils.java
(2 hunks)iso20022-core/src/test/java/com/prowidesoftware/swift/model/mx/MxParseUtilsTest.java
(4 hunks)
🧰 Additional context used
🪛 Markdownlint (0.37.0)
CHANGELOG.md
3-3: Expected: h2; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
4-4: Expected: 0; Actual: 2
Unordered list indentation
(MD007, ul-indent)
5-5: Expected: 0; Actual: 2
Unordered list indentation
(MD007, ul-indent)
6-6: Expected: 0 or 2; Actual: 1
Trailing spaces
(MD009, no-trailing-spaces)
3-3: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines
(MD022, blanks-around-headings)
4-4: null
Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
🔇 Additional comments (4)
iso20022-core/src/main/java/com/prowidesoftware/swift/model/mx/MxParseUtils.java (2)
297-301
: Inaccurate JavaDoc: Method does not remove prefix from comments
This has already been flagged in a previous review. The JavaDoc states “removes the prefix from each matching comment,” but the implementation does not actually remove the prefix.
318-322
: Inaccurate JavaDoc: Method does not remove prefix from comments
This has also been flagged before. The JavaDoc for this method claims to remove a prefix, but the code simply filters comments based on substring.
CHANGELOG.md (1)
3-5
: 🧹 Nitpick (assertive)
Fix heading level and list indentation for consistency
The heading at line 3 should maintain a consistent level (e.g., h2), with blank lines around headings and list items.
Apply this diff to comply with common Markdown standards:
-#### 9.4.8 - SNAPSHOT
+## 9.4.8 - SNAPSHOT
- * (PW-2113) Added API in the `MxParseUtils` to extract comments from XML string
+ * (PW-2113) Added API in the `MxParseUtils` to extract comments from XML string
- * (PW-2113) Added API in the `MxParseUtils` to extract the enclosed MT from a multi-format MX message
+ * (PW-2113) Added API in the `MxParseUtils` to extract the enclosed MT from a multi-format MX message
Likely invalid or redundant comment.
🧰 Tools
🪛 Markdownlint (0.37.0)
3-3: Expected: h2; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
4-4: Expected: 0; Actual: 2
Unordered list indentation
(MD007, ul-indent)
5-5: Expected: 0; Actual: 2
Unordered list indentation
(MD007, ul-indent)
3-3: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines
(MD022, blanks-around-headings)
4-4: null
Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
iso20022-core/src/test/java/com/prowidesoftware/swift/model/mx/MxParseUtilsTest.java (1)
336-368
: Good use of representative XML snippet for coverage
The test method “testIdentifyMessage_FromBAH” offers excellent coverage by validating business service and message ID.
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests