pnr_codeAviation

Mock Jutsu HOW-TO | UK

The mock-jutsu library offers a comprehensive suite of utilities for generating realistic test data, with the pnr_code function standing out as a critical tool for developers in the aviation and travel sectors. A Passenger Name Record, or PNR, serves as the unique identifier within Global Distribution Systems (GDS) such as Amadeus, Sabre, or Travelport. By using the pnr_code generator, engineers can produce syntactically correct locators that mimic real-world booking references, ensuring that downstream systems process information without formatting errors. This capability is essential for simulating the entire passenger journey, from initial booking and reservation management to check-in and boarding gate operations.

Structurally, the pnr_code function adheres to strict industry standards by generating a six-character uppercase alphanumeric string. A key feature of this mock data generator is its intelligent exclusion of ambiguous characters. By omitting characters that are easily confused, such as '0' (zero) and 'O' (the letter), or '1' (one) and 'I' (the letter), mock-jutsu prevents common data entry errors and legibility issues that often plague manual testing environments. This adherence to the "no ambiguous characters" rule ensures that the generated test data is not only valid according to GDS logic but also reflects the high-usability standards expected in modern airline reservation systems.

Integrating this function into a professional development workflow is remarkably straightforward, whether you are working in a Python environment, using the command line, or conducting performance tests. For instance, Python developers can simply call jutsu.generate('pnr_code') to populate their objects, while QA engineers can use the CLI command "mockjutsu generate pnr_code" or the dedicated JMeter function, ${__mockjutsu(pnr_code,)}, to inject dynamic data into load tests. These varied access points make mock-jutsu a versatile choice for cross-functional teams who require consistent, high-quality mock data across different stages of the software development lifecycle.

Beyond simple data generation, the pnr_code function facilitates complex testing scenarios, such as validating search algorithms, stress-testing database indexing, and verifying third-party API integrations. Instead of relying on hardcoded values or predictable sequences, developers can leverage mock-jutsu to create a diverse pool of unique locators. This approach significantly reduces the risk of collisions in test databases and ensures that edge cases—such as codes containing specific combinations of numbers and letters—are thoroughly vetted. Ultimately, using mock-jutsu to generate pnr_code values empowers teams to build more resilient travel technology while accelerating the time-to-market for new features.

CLI Usage
mockjutsu generate pnr_codemockjutsu bulk pnr_code --count 10mockjutsu export pnr_code --count 10 --format jsonmockjutsu export pnr_code --count 10 --format csvmockjutsu export pnr_code --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate pnr_code --maskmockjutsu bulk pnr_code --count 5 --mask
Python API
from mockjutsu import jutsujutsu.generate('pnr_code')jutsu.bulk('pnr_code', count=10)jutsu.template(['pnr_code'], count=5)# mask=True: regulation-compliant outputjutsu.generate('pnr_code', mask=True)jutsu.bulk('pnr_code', count=5, mask=True)
JMeter
${__mockjutsu_aviation(pnr_code)}# JMeter Function: __mockjutsu_aviation# Parameter 1: pnr_code# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_aviation(pnr_code,mask)}
REST API
GET /generate/pnr_code# → {"type":"pnr_code","result":"...","status":"ok"}GET /bulk/pnr_code?count=10POST /template {"types":["pnr_code"],"count":1}# mask=true: regulation-compliant outputGET /generate/pnr_code?mask=trueGET /bulk/pnr_code?count=5&mask=true

Parameters

Parameter Values Description
--mask true | false Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…)

Other Languages