swiftBankingLocale Aware

Mock Jutsu HOW-TO | UK

The swift function within the mock-jutsu library is a specialised tool designed for developers and QA engineers working within the global financial sector. It generates high-quality mock data representing Business Identifier Codes (BIC), commonly known as SWIFT codes. By strictly adhering to the ISO 9362 standard, this utility ensures that every generated string mimics the structure of real-world banking identifiers, such as the example "DEUTDEDB". Whether you are building a cross-border payment platform or a simple banking dashboard, having access to reliable test data is essential for verifying system integrity without compromising sensitive production information.

Under the hood, the generator meticulously follows the ISO 9362 specifications, which dictate a standard 8 or 11-character format. This structure includes a four-letter institution code, a two-letter ISO country code, and a two-character location code, often followed by an optional three-character branch code. By incorporating these logical constraints, mock-jutsu provides swift codes that pass front-end validation patterns and back-end regular expressions. This technical accuracy prevents false negatives during automated testing cycles and ensures that the data flow within your application remains consistent with international banking protocols.

In terms of practical testing scenarios, the swift function is indispensable for stress-testing international wire transfer modules and validating clearinghouse integration logic. Developers can use mock-jutsu to populate databases with thousands of unique entries, allowing for comprehensive performance benchmarking of financial datasets. It is also highly effective for testing error-handling routines, such as ensuring that your application correctly parses different country codes or handles optional branch suffixes. By using realistic test data, teams can identify edge cases in their payment routing logic long before the code reaches a production environment.

The versatility of mock-jutsu allows for seamless integration into various development workflows. For those preferring automation, the Python implementation via jutsu.generate('swift') enables dynamic data generation within unit tests. Meanwhile, DevOps engineers can leverage the CLI tool for quick data seeding, and performance testers can utilise the JMeter plugin to simulate high-load banking transactions. This multi-platform support, combined with the precision of the generated swift codes, empowers developers to build more robust, secure, and reliable financial software with significantly reduced manual effort.

CLI Usage
mockjutsu generate swift --locale TRmockjutsu generate swift --locale DEmockjutsu bulk swift --count 10 --locale TRmockjutsu export swift --count 10 --format json --locale TRmockjutsu export swift --count 10 --format csv --locale TRmockjutsu export swift --count 10 --format sql --locale TR
Python API
from mockjutsu import jutsujutsu.generate('swift', locale='TR')jutsu.bulk('swift', count=10, locale='TR')jutsu.template(['swift'], count=5, locale='TR')
JMeter
${__mockjutsu_banking(swift,TR)}# JMeter Function: __mockjutsu_banking# Parameter 1: swift# Parameter 2: locale (TR/UK/US/DE/FR/RU)${__mockjutsu_banking(swift,DE)}
REST API
GET /generate/swift?locale=TR# → {"type":"swift","result":"...","status":"ok"}GET /bulk/swift?count=10&locale=TRPOST /template {"types":["swift"],"count":1,"locale":"TR"}

Parameters

Parameter Values Description
--locale TR|UK|US|DE|FR|RU Region / locale for locale-aware output

Other Languages