Feature: mod-organizations integration tests document. Background: The purpose of this document is to understand all test cases for mod-organizations. Scenario: Create tenant and users for testing Given common/setup-users.feature for creating tenant and users When call setup-users.feature file present in "common" module Then A tenant should be created with appropriate permissions to execute organizations karate tests. Scenario: Prepare test data for mod-organizations Given call create-test-data.feature present in acquisitions/src/main/resources/thunderjet/mod-organizations/features # create-test-data.feature file # define test ids readOnlyAcqUnitId = 'fdf31bcb-ffd2-5142-adac-8b0cc1c262f6' updateOnlyAcqUnitId = 'fdf31bcb-ffd2-5142-adac-8b0cc1c262f7' fullProtectedAcqUnitId = 'fdf31bcb-ffd2-5142-adac-8b0cc1c262f8' noAcqOrganizationId = 'fdf31bcb-ffd2-5142-adac-8b0cc1c262f9' Scenario: Create a read only acquisitions unit Given send request with payload to the path "/acquisitions-units-storage/units" When method is of type POST Then status should be 201 Scenario: Create an update only acquisitions unit Given send request with payload to the path "/acquisitions-units-storage/units" When method is of type POST Then status should be 201 Scenario: Create a full protected acquisitions unit Given send request with payload to the path "/acquisitions-units-storage/units" When method is of type POST Then status should be 201 Scenario: Create a "not protected" organization with Active status & code as 'NO_ACQ_ORG' Given send request with payload to the path "'/organizations/organizations'" When method is of type POST Then status should be 201 Scenario: Create a "read only" organization with Active status & code as 'READ_ONLY_ORG' Given send request with payload to the path "'/organizations/organizations'" When method is of type POST Then status should be 201 Scenario: Create a "update only" organization with Active status & code as 'UPDATE_ONLY_ORG' Given send request with payload to the path "'/organizations/organizations'" When method is of type POST Then status should be 201 Scenario: Create a "fully protected" organization with Active status & code as 'FULL_PROTECTED_ORG' Given send request with payload to the path "'/organizations/organizations'" When method is of type POST Then status should be 201 Then test data should be ready. # Test organizations APIs Scenario: Get organization which is not protected Given send a request to the path '/organizations/organizations/' with "noAcqOrganizationId" When method is of type GET Then status should be 200 And response id should match "noAcqOrganizationId". Scenario: Get organization which is read only Given send a request to the path '/organizations/organizations/' with "readOnlyOrganizationId" When method is of type GET Then status should be 200 And response id should match with "readOnlyOrganizationId". Scenario: receive forbidden status when trying to get a fully-protected organization Given send a request to the path '/organizations/organizations/' with "fullProtectedOrganizationId" When method is of type GET Then status should be 403 Scenario: Get all organizations Given send a request to the path '/organizations/organizations/' When method is of type GET Then status should be 200 And totalRecords from response should match with 2. Scenario: Get user and assign that user to read-open unit Given send a request to the path '/users' with "username=test-user" When method is of type GET Then status should be 200 Given send a request to the path '/acquisitions-units-storage/memberships' with "userId" & "readOnlyAcqUnitId" When method is of type POST Then status should be 201 Scenario: Get organization which is not protected Given send a request to the path '/organizations/organizations/' with "noAcqOrganizationId" When method is of type GET Then status should be 200 And response id should match "noAcqOrganizationId". Scenario: Get organization which is read only Given send a request to the path '/organizations/organizations/' with "readOnlyOrganizationId" When method is of type GET Then status should be 200 And response id should match with "readOnlyOrganizationId". Scenario: receive forbidden status when trying to get a fully-protected organization Given send a request to the path '/organizations/organizations/' with "fullProtectedOrganizationId" When method is of type GET Then status should be 403 Scenario: Get all organizations after assigning read only protected units to user Given send a request to the path '/organizations/organizations/' When method is of type GET Then status should be 200 And totalRecords from response should match with 2. Scenario: Get user and assign that user to full-protected unit Given send a request to the path '/users' with "username=test-user" When method is of type GET Then status should be 200 Given send a request to the path '/acquisitions-units-storage/memberships' with "userId" & "fullProtectedAcqUnitId" When method is of type POST Then status should be 201 Scenario: Get organization which is not protected Given send a request to the path '/organizations/organizations/' with "noAcqOrganizationId" When method is of type GET Then status should be 200 And response id should match "noAcqOrganizationId". Scenario: Get organization which is read only Given send a request to the path '/organizations/organizations/' with "readOnlyOrganizationId" When method is of type GET Then status should be 200 And response id should match with "readOnlyOrganizationId". Scenario: Get all organizations after assigning full protected units to user Given send a request to the path '/organizations/organizations/' When method is of type GET Then status should be 200 And totalRecords from response should match with 3. Scenario: Create an organization with duplicate account number Given send a request to the path '/organizations/organizations/' with 'notUniqueAccountOrganizationId' & accountNo When method is of type POST Then status should be 200 Given send a request to the path '/organizations/organizations/' with 'notUniqueAccountOrganizationId' & previous accountNo When method is of type PUT Then status should be 422 And response code should match with "accountNumberMustBeUnique". # clearing all data Scenario: clear all data Given common/destroy-data.feature for wiping out entire data When call destroy-data.feature file present in "common" module Then all data should be wiped off.