You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Step 3: Click the User Serviceand hit the login URL to get the token.**
1059
+
**Step 3: Before sending any requests, ensure you have generated a JWT token. Click on User Service. Use the Login API and enter the following credentials: `Username: admin` and `Password: admin123`. After a successful login, you will receive a JWT token. Copy the token and paste it into your Environment settings.**
**Step 2: Once you provide the input, you will see a response. This means we are able to reach your application and are now ready to generate tests. We’re just performing a validation before generating the test cases.**
1382
1385
1383
-
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy_api_testing_3.png" alt="Sample Keploy Record Microservices" />
1386
+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy_initial_curl_validate.png" alt="Sample Keploy Record Microservices" />
1384
1387
1385
1388
**Step 3: Next, it’s time to provide the input — such as cURL commands, Postman collections, or an OpenAPI schema. Remember, the more input or content you provide, the better your test cases will be. For this demo, we’ll use Postman collections and cURL commands.**
1386
1389
@@ -2353,7 +2356,7 @@ code={`
2353
2356
2354
2357
/>
2355
2358
2356
-
Paste the collections in the postman collections section.
2359
+
_Paste the collections in the postman collections section._
2357
2360
2358
2361
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy_api_testing_4.png" alt="Sample Keploy Record Microservices" />
2359
2362
@@ -2495,11 +2498,261 @@ curl --request GET \
2495
2498
}
2496
2499
/>
2497
2500
2498
-
Paste the cURL commands in the cURL section.
2501
+
_Paste the cURL commands in the cURL section._
2499
2502
2500
2503
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy_api_testing_5.png" alt="Sample Keploy Record Microservices" />
2501
2504
2502
-
**Step 4: Before generating the test, review and confirm the generation settings. In this example, the port has been changed to 8083, meaning the application gateway runs on 8083 to access all the services.**
2505
+
**Also copy the openapi schema for the order service**
2506
+
2507
+
<CollapsibleCode
2508
+
language="curl"
2509
+
previewLines={10}
2510
+
code={`
2511
+
2512
+
openapi: 3.1.0
2513
+
info:
2514
+
title: Order Service API
2515
+
version: 1.0.0
2516
+
components:
2517
+
securitySchemes:
2518
+
bearerAuth:
2519
+
type: http
2520
+
scheme: bearer
2521
+
bearerFormat: JWT
2522
+
security:
2523
+
2524
+
- bearerAuth: []
2525
+
paths:
2526
+
/api/v1/orders:
2527
+
post:
2528
+
summary: Create order
2529
+
parameters: - in: header
2530
+
name: Idempotency-Key
2531
+
required: false
2532
+
schema:
2533
+
type: string
2534
+
maxLength: 64
2535
+
description: Prevent duplicate order creation. If provided, repeated requests return the same order.
2536
+
requestBody:
2537
+
required: true
2538
+
content:
2539
+
application/json:
2540
+
schema:
2541
+
type: object
2542
+
required: - userId - items
2543
+
properties:
2544
+
userId:
2545
+
type: string
2546
+
items:
2547
+
type: array
2548
+
items:
2549
+
type: object
2550
+
required: - productId - quantity
2551
+
properties:
2552
+
productId:
2553
+
type: string
2554
+
quantity:
2555
+
type: integer
2556
+
minimum: 1
2557
+
shippingAddressId:
2558
+
type: string
2559
+
nullable: true
2560
+
responses:
2561
+
'201':
2562
+
description: Created
2563
+
content:
2564
+
application/json:
2565
+
schema:
2566
+
type: object
2567
+
properties:
2568
+
id:
2569
+
type: string
2570
+
status:
2571
+
type: string
2572
+
enum: [PENDING, PAID, CANCELLED]
2573
+
'200':
2574
+
description: Returned existing order for idempotent request
2575
+
'400':
2576
+
description: Bad request
2577
+
'503':
2578
+
description: Dependency unavailable
2579
+
get:
2580
+
summary: List orders
2581
+
parameters: - in: query
2582
+
name: userId
2583
+
schema:
2584
+
type: string - in: query
2585
+
name: status
2586
+
schema:
2587
+
type: string
2588
+
enum: [PENDING, PAID, CANCELLED] - in: query
2589
+
name: limit
2590
+
schema:
2591
+
type: integer
2592
+
minimum: 1
2593
+
maximum: 100
2594
+
default: 20 - in: query
2595
+
name: cursor
2596
+
schema:
2597
+
type: string
2598
+
responses:
2599
+
'200':
2600
+
description: OK
2601
+
content:
2602
+
application/json:
2603
+
schema:
2604
+
type: object
2605
+
properties:
2606
+
orders:
2607
+
type: array
2608
+
items:
2609
+
type: object
2610
+
properties:
2611
+
id:
2612
+
type: string
2613
+
user_id:
2614
+
type: string
2615
+
status:
2616
+
type: string
2617
+
total_amount:
2618
+
type: number
2619
+
created_at:
2620
+
type: string
2621
+
format: date-time
2622
+
nextCursor:
2623
+
type: string
2624
+
nullable: true
2625
+
/api/v1/orders/{orderId}:
2626
+
get:
2627
+
summary: Get order by ID
2628
+
parameters: - in: path
2629
+
name: orderId
2630
+
required: true
2631
+
schema:
2632
+
type: string
2633
+
responses:
2634
+
'200':
2635
+
description: OK
2636
+
content:
2637
+
application/json:
2638
+
schema:
2639
+
type: object
2640
+
properties:
2641
+
id:
2642
+
type: string
2643
+
user_id:
2644
+
type: string
2645
+
status:
2646
+
type: string
2647
+
total_amount:
2648
+
type: number
2649
+
shipping_address_id:
2650
+
type: string
2651
+
nullable: true
2652
+
created_at:
2653
+
type: string
2654
+
format: date-time
2655
+
updated_at:
2656
+
type: string
2657
+
format: date-time
2658
+
items:
2659
+
type: array
2660
+
items:
2661
+
type: object
2662
+
properties:
2663
+
product_id:
2664
+
type: string
2665
+
quantity:
2666
+
type: integer
2667
+
price:
2668
+
type: number
2669
+
'404':
2670
+
description: Not found
2671
+
/api/v1/orders/{orderId}/details:
2672
+
get:
2673
+
summary: Get order by ID with enriched user and product details
_Also Paste the OpenAPI schema into the Schema Document section. Once completed, you will be able to view the schema coverage._
2752
+
2753
+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy_microservices_schema_Coverage.png" alt="Sample Keploy Record Microservices" />
2754
+
2755
+
**Step 4: After providing the OpenAPI schema, cURL commands, and Postman collection, click the Generate API Tests button. Then, review and confirm the generation settings. In this example, the port is changed to 8083, which means the application gateway will run on port 8083 to access all services.**
2503
2756
2504
2757
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy_api_testing_6.png" alt="Sample Keploy Record Microservices" />
0 commit comments