@@ -102,3 +102,42 @@ Feature: Voucher Management Api Test
102
102
And I can register the stub with "/createVoucher" endpoint for "PUT" request with status of 200
103
103
And I can register the stub with "/activateVoucher" endpoint for "PUT" request with status of 200
104
104
When I call the create, Activate voucher API and store it in "vouchertest/loadTest_demo.csv"
105
+
106
+ @gov
107
+ Scenario : Voucher Status Check for inactive voucher, active voucher and redeemed voucher
108
+ When I can inject MockServer
109
+ Then I can start mock server
110
+ And I can register the stub with "/createVoucher" endpoint for "PUT" request with status of 200
111
+ Given I can create an VoucherRequestDTO for voucher creation
112
+ When I call the create voucher API with expected status of 202 and stub "/createVoucher"
113
+ # Then I will sleep for 10000 millisecond
114
+ Then I should be able to extract response body from callback
115
+ And I can call the voucher status API with expected status of 200 until I get the status as "01"
116
+ Given I can create an VoucherRequestDTO for voucher activation
117
+ And I can register the stub with "/activateVoucher" endpoint for "PUT" request with status of 200
118
+ When I call the activate voucher API with expected status of 202 and stub "/activateVoucher"
119
+ # Then I will sleep for 5000 millisecond
120
+ Then I should be able to assert response body from callback on "/activateVoucher"
121
+ And I can call the voucher status API with expected status of 200 until I get the status as "02"
122
+ Given I can create an RedeemVoucherRequestDTO for voucher redemption
123
+ When I call the redeem voucher API with expected status of 200
124
+ Then I can assert that redemption was successful by asserting the status in response
125
+ And I can call the voucher status API with expected status of 200 until I get the status as "05"
126
+
127
+
128
+
129
+ @createAndActivateVoucher @gov
130
+ Scenario : Voucher Status Check for inactive voucher, active voucher, suspended and cancelled voucher
131
+ Given I can create an VoucherRequestDTO for voucher suspension
132
+ And I can register the stub with "/suspendVoucher" endpoint for "PUT" request with status of 200
133
+ When I call the suspend voucher API with expected status of 202 and stub "/suspendVoucher"
134
+ And I can call the voucher status API with expected status of 200 until I get the status as "06"
135
+ And I can create an VoucherRequestDTO for voucher reactivation
136
+ And I can register the stub with "/reactivateVoucher" endpoint for "PUT" request with status of 200
137
+ When I call the activate voucher API with expected status of 202 and stub "/reactivateVoucher"
138
+ And I can call the voucher status API with expected status of 200 until I get the status as "02"
139
+ Given I can create an VoucherRequestDTO for voucher cancellation
140
+ And I can register the stub with "/cancelVoucher" endpoint for "PUT" request with status of 200
141
+ When I call the cancel voucher API with expected status of 202 and stub "/cancelVoucher"
142
+ And I can call the voucher status API with expected status of 200 until I get the status as "03"
143
+
0 commit comments