summaryrefslogtreecommitdiffstats
path: root/src/test/resources/karatetest/features
diff options
context:
space:
mode:
authorromaingimbert <romain.gimbert@orange.com>2019-01-29 10:59:54 +0100
committerromaingimbert <romain.gimbert@orange.com>2019-01-30 11:52:59 +0100
commitcf9e2869aaff92b58fb1806b2403a6790d62a709 (patch)
tree455f22133ce3276ba203992eb3443c044ddf90b2 /src/test/resources/karatetest/features
parentef8fea9dac61407f29850a34c19a1effd1d4a5b9 (diff)
fix nbi test
-add karate test -fix listener resource Change-Id: I4904c40d65686c29404cfafd17ae6a5084cc4870 Issue-ID: EXTAPI-196 Signed-off-by: romaingimbert <romain.gimbert@orange.com>
Diffstat (limited to 'src/test/resources/karatetest/features')
-rw-r--r--src/test/resources/karatetest/features/00--ServiceCatalog.feature8
-rw-r--r--src/test/resources/karatetest/features/01--ServiceInventory.feature8
-rw-r--r--src/test/resources/karatetest/features/02--ServiceOrder.feature19
-rw-r--r--src/test/resources/karatetest/features/03--Subscriber.feature32
4 files changed, 65 insertions, 2 deletions
diff --git a/src/test/resources/karatetest/features/00--ServiceCatalog.feature b/src/test/resources/karatetest/features/00--ServiceCatalog.feature
index 2edd420..31fd148 100644
--- a/src/test/resources/karatetest/features/00--ServiceCatalog.feature
+++ b/src/test/resources/karatetest/features/00--ServiceCatalog.feature
@@ -36,3 +36,11 @@ Then status 200
And assert response.length == 21
And match $[0] contains { name : 'FreeRadius-service' }
+Scenario: findServiceCatalogWithoutWiremock
+* call Context.stopWiremock();
+Given path 'serviceSpecification','1e3feeb0-8e36-46c6-862c-236d9c626439'
+When method get
+Then status 500
+* call Context.startServers();
+
+
diff --git a/src/test/resources/karatetest/features/01--ServiceInventory.feature b/src/test/resources/karatetest/features/01--ServiceInventory.feature
index 2b657be..2065f8c 100644
--- a/src/test/resources/karatetest/features/01--ServiceInventory.feature
+++ b/src/test/resources/karatetest/features/01--ServiceInventory.feature
@@ -82,6 +82,14 @@ And match $[1].relatedParty contains { role : 'ONAPcustomer' , id : '6490' }
And match $[1].serviceSpecification contains { name : 'vFW' , id : '98d95267-5e0f-4531-abf8-f14b90031dc5' }
+Scenario: testServiceResourceGetInventoryWithoutWiremock
+* call Context.stopWiremock();
+Given path 'service','e4688e5f-61a0-4f8b-ae02-a2fbde623bcb'
+And params {serviceSpecification.name : 'vFW' , relatedParty.id : '6490'}
+When method get
+Then status 500
+* call Context.startServers();
+
diff --git a/src/test/resources/karatetest/features/02--ServiceOrder.feature b/src/test/resources/karatetest/features/02--ServiceOrder.feature
index 4ced372..c621709 100644
--- a/src/test/resources/karatetest/features/02--ServiceOrder.feature
+++ b/src/test/resources/karatetest/features/02--ServiceOrder.feature
@@ -416,4 +416,23 @@ And match $.orderItem[0].orderMessage[0] contains { code : '102' , field : 'ser
Given path 'serviceOrder',serviceOrderId
When method get
Then status 200
+* call Context.startServers();
+
+Scenario: testCheckServiceOrderWithSDCNotRespondingWithoutWiremock
+* call Context.stopWiremock();
+Given path 'serviceOrder'
+And request data[4]
+When method post
+Then status 201
+And def serviceOrderId = $.id
+Given path 'serviceOrder','test',serviceOrderId
+And request $
+When method put
+Then status 201
+And match $.id == serviceOrderId
+And match $.state == 'rejected'
+And match $.orderMessage[0] contains { code : '500' , messageInformation : 'Problem with SDC API' }
+Given path 'serviceOrder',serviceOrderId
+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
index 3a41c34..0d21ccb 100644
--- a/src/test/resources/karatetest/features/03--Subscriber.feature
+++ b/src/test/resources/karatetest/features/03--Subscriber.feature
@@ -9,6 +9,7 @@ Background:
* call Context.startServers();
* def data = read('../data/subscriber.json')
* def serviceOrderData = read('../data/serviceOrder.json')
+* configure retry = { count: 10, interval: 500 }
* def checkDateFormat =
"""
function(s) {
@@ -29,38 +30,65 @@ Given path 'hub'
And request data[0]
When method post
Then status 201
-Given url 'http://localhost:8080/nbi/api/v3/hub/'
+And def location = responseHeaders['Location'][0]
+Given path 'hub'
When method get
And match $ == '#[1]'
+Given url location
+When method delete
+Then status 204
Scenario: testGetByIdSubscriber
Given path 'hub'
+And request data[0]
+When method post
+Then status 201
+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' }
+Given path 'hub',Id
+When method delete
+Then status 204
Scenario: testFindSubscriber
Given path 'hub'
And request data[1]
When method post
Then status 201
+And def location1 = responseHeaders['Location'][0]
Given path 'hub'
And request data[2]
When method post
Then status 201
+And def location2 = responseHeaders['Location'][0]
Given path 'hub'
When method get
Then status 200
And match $ == '#notnull'
+Given url location1
+When method delete
+Then status 204
+Given url location2
+When method delete
+Then status 204
Scenario: testFindWithFilteringSubscriber
Given path 'hub'
+And request data[0]
+When method post
+Then status 201
+And def location = responseHeaders['Location'][0]
+Given path 'hub'
And params { query.eventType : 'ServiceOrderCreationNotification' }
When method get
Then status 200
And match $ == '#[1]'
+Given url location
+When method delete
+Then status 204
Scenario: testSubscriberDeletion
Given path 'hub'
@@ -93,8 +121,8 @@ Then status 201
And def serviceOrderId = $.id
Given path 'test/listener'
And params {serviceOrderId : '#(serviceOrderId)'}
+And retry until responseStatus == 200
When method get
-Then status 200
And assert response.length == 1
And match $[0] contains { eventId : '#notnull' , eventType : 'ServiceOrderCreationNotification' , eventDate : '#notnull' , event :'#notnull'}
And def eventId = $[0].eventId