When developing financial applications for the United Kingdom market, generating realistic test data is a critical step in ensuring the integrity of transaction workflows. The mock-jutsu library provides a dedicated function for this purpose: sort_code. This utility generates a six-digit numerical string formatted in the standard XX-XX-XX pattern, which is universally recognised by British clearing houses and banking institutions. By providing accurate representations of real-world identifiers, mock-jutsu allows developers to populate their databases and testing environments with high-fidelity mock data that mirrors actual banking infrastructure.
The sort_code function follows the structural requirements of the UK banking industry, ensuring that the generated strings fit perfectly into input fields designed for BACS, CHAPS, or Faster Payments systems. Rather than relying on static or repetitive placeholders, the algorithm produces varied outputs that help identify edge cases in string parsing and validation logic. This is particularly useful when testing frontend input masks or backend regular expressions, where the presence of hyphens and specific digit lengths must be strictly enforced. Using mock-jutsu ensures your test data remains consistent across different stages of the software development lifecycle.
Integration is seamless across multiple environments, making it a versatile tool for modern DevOps teams. Developers can generate a sort_code directly through the Python API using jutsu.generate('sort_code'), while QA engineers might prefer the CLI command or the JMeter function for performance testing scenarios. This flexibility ensures that whether you are performing a simple unit test or a complex load simulation, your mock data remains reliable and standardised. By automating the creation of these banking identifiers, teams can reduce the manual effort involved in data preparation and focus on more complex logic validation.
Beyond simple field population, using the sort_code function within mock-jutsu offers significant benefits for data privacy. By using synthetic test data instead of real customer information, organisations can better comply with GDPR and other data protection regulations during the development process. This approach mitigates the risk of sensitive financial data leaks while still providing the necessary context for thorough integration testing. Ultimately, mock-jutsu provides a robust, professional solution for any developer needing to simulate the nuances of British banking systems without the overhead of manual data entry or the risks associated with production data.
mockjutsu generate sort_codemockjutsu bulk sort_code --count 10mockjutsu export sort_code --count 10 --format jsonmockjutsu export sort_code --count 10 --format csvmockjutsu export sort_code --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate sort_code --maskmockjutsu bulk sort_code --count 5 --maskfrom mockjutsu import jutsujutsu.generate('sort_code')jutsu.bulk('sort_code', count=10)jutsu.template(['sort_code'], count=5)# mask=True: regulation-compliant outputjutsu.generate('sort_code', mask=True)jutsu.bulk('sort_code', count=5, mask=True)${__mockjutsu_banking(sort_code)}# JMeter Function: __mockjutsu_banking# Parameter 1: sort_code# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_banking(sort_code,mask)}GET /generate/sort_code# → {"type":"sort_code","result":"...","status":"ok"}GET /bulk/sort_code?count=10POST /template {"types":["sort_code"],"count":1}# mask=true: regulation-compliant outputGET /generate/sort_code?mask=trueGET /bulk/sort_code?count=5&mask=true| Parameter | Values | Description |
|---|---|---|
| --mask | true | false | Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…) |