aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/resources/karatetest/features/03--Subscriber.feature
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/03--Subscriber.feature
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/03--Subscriber.feature')
-rw-r--r--src/test/resources/karatetest/features/03--Subscriber.feature32
1 files changed, 30 insertions, 2 deletions
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