The mt940 function within the mock-jutsu library is a specialized tool designed for developers and QA engineers who need to simulate financial messaging environments. This function generates realistic SWIFT MT940 bank statements, which serve as the international standard for electronic account balance and transaction reporting. By producing high-fidelity mock data that includes critical fields such as :20: for the transaction reference, :25: for account identification, and :28C: for the statement number, mock-jutsu ensures that your integration tests accurately reflect real-world banking scenarios. The generated output strictly adheres to the MT940 structure, including the :60F: opening balance, :61: statement lines, :86: information to the account owner, and the :62F: closing balance tags.
Technical accuracy is paramount when dealing with financial test data. The mt940 function implements a robust algorithm to ensure that every generated statement is syntactically correct and compliant with SWIFT standards. A key feature of this function is its adherence to specific formatting rules, such as using the comma as a decimal separator—formatting values like 500,00—which is the standard in many international banking jurisdictions. Each execution produces a statement containing a randomized sequence of two to five transactions. This built-in variability is essential for testing reconciliation logic and ensuring that your software can handle different volumes of data within a single message. Whether you are using the CLI command "mockjutsu generate mt940" or the Python syntax "jutsu.generate('mt940')", the library delivers consistent, high-quality results for your development pipeline.
For engineers building ERP systems, accounting software, or core banking platforms, the ability to generate reliable mt940 test data offers significant developer benefits. Using mock-jutsu eliminates the security risks and compliance hurdles associated with using sensitive production data for testing purposes. It allows teams to simulate various banking scenarios, such as complex credits and debits, within a controlled and repeatable environment. Furthermore, the JMeter integration via the ${__mockjutsu(mt940,)} function enables seamless performance testing of financial ingestion pipelines. By automating the creation of these complex text files, developers can focus on building robust parsing logic and sophisticated error-handling routines, significantly accelerating the software development lifecycle while maintaining the highest standards of data integrity.
mockjutsu generate mt940 --locale TRmockjutsu generate mt940 --locale DEmockjutsu bulk mt940 --count 10 --locale TRmockjutsu export mt940 --count 10 --format json --locale TRmockjutsu export mt940 --count 10 --format csv --locale TRmockjutsu export mt940 --count 10 --format sql --locale TRfrom mockjutsu import jutsujutsu.generate('mt940', locale='TR')jutsu.bulk('mt940', count=10, locale='TR')jutsu.template(['mt940'], count=5, locale='TR')${__mockjutsu_bank_statement(mt940,TR)}# JMeter Function: __mockjutsu_bank_statement# Parameter 1: mt940# Parameter 2: locale (TR/UK/US/DE/FR/RU)${__mockjutsu_bank_statement(mt940,DE)}GET /generate/mt940?locale=TR# → {"type":"mt940","result":"...","status":"ok"}GET /bulk/mt940?count=10&locale=TRPOST /template {"types":["mt940"],"count":1,"locale":"TR"}| Parameter | Values | Description |
|---|---|---|
| --locale | TR|UK|US|DE|FR|RU | Region / locale for locale-aware output |