Add Shipping faker for logistics and tracking data - #26
Merged
Conversation
Implement comprehensive Shipping faker module to generate realistic shipping and logistics test data including: - Tracking numbers for major carriers (UPS, FedEx, USPS, DHL) - Shipping methods, statuses, and package types - Package dimensions, weights, and costs - Delivery dates and time windows - Facility locations and tracking events - Handling instructions and exception types Includes 32 test cases with full coverage of all methods.
Pull Request Test Coverage Report for Build 21816861209Details
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
Shippingfaker module for generating realistic shipping and logistics test data. This feature is useful for testing e-commerce order fulfillment systems, shipping carrier integrations, package tracking interfaces, warehouse management systems, and logistics/delivery applications.What's Included
Data Generation Methods (33 total)
Carrier Information:
carrier()- Shipping carrier names (UPS, FedEx, USPS, DHL, etc.)shippingMethod()- Shipping methods (Standard Ground, Express, Overnight, etc.)Tracking:
trackingNumber()- Random carrier-appropriate tracking numbertrackingNumberUps()- UPS format (1Z + 16 chars)trackingNumberFedEx()- FedEx format (####-####-####)trackingNumberUsps()- USPS format (22 digits)trackingNumberDhl()- DHL format (10 digits)trackingEvent()- Realistic tracking event messagesPackage Details:
packageType()- Package types (Box, Envelope, Tube, etc.)weight()/weightFormatted()- Package weights with unitsdimensions()/dimensionValues()- Package dimensions (L x W x H)barcode()- Package barcode numbersShipping Costs & Dates:
shippingCost()/shippingCostFormatted()- Shipping costs as BigDecimal or formatted stringsestimatedDeliveryDate()- Delivery dates 3-14 days aheadshipDate()- Ship dates within last 7 daysdeliveryDateTime()- Actual delivery timestampsdeliveryWindow()- Delivery time windows (e.g., "2:00 PM - 6:00 PM")Status & Operations:
status()- Shipping statuses (pending, in_transit, delivered, etc.)handlingInstruction()- Handling instructions (Fragile, Signature Required, etc.)exceptionType()- Delivery exceptions (Weather Delay, Address Unknown, etc.)facilityLocation()- Facility names for tracking updateszone()- Shipping zones (1-8)Additional Features:
shipmentId()- Order/shipment IDs (SHP-YYYYMMDD-ABC123)referenceNumber()- PO/order reference numbersinsuredValue()/codAmount()- Monetary valuessignatureRequired()/hazardousMaterials()- Boolean flagsFiles Changed
src/main/java/org/thejavaguy/javafaker/Shipping.java- Main implementationsrc/main/resources/en/shipping.yml- Data configurationsrc/test/java/org/thejavaguy/javafaker/ShippingTest.java- 32 comprehensive testssrc/main/java/org/thejavaguy/javafaker/Faker.java- Registrationsrc/main/java/org/thejavaguy/javafaker/service/files/EnFile.java- YAML file registrationTest Coverage
All 32 tests passing with validation for:
Example Usage
Test Results