Summary| Tags| Feature: api/event-and-tier-happy-path/event-and-tier-happy-path.feature| Ticketing MVP - Event and Tier Creation Happy Path As a Ticketing MVP automation I want to validate the happy path for creating events and tiers So that I can verify the basic configuration capabilities of the system
Scenario: [1:14] Scenario 1 - Create an event with valid data within max capacity (TC-001)
ms: 431
>>
Background:
7
* def baseUrlEvents = karate.properties['baseUrlEvents'] || 'http://localhost:8081'
2
22:50:35.700 karate.env system property was: null
8
* def UUID = Java.type('java.util.UUID')
2
9
* def eventTitle1 = 'Karate Event 1 ' + UUID.randomUUID()
21
10
* def eventTitle2 = 'Karate Event 2 ' + UUID.randomUUID()
1
11
* def futureDate = '2026-12-15T20:00:00'
0
# Setup: Create Room (maxCapacity=300)
16
Given url baseUrlEvents + '/api/v1/rooms'
0
17
And header X-Role = 'ADMIN'
0
18
And header X-User-Id = '00000000-0000-0000-0000-000000000001'
0
19
And request
29
{ "name": "Sala Principal TC-001", "maxCapacity": 300 }
26
When method post
271
22:50:35.917 request: 1 > POST http://localhost:8081/api/v1/rooms 1 > X-Role: ADMIN 1 > X-User-Id: 00000000-0000-0000-0000-000000000001 1 > Content-Type: application/json; charset=UTF-8 1 > Content-Length: 50 1 > Host: localhost:8081 1 > Connection: Keep-Alive 1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.17) 1 > Accept-Encoding: gzip,deflate {"name":"Sala Principal TC-001","maxCapacity":300} 22:50:36.055 response time in milliseconds: 136 1 < 201 1 < Content-Type: application/json 1 < Transfer-Encoding: chunked 1 < Date: Wed, 08 Apr 2026 03:50:36 GMT 1 < Keep-Alive: timeout=60 1 < Connection: keep-alive {"id":"ba3de976-0ede-4b98-8472-a3fde8c3d56c","name":"Sala Principal TC-001","maxCapacity":300,"created_at":"2026-04-08T03:50:36.012199221","updated_at":"2026-04-08T03:50:36.012213499"}
27
Then status 201
0
28
* def roomId = response.id ? response.id : response.roomId
1
# TC-001: Create event with capacity=250 (<= 300)
31
Given url baseUrlEvents + '/api/v1/events'
0
32
And header X-Role = 'ADMIN'
0
33
And header X-User-Id = '00000000-0000-0000-0000-000000000001'
0
34
And request
1
{ "roomId": "#(roomId)", "title": "#(eventTitle1)", "description": "Event for TC-001", "date": "#(futureDate)", "capacity": 250, "enableSeats": false }
45
When method post
82
22:50:36.061 request: 2 > POST http://localhost:8081/api/v1/events 2 > X-Role: ADMIN 2 > X-User-Id: 00000000-0000-0000-0000-000000000001 2 > Content-Type: application/json; charset=UTF-8 2 > Content-Length: 208 2 > Host: localhost:8081 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.17) 2 > Accept-Encoding: gzip,deflate {"roomId":"ba3de976-0ede-4b98-8472-a3fde8c3d56c","title":"Karate Event 1 09a14218-31e5-421b-9852-d8c243b1b54a","description":"Event for TC-001","date":"2026-12-15T20:00:00","capacity":250,"enableSeats":false} 22:50:36.141 response time in milliseconds: 80 2 < 201 2 < Content-Type: application/json 2 < Transfer-Encoding: chunked 2 < Date: Wed, 08 Apr 2026 03:50:36 GMT 2 < Keep-Alive: timeout=60 2 < Connection: keep-alive {"id":"ebd57ffa-610b-4667-b8f9-1c1317a58362","roomId":"ba3de976-0ede-4b98-8472-a3fde8c3d56c","title":"Karate Event 1 09a14218-31e5-421b-9852-d8c243b1b54a","description":"Event for TC-001","date":"2026-12-15T20:00:00","capacity":250,"status":"DRAFT","createdAt":"2026-04-08T03:50:36.113823319","updatedAt":"2026-04-08T03:50:36.113893846","createdBy":"00000000-0000-0000-0000-000000000001","imageUrl":null,"subtitle":null,"location":null,"director":null,"castMembers":null,"duration":null,"tag":null,"isLimited":false,"isFeatured":false,"enableSeats":false,"author":null}
46
Then status 201
0
47
* match response.title == eventTitle1
14
48
* match response.capacity == 250
2
49
* match response.date contains '2026-12-15T20:00'
1
50
* match response.roomId == roomId
1
51
* print 'Event successfully persisted with valid capacity (250/300)'
1
22:50:36.160 [print] Event successfully persisted with valid capacity (250/300)
Scenario: [2:54] Scenario 2 - Configure three tiers on an existing event (TC-005)
ms: 128
>>
Background:
7
* def baseUrlEvents = karate.properties['baseUrlEvents'] || 'http://localhost:8081'
1
22:50:36.166 karate.env system property was: null
8
* def UUID = Java.type('java.util.UUID')
1
9
* def eventTitle1 = 'Karate Event 1 ' + UUID.randomUUID()
1
10
* def eventTitle2 = 'Karate Event 2 ' + UUID.randomUUID()
1
11
* def futureDate = '2026-12-15T20:00:00'
0
# Setup: Create Room (maxCapacity=300)
56
Given url baseUrlEvents + '/api/v1/rooms'
0
57
And header X-Role = 'ADMIN'
0
58
And header X-User-Id = '00000000-0000-0000-0000-000000000001'
0
59
And request
0
{ "name": "Sala Principal TC-005", "maxCapacity": 300 }
66
When method post
14
22:50:36.174 request: 1 > POST http://localhost:8081/api/v1/rooms 1 > X-Role: ADMIN 1 > X-User-Id: 00000000-0000-0000-0000-000000000001 1 > Content-Type: application/json; charset=UTF-8 1 > Content-Length: 50 1 > Host: localhost:8081 1 > Connection: Keep-Alive 1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.17) 1 > Accept-Encoding: gzip,deflate {"name":"Sala Principal TC-005","maxCapacity":300} 22:50:36.187 response time in milliseconds: 13 1 < 201 1 < Content-Type: application/json 1 < Transfer-Encoding: chunked 1 < Date: Wed, 08 Apr 2026 03:50:36 GMT 1 < Keep-Alive: timeout=60 1 < Connection: keep-alive {"id":"253e8b5f-8877-4588-ae61-71ef327a65de","name":"Sala Principal TC-005","maxCapacity":300,"created_at":"2026-04-08T03:50:36.177814349","updated_at":"2026-04-08T03:50:36.177832395"}
67
Then status 201
0
68
* def roomId = response.id ? response.id : response.roomId
0
# Setup: Create event with capacity=300
71
Given url baseUrlEvents + '/api/v1/events'
0
72
And header X-Role = 'ADMIN'
0
73
And header X-User-Id = '00000000-0000-0000-0000-000000000001'
0
74
And request
1
{ "roomId": "#(roomId)", "title": "#(eventTitle2)", "description": "Event for TC-005", "date": "#(futureDate)", "capacity": 300, "enableSeats": false }
85
When method post
20
22:50:36.190 request: 2 > POST http://localhost:8081/api/v1/events 2 > X-Role: ADMIN 2 > X-User-Id: 00000000-0000-0000-0000-000000000001 2 > Content-Type: application/json; charset=UTF-8 2 > Content-Length: 208 2 > Host: localhost:8081 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.17) 2 > Accept-Encoding: gzip,deflate {"roomId":"253e8b5f-8877-4588-ae61-71ef327a65de","title":"Karate Event 2 ce2eac95-4799-48d8-9035-6929acacbf86","description":"Event for TC-005","date":"2026-12-15T20:00:00","capacity":300,"enableSeats":false} 22:50:36.208 response time in milliseconds: 18 2 < 201 2 < Content-Type: application/json 2 < Transfer-Encoding: chunked 2 < Date: Wed, 08 Apr 2026 03:50:36 GMT 2 < Keep-Alive: timeout=60 2 < Connection: keep-alive {"id":"7feb233c-ef83-4a10-aafb-ea439d533d52","roomId":"253e8b5f-8877-4588-ae61-71ef327a65de","title":"Karate Event 2 ce2eac95-4799-48d8-9035-6929acacbf86","description":"Event for TC-005","date":"2026-12-15T20:00:00","capacity":300,"status":"DRAFT","createdAt":"2026-04-08T03:50:36.199273848","updatedAt":"2026-04-08T03:50:36.199285114","createdBy":"00000000-0000-0000-0000-000000000001","imageUrl":null,"subtitle":null,"location":null,"director":null,"castMembers":null,"duration":null,"tag":null,"isLimited":false,"isFeatured":false,"enableSeats":false,"author":null}
86
Then status 201
0
87
* def eventId = response.id ? response.id : response.eventId
1
# TC-005: Create VIP, GENERAL, and EARLY_BIRD tiers (total 300)
90
Given url baseUrlEvents + '/api/v1/events/' + eventId + '/tiers'
1
91
And header X-Role = 'ADMIN'
0
92
And header X-User-Id = '00000000-0000-0000-0000-000000000001'
0
93
And request
0
[ { "tierType": "VIP", "price": 45, "quota": 50 }, { "tierType": "GENERAL", "price": 25, "quota": 200 }, { "tierType": "EARLY_BIRD", "price": 18, "quota": 50 } ]
113
When method post
80
22:50:36.213 request: 3 > POST http://localhost:8081/api/v1/events/7feb233c-ef83-4a10-aafb-ea439d533d52/tiers 3 > X-Role: ADMIN 3 > X-User-Id: 00000000-0000-0000-0000-000000000001 3 > Content-Type: application/json; charset=UTF-8 3 > Content-Length: 136 3 > Host: localhost:8081 3 > Connection: Keep-Alive 3 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.17) 3 > Accept-Encoding: gzip,deflate [{"tierType":"VIP","price":45,"quota":50},{"tierType":"GENERAL","price":25,"quota":200},{"tierType":"EARLY_BIRD","price":18,"quota":50}] 22:50:36.290 response time in milliseconds: 77 3 < 201 3 < Content-Type: application/json 3 < Transfer-Encoding: chunked 3 < Date: Wed, 08 Apr 2026 03:50:36 GMT 3 < Keep-Alive: timeout=60 3 < Connection: keep-alive {"eventId":"7feb233c-ef83-4a10-aafb-ea439d533d52","tiers":[{"id":"c05691fc-a234-41e5-ba68-f9c059d6ca5a","tierType":"VIP","price":45,"quota":50,"validFrom":null,"validUntil":null,"createdAt":"2026-04-08T03:50:36.272083434","updatedAt":"2026-04-08T03:50:36.272101447"},{"id":"7beec36a-1331-455c-9006-5b5f25e2cc7c","tierType":"GENERAL","price":25,"quota":200,"validFrom":null,"validUntil":null,"createdAt":"2026-04-08T03:50:36.2723897","updatedAt":"2026-04-08T03:50:36.272406218"},{"id":"727c2a84-17e8-4141-aef6-e941fba1c5c7","tierType":"EARLY_BIRD","price":18,"quota":50,"validFrom":null,"validUntil":null,"createdAt":"2026-04-08T03:50:36.272540155","updatedAt":"2026-04-08T03:50:36.272549874"}]}
114
Then status 201
0
115
* def tiers = response.tiers ? response.tiers : response
1
116
* match tiers[0].tierType == 'VIP'
1
117
* match tiers[0].price == 45
1
118
* match tiers[0].quota == 50
0
119
* match tiers[1].tierType == 'GENERAL'
0
120
* match tiers[1].price == 25
0
121
* match tiers[1].quota == 200
0
122
* match tiers[2].tierType == 'EARLY_BIRD'
1
123
* match tiers[2].price == 18
1
124
* match tiers[2].quota == 50
0
125
* print 'All three tiers correctly persisted.'
1
22:50:36.298 [print] All three tiers correctly persisted.