diff --git a/swagger/api.yaml b/swagger/api.yaml index e7e1ba0..7c87d7c 100644 --- a/swagger/api.yaml +++ b/swagger/api.yaml @@ -55,6 +55,10 @@ paths: # These are served from the license manager IDA, but we surface them with the rest of the enterprise endpoints "/enterprise/v1/subscriptions/{uuid}/licenses/assign": $ref: "https://raw.githubusercontent.com/edx/license-manager/eb9407e/api.yaml#/endpoints/v1/assignLicenses" + "/enterprise/v1/subscriptions/{uuid}/licenses/bulk-revoke": + $ref: "https://raw.githubusercontent.com/edx/license-manager/1f3037b/api.yaml#/endpoints/v1/revokeLicenses" + "/enterprise/v1/bulk-license-enrollment": + $ref: "https://raw.githubusercontent.com/edx/license-manager/1f3037b/api.yaml#/endpoints/v1/bulkLicenseEnrollment" # Enterprise Catalog IDA # These are served from the enterprise catalog IDA, but we surface them with the rest of the enterprise endpoints "/enterprise/v2/enterprise-catalogs": diff --git a/tests/test_enterprise.yaml b/tests/test_enterprise.yaml index 5c40909..6d0b00d 100644 --- a/tests/test_enterprise.yaml +++ b/tests/test_enterprise.yaml @@ -264,7 +264,7 @@ - expected_status: [200] - test: - - name: 'License assign endpoint rejected without authorization HTTP 200' + - name: 'License assign endpoint rejected without authorization HTTP 400' - url: '/enterprise/v1/subscriptions/9101d3de36156cba/licenses/assign' - method: 'POST' - headers: {'Content-Type': 'application/json'} @@ -279,3 +279,73 @@ } ] - expected_status: [400] + +- test: + - name: 'License revokes endpoint returns HTTP 200' + - url: '/enterprise/v1/subscriptions/9101d3de36156cba/licenses/bulk-revoke/' + - method: 'POST' + - headers: {'Authorization': 'aeiou', 'Content-Type': 'application/json'} + - body: > + [ + { + "user_emails": ["edx@example.com", "abc@example.com"] } + ] + - expected_status: [200] + +- test: + - name: 'License revokes endpoint rejected without authorization HTTP 400' + - url: '/enterprise/v1/subscriptions/9101d3de36156cba/licenses/bulk-revoke/' + - method: 'POST' + - headers: {'Content-Type': 'application/json'} + - body: > + [ + { + "filters": [{"status_in": ['activated', 'assigned']}] + } + ] + - expected_status: [400] + +- test: + - name: 'Bulk learner enrollment in given list of courses endpoint returns HTTP 200' + - url: '/enterprise/v1/bulk-license-enrollment?enterprise_customer_uuid=234555' + - method: 'POST' + - headers: {'Authorization': 'aeiou', 'Content-Type': 'application/json'} + - body: > + [ + { + "emails": ["edx@example.com"], + "course_run_keys": ["testX"], + "notify": true + } + ] + - expected_status: [200] + +- test: + - name: 'Bulk learner enrollment in given list of courses endpoint returns HTTP 400 without enterprise_customer_uuid' + - url: '/enterprise/v1/bulk-license-enrollment' + - method: 'POST' + - headers: {'Authorization': 'aeiou', 'Content-Type': 'application/json'} + - body: > + [ + { + "emails": ["edx@example.com"], + "course_run_keys": ["testX"], + "notify": true + } + ] + - expected_status: [400] + +- test: + - name: 'Bulk learner enrollment in given list of courses endpoint rejected without authorization HTTP 400' + - url: '/enterprise/v1/bulk-license-enrollment' + - method: 'POST' + - headers: {'Content-Type': 'application/json'} + - body: > + [ + { + "emails": ["edx@example.com"], + "course_run_keys": ["testX"], + "notify": true + } + ] + - expected_status: [400]