From cf9e2869aaff92b58fb1806b2403a6790d62a709 Mon Sep 17 00:00:00 2001 From: romaingimbert Date: Tue, 29 Jan 2019 10:59:54 +0100 Subject: fix nbi test -add karate test -fix listener resource Change-Id: I4904c40d65686c29404cfafd17ae6a5084cc4870 Issue-ID: EXTAPI-196 Signed-off-by: romaingimbert --- .../karatetest/features/03--Subscriber.feature | 32 ++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'src/test/resources/karatetest/features/03--Subscriber.feature') 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 -- cgit 1.2.3-korg