The phone function within the mock-jutsu library is a robust tool designed for developers and QA engineers who require realistic contact information for their software environments. By producing a full E.164 formatted telephone number, this feature ensures that your mock data adheres to the international standard for public switched telephone networks. Whether you are building a global communications platform or a simple user registration form, having access to validly structured strings like +905325551234 is essential for maintaining the integrity and realism of your development and staging databases.
Under the hood, the mock-jutsu algorithm generates strings that include the mandatory plus sign prefix, followed by a country code, area code, and subscriber number. Because it strictly follows the E.164 specification, the resulting test data is limited to a maximum of fifteen digits, ensuring compatibility with modern telecommunications infrastructure and validation logic. This level of precision allows engineering teams to bypass the manual creation of static spreadsheets and instead rely on mock-jutsu to provide consistent, high-quality inputs that mirror real-world connectivity across various geographic regions.
In terms of practical application, the phone function is invaluable for several critical testing scenarios. It is particularly useful when validating SMS gateway integrations, testing multi-factor authentication (MFA) workflows that require mobile verification, or populating CRM databases for stress and load testing. By utilising this function, developers can ensure their applications correctly handle international dialling codes and varying number lengths, which is a vital step in preventing validation errors during the production rollout of globalised software products.
One of the primary benefits of using mock-jutsu for generating phone information is its seamless cross-platform versatility. Developers can quickly trigger the function via the CLI for rapid prototyping with "mockjutsu generate phone", integrate it directly into Python scripts using "jutsu.generate('phone')", or even leverage it within JMeter performance tests using the custom function syntax. This flexibility streamlines the CI/CD pipeline, allowing for the automated generation of test data that is both syntactically correct and contextually relevant. By automating the creation of these identifiers, teams can focus on refining core logic rather than manual data entry, significantly reducing the overall time-to-market.
mockjutsu generate phone --locale TRmockjutsu generate phone --locale DEmockjutsu bulk phone --count 10 --locale TRmockjutsu export phone --count 10 --format json --locale TRmockjutsu export phone --count 10 --format csv --locale TRmockjutsu export phone --count 10 --format sql --locale TR# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate phone --locale TR --maskmockjutsu bulk phone --count 5 --locale TR --maskfrom mockjutsu import jutsujutsu.generate('phone', locale='TR')jutsu.bulk('phone', count=10, locale='TR')jutsu.template(['phone'], count=5, locale='TR')# mask=True: regulation-compliant outputjutsu.generate('phone', locale='TR', mask=True)jutsu.bulk('phone', count=5, locale='TR', mask=True)${__mockjutsu_comm(phone,TR)}# JMeter Function: __mockjutsu_comm# Parameter 1: phone# Parameter 2: locale (TR/UK/US/DE/FR/RU)${__mockjutsu_comm(phone,DE)}# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_comm(phone,TR,mask)}GET /generate/phone?locale=TR# → {"type":"phone","result":"...","status":"ok"}GET /bulk/phone?count=10&locale=TRPOST /template {"types":["phone"],"count":1,"locale":"TR"}# mask=true: regulation-compliant outputGET /generate/phone?locale=TR&mask=trueGET /bulk/phone?count=5&locale=TR&mask=true| Parameter | Values | Description |
|---|---|---|
| --locale | TR|UK|US|DE|FR|RU | Region / locale for locale-aware output |
| --mask | true | false | Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…) |