diff options
author | EzekielaRakotoarijaona <ezekiela.rakotoarijaona@orange.com> | 2019-01-11 14:53:30 +0100 |
---|---|---|
committer | EzekielaRakotoarijaona <ezekiela.rakotoarijaona@orange.com> | 2019-01-18 17:28:05 +0100 |
commit | 05733ab5105f440e44eb56dc37e6d14615c36454 (patch) | |
tree | 3989eb8552ab271c9d5ba0a37b99960c49b36259 /src/test/resources/karatetest | |
parent | 09d6ce6112d61a7fc98c3038afce636b3e494f29 (diff) |
Fix unit testing instability
Migration of most of the unit tests from JUnit to Karate Framework
Remove of the scheduling tasks for testing.
Change-Id: Ic51378443bd6c12f247fa50b2b08ee881264dac4
Issue-ID: EXTAPI-178
Signed-off-by: EzekielaRakotoarijaona <ezekiela.rakotoarijaona@orange.com>
Diffstat (limited to 'src/test/resources/karatetest')
7 files changed, 1652 insertions, 0 deletions
diff --git a/src/test/resources/karatetest/data/serviceOrder.json b/src/test/resources/karatetest/data/serviceOrder.json new file mode 100644 index 0000000..89cc6e8 --- /dev/null +++ b/src/test/resources/karatetest/data/serviceOrder.json @@ -0,0 +1,1026 @@ +[ + { + "id": "test", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test1", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "toto" + } + } + }, + { + "id": "B", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "toto" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test2", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [], + "orderItem": [ + { + "id": "A", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test3", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": null, + "orderItem": [ + { + "id": "A", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test4", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "new", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "romain" + } + ], + "orderItem": [ + { + "id": "A", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test5", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "delete", + "state": "active", + "service": { + "id": "null", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "delete", + "state": "active", + "service": { + "id": "null", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test6", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "modify", + "state": "active", + "service": { + "id": "null", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "modify", + "state": "active", + "service": { + "id": "null", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test7", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "add", + "state": "active", + "service": { + "id": "toto", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "add", + "state": "active", + "service": { + "id": "toto", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test8", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "new", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "romain" + } + ], + "orderItem": [ + { + "id": "A", + "action": "delete", + "state": "active", + "service": { + "id": "test", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "delete", + "state": "active", + "service": { + "id": "test", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test9", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "delete", + "state": "active", + "service": { + "id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "delete", + "state": "active", + "service": { + "id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test10", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "delete", + "state": "active", + "service": { + "id": "no_response", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "delete", + "state": "active", + "service": { + "id": "no_response", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test11", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "noChange", + "state": "active", + "service": { + "id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "noChange", + "state": "active", + "service": { + "id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test12", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "noChange", + "state": "active", + "service": { + "id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "delete", + "state": "active", + "service": { + "id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test13", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "delete", + "state": "active", + "service": { + "id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", + "state": "active", + "serviceSpecification": { + "id": "undefined" + } + } + }, + { + "id": "B", + "action": "delete", + "state": "active", + "service": { + "id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", + "state": "active", + "serviceSpecification": { + "id": "undefined" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test14", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "333" + } + } + }, + { + "id": "B", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test15", + "state": "acknowledged", + "externalId": "extid1", + "priority": "1", + "description": "toto", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test16", + "state": "acknowledged", + "externalId": "extid2", + "priority": "1", + "description": "toto", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + } +] diff --git a/src/test/resources/karatetest/data/subscriber.json b/src/test/resources/karatetest/data/subscriber.json new file mode 100644 index 0000000..e7c08ad --- /dev/null +++ b/src/test/resources/karatetest/data/subscriber.json @@ -0,0 +1,17 @@ +[ + { + "id": "id", + "callback": "http://localhost:8080/test", + "query": "eventType = ServiceOrderCreationNotification" + }, + { + "id": "id", + "callback": "http://localhost/test", + "query": "eventType=ServiceOrderStateChangeNotification" + }, + { + "id": "id", + "callback": "http://localhost/test", + "query": "eventType=ServiceOrderItemStateChangeNotification" + } +]
\ No newline at end of file diff --git a/src/test/resources/karatetest/features/00--ServiceCatalog.feature b/src/test/resources/karatetest/features/00--ServiceCatalog.feature new file mode 100644 index 0000000..2edd420 --- /dev/null +++ b/src/test/resources/karatetest/features/00--ServiceCatalog.feature @@ -0,0 +1,38 @@ +# new feature +# Tags: optional + +Feature: Service Catalog + +Background: +* url nbiBaseUrl +* def Context = Java.type('org.onap.nbi.test.Context'); +* call Context.startServers(); + +Scenario: testServiceCatalogGetResourceWithoutTosca +Given path 'serviceSpecification','1e3feeb0-8e36-46c6-862c-236d9c626439_withoutTosca' +When method get +Then status 206 +And match $ contains { id : '1e3feeb0-8e36-46c6-862c-236d9c626439' , name : 'vFW' , invariantUUID : 'b58a118e-eeb9-4f6e-bdca-e292f84d17df' , toscaModelURL : '/sdc/v1/catalog/services/1e3feeb0-8e36-46c6-862c-236d9c626439toto/toscaModel' , distributionStatus : 'DISTRIBUTED' , version : '2.0' , lifecycleStatus : 'CERTIFIED' , @type : 'ONAPservice' , attachment : '#array' , relatedParty : '#notnull' , resourceSpecification : '#array' } +And match $.relatedParty contains { name : 'Joni Mitchell', role : 'lastUpdater' } +And match $.resourceSpecification[0] contains { name : 'vFW-vSINK', resourceInstanceName : 'vFW-vSINK 0', resourceType : 'VF' , resourceInvariantUUID : '18b90934-aa82-456f-938e-e74a07a426f3' , @type : 'ONAPresource', modelCustomizationName : 'vFW-vSINK 0' } +And match $.resourceSpecification == '#[2]' +And match $.attachment == '#[5]' + +Scenario: findServiceCatalog +Given path 'serviceSpecification' +When method get +Then status 200 +And assert response.length == 21 +And match $[0] contains { id : '446afaf6-79b5-420e-aff8-7551b00bb510' , name : 'FreeRadius-service' , invariantUUID : '7e4781e8-6c6e-41c5-b889-6a321d5f2490' , category : 'Network L4+' , distributionStatus : 'DISTRIBUTED' , version : '1.0' , lifecycleStatus : 'CERTIFIED' } +And match $[0].relatedParty contains { role : 'lastUpdater' } + + + +Scenario: findServiceCatalogWithFilter +Given path 'serviceSpecification' +And params {fields:'name'} +When method get +Then status 200 +And assert response.length == 21 +And match $[0] contains { name : 'FreeRadius-service' } + diff --git a/src/test/resources/karatetest/features/01--ServiceInventory.feature b/src/test/resources/karatetest/features/01--ServiceInventory.feature new file mode 100644 index 0000000..2b657be --- /dev/null +++ b/src/test/resources/karatetest/features/01--ServiceInventory.feature @@ -0,0 +1,90 @@ +# new feature +# Tags: optional + +Feature: Service Inventory + +Background: +* url nbiBaseUrl +* def Context = Java.type('org.onap.nbi.test.Context'); +* call Context.startServers(); + + +Scenario: testServiceResourceGetInventory +Given path 'service','e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' +And params {serviceSpecification.name : 'vFW' , relatedParty.id : '6490'} +When method get +Then status 200 +And match $ contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01', hasStarted : 'yes', type : 'service-instance', @type : 'serviceONAP' } +And match $.relatedParty contains { role : 'ONAPcustomer' , id : '6490' } +And match $.serviceSpecification contains { id : '98d95267-5e0f-4531-abf8-f14b90031dc5' , invariantUUID : '709d157b-52fb-4250-976e-7133dff5c347' , @type : 'ONAPservice' } +And match $.supportingResource[0] contains { id : 'cb80fbb6-9aa7-4ac5-9541-e14f45de533e' , name : 'NewFreeRadius-VNF-instance-01' , status : 'PREPROV' , modelInvariantId : 'f5993703-977f-4346-a1c9-c1884f8cfd8d' , modelVersionId : '902438f7-1e4c-492d-b7cc-8650e13b8aeb' , @referredType : 'ONAP resource' } +And match $.supportingResource == '#[2]' + +Scenario: testServiceResourceGetInventoryWithStatus +Given url 'http://localhost:8080/nbi/api/v3/service/405c8c00-44b9-4303-9f27-6797d22ca096?serviceSpecification.name=AnsibleService&relatedParty.id=6490' +When method get +Then status 200 +And match $.state == 'Active' + +Scenario: testServiceResourceGetInventoryWithoutRelationShipList +Given path 'service','e4688e5f-61a0-4f8b-ae02-a2fbde623bcbWithoutList' +And params {serviceSpecification.name:'vFW',relatedParty.id:'6490'} +When method get +Then status 200 +And match $ contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01' , hasStarted : 'yes' , type : 'service-instance' , @type : 'serviceONAP' } +And match $.relatedParty contains { role : 'ONAPcustomer' , id : '6490' } +And match $.serviceSpecification contains { id : '98d95267-5e0f-4531-abf8-f14b90031dc5' , invariantUUID : '709d157b-52fb-4250-976e-7133dff5c347' , @type : 'ONAPservice' } +And match $.supportingResource == '#[0]' + +Scenario: testServiceResourceGetInventoryWithServiceSpecId +Given path 'service','e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' +And params {serviceSpecification.id:'1e3feeb0-8e36-46c6-862c-236d9c626439', relatedParty.id:'6490'} +When method get +Then status 200 +And match $ contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01', hasStarted : 'yes', type : 'service-instance', @type : 'serviceONAP' } +And match $.relatedParty contains { role : 'ONAPcustomer' , id : '6490' } +And match $.serviceSpecification contains { id : '98d95267-5e0f-4531-abf8-f14b90031dc5' , invariantUUID : '709d157b-52fb-4250-976e-7133dff5c347' , @type : 'ONAPservice' } +And match $.supportingResource[0] contains { id : 'cb80fbb6-9aa7-4ac5-9541-e14f45de533e' , name : 'NewFreeRadius-VNF-instance-01' , status : 'PREPROV' , modelInvariantId : 'f5993703-977f-4346-a1c9-c1884f8cfd8d' , modelVersionId : '902438f7-1e4c-492d-b7cc-8650e13b8aeb' , @referredType : 'ONAP resource' } +And match $.supportingResource == '#[2]' + + +Scenario: testServiceInventoryFind +Given path 'service' +And params {serviceSpecification.name : 'vFW' , relatedParty.id : '6490' } +When method get +Then status 200 +And match $ == '#[1]' +And match $[0] contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01' } +And match $[0].relatedParty contains { role : 'ONAPcustomer' , id : '6490' } +And match $[0].serviceSpecification contains { name : 'vFW' , id : '98d95267-5e0f-4531-abf8-f14b90031dc5' } + +Scenario: testServiceInventoryFindWithServiceSpecId +Given path 'service' +And params {serviceSpecification.id : '1e3feeb0-8e36-46c6-862c-236d9c626439' , relatedParty.id : '6490'} +When method get +Then status 200 +And match $ == '#[1]' +And match $[0] contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01' } +And match $[0].relatedParty contains { role : 'ONAPcustomer' , id : '6490' } +And match $[0].serviceSpecification contains { name : 'vFW' , id : '98d95267-5e0f-4531-abf8-f14b90031dc5' } + +Scenario: testServiceInventoryFindWithoutParameter +Given path 'service' +And params {relatedParty.id:'6490'} +When method get +Then status 200 +And match $ == '#[2]' +And match $[0] contains { id : 'vfw-service-id' , name : 'vfw-service-name' } +And match $[0].relatedParty contains { role : 'ONAPcustomer' , id : '6490' } +And match $[0].serviceSpecification contains { name : 'vFW-service-2VF-based' , id : '9vfw-service-modek-version-id' } +And match $[1] contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01' } +And match $[1].relatedParty contains { role : 'ONAPcustomer' , id : '6490' } +And match $[1].serviceSpecification contains { name : 'vFW' , id : '98d95267-5e0f-4531-abf8-f14b90031dc5' } + + + + + + + + diff --git a/src/test/resources/karatetest/features/02--ServiceOrder.feature b/src/test/resources/karatetest/features/02--ServiceOrder.feature new file mode 100644 index 0000000..6e4b804 --- /dev/null +++ b/src/test/resources/karatetest/features/02--ServiceOrder.feature @@ -0,0 +1,398 @@ +# new feature +# Tags: optional + +Feature: Service order + +Background: +* url nbiBaseUrl +* def Context = Java.type('org.onap.nbi.test.Context'); +* call Context.startServers(); +* def data = read('../data/serviceOrder.json') +* def sleep = function(){java.lang.Thread.sleep(5000)} + + +Scenario: testCreateServiceOrderResource +Given path 'serviceOrder' +And request data[0] +When method post +Then status 201 +And match $.id contains '#notnull' +And match $.state == 'acknowledged' +Given path 'serviceOrder','test' +When method delete +Then status 204 + +Scenario: testCheckServiceOrder +Given path 'serviceOrder' +And request data[0] +When method post +Then status 201 +Given path 'serviceOrder','test','test' +And request $ +When method put +Then status 201 +And match $.id == 'test' +And match $.state == 'acknowledged' +Given path 'serviceOrder','test' +When method get +Then status 200 +Given path 'serviceOrder','test' +When method delete +Then status 204 + + +Scenario: testCheckServiceOrderWithUnknownSverviceSpecId +Given path 'serviceOrder' +And request data[1] +When method post +Then status 201 +Given path 'serviceOrder','test','test1' +And request $ +When method put +Then status 201 +And match $.state == 'rejected' +And match $.orderItem[0].orderItemMessage == '#[1]' +And match $.orderItem[0].orderItemMessage[0] contains { code : '102' , field : 'serviceSpecification.id' } +Given path 'serviceOrder','test1' +When method get +Then status 200 +Given path 'serviceOrder','test1' +When method delete +Then status 204 + + +Scenario: testCheckServiceOrderWithGenericCustomer +Given path 'serviceOrder' +And request data[2] +When method post +Then status 201 +Given path 'serviceOrder','test','test2' +And request $ +When method put +Then status 201 +And match $.state == 'acknowledged' +Given path 'serviceOrder','test2' +When method get +Then status 200 +Given path 'serviceOrder','test2' +When method delete +Then status 204 + +Scenario: testCheckServiceOrderWithoutRelatedParty +Given path 'serviceOrder' +And request data[3] +When method post +Then status 201 +Given path 'serviceOrder','test','test3' +And request $ +When method put +Then status 201 +And match $.state == 'acknowledged' +Given path 'serviceOrder','test3' +When method get +Then status 200 +Given path 'serviceOrder','test3' +When method delete +Then status 204 + + +Scenario: testCheckServiceOrderWithUnKnownCustomer +Given path 'serviceOrder' +And request data[4] +When method post +Then status 201 +Given path 'serviceOrder','test','test4' +And request $ +When method put +Then status 201 +And match $.state == 'acknowledged' +Given path 'serviceOrder','test4' +When method get +Then status 200 +Given path 'serviceOrder','test4' +When method delete +Then status 204 + +Scenario: testCheckServiceOrderInDeleteWithNoServiceId +Given path 'serviceOrder' +And request data[5] +When method post +Then status 201 +Given path 'serviceOrder','test','test5' +And request $ +When method put +Then status 201 +And match $.state == 'rejected' +And match $.orderItem[0].orderItemMessage == '#[1]' +And match $.orderItem[0].orderItemMessage[0] contains { code : '106' , field : 'service.id' } +Given path 'serviceOrder','test5' +When method get +Then status 200 +Given url 'http://localhost:8080/nbi/api/v3/serviceOrder/test5' +When method delete +Then status 204 + + +Scenario: testCheckServiceOrderInModifyWithNoServiceId +Given path 'serviceOrder' +And request data[6] +When method post +Then status 201 +Given path 'serviceOrder','test','test6' +And request $ +When method put +Then status 201 +And match $.state == 'rejected' +And match $.orderItem[0].orderItemMessage == '#[1]' +And match $.orderItem[0].orderItemMessage[0] contains { code : '106' , field : 'service.id' } +Given path 'serviceOrder','test6' +When method get +Then status 200 +Given path 'serviceOrder','test6' +When method delete +Then status 204 + + +Scenario: testCheckServiceOrderInAddWithServiceId +Given path 'serviceOrder' +And request data[7] +When method post +Then status 201 +Given path 'serviceOrder','test','test7' +And request $ +When method put +Then status 201 +And match $.state == 'rejected' +And match $.orderItem[0].orderItemMessage == '#[1]' +And match $.orderItem[0].orderItemMessage[0] contains { code : '103' , field : 'service.id' } +Given path 'serviceOrder','test7' +When method get +Then status 200 +Given path 'serviceOrder','test7' +When method delete +Then status 204 + +Scenario: testCheckServiceOrderWithUnKnownCustomerInChange +Given path 'serviceOrder' +And request data[8] +When method post +Then status 201 +Given path 'serviceOrder','test','test8' +And request $ +When method put +Then status 201 +And match $.state == 'rejected' +And match $.orderMessage == '#[1]' +And match $.orderMessage[0] contains { code : '104' , field : 'relatedParty.id' } +Given path 'serviceOrder','test8' +When method get +Then status 200 +Given path 'serviceOrder','test8' +When method delete +Then status 204 + + +Scenario: testCheckServiceOrderDelete +Given path 'serviceOrder' +And request data[9] +When method post +Then status 201 +Given path 'serviceOrder','test','test9' +And request $ +When method put +Then status 201 +And match $.state == 'acknowledged' +Given path 'serviceOrder','test9' +When method get +Then status 200 +Given path 'serviceOrder','test9' +When method delete +Then status 204 + +Scenario: testCheckServiceOrderDeleteRejected +Given path 'serviceOrder' +And request data[10] +When method post +Then status 201 +Given path 'serviceOrder','test','test10' +And request $ +When method put +Then status 201 +And match $.state == 'rejected' +And match $.orderItem[0].orderItemMessage == '#[1]' +And match $.orderItem[0].orderItemMessage[0] contains { code : '106' , field : 'service.id' } +Given path 'serviceOrder','test10' +When method get +Then status 200 +Given path 'serviceOrder','test10' +When method delete +Then status 204 + +Scenario: testCheckServiceOrderNoChange +Given path 'serviceOrder' +And request data[11] +When method post +Then status 201 +Given path 'serviceOrder','test','test11' +And request $ +When method put +Then status 201 +And match $.state == 'completed' +And match $.orderItem[0].state == 'completed' +And match $.orderItem[1].state == 'completed' +Given path 'serviceOrder','test11' +When method get +Then status 200 +Given path 'serviceOrder','test11' +When method delete +Then status 204 + +Scenario: testCheckServiceOrderNoChangeAndDelete +Given path 'serviceOrder' +And request data[12] +When method post +Then status 201 +Given path 'serviceOrder','test','test12' +And request $ +When method put +Then status 201 +And match $.state == 'acknowledged' +And match $.orderItem[0].state == 'completed' +Given path 'serviceOrder','test12' +When method get +Then status 200 +Given path 'serviceOrder','test12' +When method delete +Then status 204 + +Scenario: testCheckServiceOrderDeleteWithKoServiceSpecId +Given path 'serviceOrder' +And request data[13] +When method post +Then status 201 +Given path 'serviceOrder','test','test13' +And request $ +When method put +Then status 201 +And match $.state == 'rejected' +And match $.orderItem[0].state == 'rejected' +Given path 'serviceOrder','test13' +When method get +Then status 200 +Given path 'serviceOrder','test13' +When method delete +Then status 204 + +Scenario: testCheckServiceOrderRejected +Given path 'serviceOrder' +And request data[14] +When method post +Then status 201 +Given path 'serviceOrder','test','test14' +And request $ +When method put +Then status 201 +And match $.state == 'rejected' +And match $.orderItem[0].orderItemMessage == '#[1]' +And match $.orderItem[0].orderItemMessage[0] contains { code : '102' , field : 'serviceSpecification.id' } +Given path 'serviceOrder','test14' +When method get +Then status 200 +Given path 'serviceOrder','test14' +When method delete +Then status 204 + + +Scenario: testFindAndGetServiceOrder +Given path 'serviceOrder' +And request data[15] +When method post +Then status 201 +Given path 'serviceOrder' +And request data[16] +When method post +Then status 201 +Given path 'serviceOrder','test','test15' +And request $ +When method put +Then status 201 +Given path 'serviceOrder','test','test16' +And request $ +When method put +Then status 201 +Given path 'serviceOrder' +And params {fields : 'id'} +When method get +Then status 200 +And match $ == '#[2]' +Given path 'serviceOrder' +And params {externalId : 'extid1' , state : 'acknowledged'} +When method get +Then status 200 +And match $ == '#[1]' +Given path 'serviceOrder','test15' +When method get +Then status 200 +And match $ contains '#notnull' +Given path 'serviceOrder','test15' +When method delete +Then status 204 +Given path 'serviceOrder','test16' +When method delete +Then status 204 + + +Scenario: testCheckServiceOrderWithCustomerAAINotResponding +* call Context.removeWireMockMapping("/aai/v11/business/customers/customer/new"); +Given path 'serviceOrder' +And request data[4] +When method post +Then status 201 +Given path 'serviceOrder','test','test4' +And request $ +When method put +Then status 201 +And match $.id == 'test4' +And match $.state == 'rejected' +And match $.orderItem == '#[2]' +And match $.orderMessage[0] contains { code : '501' , messageInformation : 'Problem with AAI API' } +Given path 'serviceOrder','test4' +When method get +Then status 200 +* call Context.startServers(); + + +Scenario: testAAIPutServiceNotResponding +* call Context.removeWireMockMapping("/aai/v11/business/customers/customer/new/service-subscriptions/service-subscription/vFW"); +Given path 'serviceOrder' +And request data[4] +When method post +Then status 201 +Given path 'serviceOrder','test','test4' +And request $ +When method put +Then status 201 +And match $.id == 'test4' +And match $.state == 'rejected' +Given path 'serviceOrder','test4' +When method get +Then status 200 +* call Context.startServers(); + +Scenario: testCheckServiceOrderWithSDCNotResponding +* call Context.removeWireMockMapping("/sdc/v1/catalog/services/1e3feeb0-8e36-46c6-862c-236d9c626439/metadata"); +Given path 'serviceOrder' +And request data[4] +When method post +Then status 201 +Given path 'serviceOrder','test','test4' +And request $ +When method put +Then status 201 +And match $.id == 'test4' +And match $.state == 'rejected' +And match $.orderItem[0].orderMessage[0] contains { code : '102' , field : 'serviceSpecification.id' } +Given path 'serviceOrder','test4' +When method get +Then status 200 +* call Context.startServers();
\ No newline at end of file diff --git a/src/test/resources/karatetest/features/03--Subscriber.feature b/src/test/resources/karatetest/features/03--Subscriber.feature new file mode 100644 index 0000000..851ac73 --- /dev/null +++ b/src/test/resources/karatetest/features/03--Subscriber.feature @@ -0,0 +1,66 @@ +# new feature +# Tags: optional + +Feature: Subscriber + +Background: +* url nbiBaseUrl +* def Context = Java.type('org.onap.nbi.test.Context'); +* call Context.startServers(); +* def data = read('../data/subscriber.json') + +Scenario: testFindWhenNoSubscriber +Given path 'hub' +When method get +Then status 200 +And match $ == '#[0]' + +Scenario: testCreationAndFindSubscriber +Given path 'hub' +And request data[0] +When method post +Then status 201 +Given url 'http://localhost:8080/nbi/api/v3/hub/' +When method get +And match $ == '#[1]' + +Scenario: testGetByIdSubscriber +Given path 'hub' +When method get +And def Id = $[0].id +Given path 'hub',Id +When method get +And match $ contains { callback : 'http://localhost:8080/test' , query : 'eventType=ServiceOrderCreationNotification' } + +Scenario: testFindSubscriber +Given path 'hub' +And request data[1] +When method post +Then status 201 +Given path 'hub' +And request data[2] +When method post +Then status 201 +Given path 'hub' +When method get +Then status 200 +And match $ == '#notnull' + +Scenario: testFindWithFilteringSubscriber +Given path 'hub' +And params { query.eventType : 'ServiceOrderCreationNotification' } +When method get +Then status 200 +And match $ == '#[1]' + +Scenario: testSubscriberDeletion +Given path 'hub' +And request { id : 'id', callback : 'http://localhost:8080/test' , query : 'eventType = ServiceOrderCreationNotification' } +When method post +Then status 201 +Given path 'hub' +When method get +And def Id = $[0].id +Given path 'hub',Id +When method delete +Then status 204 diff --git a/src/test/resources/karatetest/features/04--StatusRessourceTest.feature b/src/test/resources/karatetest/features/04--StatusRessourceTest.feature new file mode 100644 index 0000000..f616e90 --- /dev/null +++ b/src/test/resources/karatetest/features/04--StatusRessourceTest.feature @@ -0,0 +1,17 @@ +# new feature +# Tags: optional + +Feature: Status Resource + +Background: +* url nbiBaseUrl +* def Context = Java.type('org.onap.nbi.test.Context'); +* call Context.startServers(); + +Scenario: testHealthCheck + +Given path 'status' +When method get +Then status 200 +And match response.status == 'ok' +And match response.name == 'nbi'
\ No newline at end of file |