@@ -1038,6 +1038,130 @@ Feature: List license
10381038 And the response body should be an array with 0 "licenses"
10391039 And time is unfrozen
10401040
1041+ Scenario : Admin retrieves all licenses expired within the last 31 days (duration)
1042+ Given I am an admin of account "test1"
1043+ And the current account is "test1"
1044+ And the current account has 5 "licenses"
1045+ And the first "license" has the following attributes:
1046+ """
1047+ { "expiry": "2022-06-10T12:00:00.000Z" }
1048+ """
1049+ And the second "license" has the following attributes:
1050+ """
1051+ { "expiry": null }
1052+ """
1053+ And the third "license" has the following attributes:
1054+ """
1055+ { "expiry": "2022-01-10T12:00:00.000Z" }
1056+ """
1057+ And the fourth "license" has the following attributes:
1058+ """
1059+ { "expiry": "2022-05-10T13:00:00.000Z" }
1060+ """
1061+ And the fifth "license" has the following attributes:
1062+ """
1063+ { "expiry": "2022-08-01T12:00:00.000Z" }
1064+ """
1065+ And time is frozen at "2022-06-10T13:00:00.000Z"
1066+ And I use an authentication token
1067+ When I send a GET request to "/accounts/test1/licenses?expired[within]=31d"
1068+ Then the response status should be "200"
1069+ And the response body should be an array with 2 "licenses"
1070+ And time is unfrozen
1071+
1072+ Scenario : Admin retrieves all licenses expired in the last 31 days (duration)
1073+ Given I am an admin of account "test1"
1074+ And the current account is "test1"
1075+ And the current account has 5 "licenses"
1076+ And the first "license" has the following attributes:
1077+ """
1078+ { "expiry": "2022-06-10T12:00:00.000Z" }
1079+ """
1080+ And the second "license" has the following attributes:
1081+ """
1082+ { "expiry": null }
1083+ """
1084+ And the third "license" has the following attributes:
1085+ """
1086+ { "expiry": "2022-01-10T12:00:00.000Z" }
1087+ """
1088+ And the fourth "license" has the following attributes:
1089+ """
1090+ { "expiry": "2022-05-10T13:00:00.000Z" }
1091+ """
1092+ And the fifth "license" has the following attributes:
1093+ """
1094+ { "expiry": "2022-08-01T12:00:00.000Z" }
1095+ """
1096+ And time is frozen at "2022-06-10T13:00:00.000Z"
1097+ And I use an authentication token
1098+ When I send a GET request to "/accounts/test1/licenses?expired[in]=31d"
1099+ Then the response status should be "200"
1100+ And the response body should be an array with 2 "licenses"
1101+ And time is unfrozen
1102+
1103+ Scenario : Admin retrieves all licenses expired before a timestamp (ISO)
1104+ Given I am an admin of account "test1"
1105+ And the current account is "test1"
1106+ And the current account has 5 "licenses"
1107+ And the first "license" has the following attributes:
1108+ """
1109+ { "expiry": "2022-06-10T12:00:00.000Z" }
1110+ """
1111+ And the second "license" has the following attributes:
1112+ """
1113+ { "expiry": null }
1114+ """
1115+ And the third "license" has the following attributes:
1116+ """
1117+ { "expiry": "2022-01-10T12:00:00.000Z" }
1118+ """
1119+ And the fourth "license" has the following attributes:
1120+ """
1121+ { "expiry": "2022-05-10T13:00:00.000Z" }
1122+ """
1123+ And the fifth "license" has the following attributes:
1124+ """
1125+ { "expiry": "2022-08-01T12:00:00.000Z" }
1126+ """
1127+ And time is frozen at "2022-06-10T13:00:00.000Z"
1128+ And I use an authentication token
1129+ When I send a GET request to "/accounts/test1/licenses?expired[before]=2022-05-10T13:00:01.000Z"
1130+ Then the response status should be "200"
1131+ And the response body should be an array with 2 "licenses"
1132+ And time is unfrozen
1133+
1134+ Scenario : Admin retrieves all licenses expired after a timestamp (unix)
1135+ Given I am an admin of account "test1"
1136+ And the current account is "test1"
1137+ And the current account has 5 "licenses"
1138+ And the first "license" has the following attributes:
1139+ """
1140+ { "expiry": "2022-06-10T12:00:00.000Z" }
1141+ """
1142+ And the second "license" has the following attributes:
1143+ """
1144+ { "expiry": null }
1145+ """
1146+ And the third "license" has the following attributes:
1147+ """
1148+ { "expiry": "2022-01-10T12:00:00.000Z" }
1149+ """
1150+ And the fourth "license" has the following attributes:
1151+ """
1152+ { "expiry": "2022-05-10T13:00:00.000Z" }
1153+ """
1154+ And the fifth "license" has the following attributes:
1155+ """
1156+ { "expiry": "2022-08-01T12:00:00.000Z" }
1157+ """
1158+ And time is frozen at "2022-06-10T13:00:00.000Z"
1159+ And I use an authentication token
1160+ When I send a GET request to "/accounts/test1/licenses?expired[after]=1652313600"
1161+ Then the response status should be "200"
1162+ And the response body should be an array with 1 "license"
1163+ And time is unfrozen
1164+
10411165 Scenario : Admin retrieves licenses with activity inside the last 30 days (simple ISO)
10421166 Given I am an admin of account "test1"
10431167 And the current account is "test1"
0 commit comments