8 * def Context = Java.type('org.onap.nbi.test.Context');
9 * call Context.startServers();
10 * def data = read('../data/subscriber.json')
11 * def serviceOrderData = read('../data/serviceOrder.json')
12 * configure retry = { count: 10, interval: 500 }
13 * def checkDateFormat =
16 var SimpleDateFormat = Java.type("java.text.SimpleDateFormat");
17 var sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
22 Scenario: testFindWhenNoSubscriber
28 Scenario: testCreationAndFindSubscriber
33 And def location = responseHeaders['Location'][0]
41 Scenario: testGetByIdSubscriber
51 And match $ contains { callback : 'http://localhost:8080/test' , query : 'eventType=ServiceOrderCreationNotification' }
56 Scenario: testFindSubscriber
61 And def location1 = responseHeaders['Location'][0]
66 And def location2 = responseHeaders['Location'][0]
70 And match $ == '#notnull'
78 Scenario: testFindWithFilteringSubscriber
83 And def location = responseHeaders['Location'][0]
85 And params { query.eventType : 'ServiceOrderCreationNotification' }
93 Scenario: testSubscriberDeletion
95 And request { id : 'id', callback : 'http://localhost:8080/test' , query : 'eventType = ServiceOrderCreationNotification' }
105 Scenario: testSubscriberWithTestListener
106 * def listenerUrl = nbiBaseUrl + "/test/listener"
107 Given path 'test/listener'
111 And request { id : 'id', callback : '#(listenerUrl)' , query : 'eventType = ServiceOrderCreationNotification' }
116 And def hubId = $[0].id
117 Given path 'serviceOrder'
118 And request serviceOrderData[17]
121 And def serviceOrderId = $.id
122 Given path 'test/listener'
123 And params {serviceOrderId : '#(serviceOrderId)'}
124 And retry until responseStatus == 200
126 And assert response.length == 1
127 And match $[0] contains { eventId : '#notnull' , eventType : 'ServiceOrderCreationNotification' , eventDate : '#notnull' , event :'#notnull'}
128 And def eventId = $[0].eventId
129 And def eventDate = $[0].eventDate
130 And call checkDateFormat(eventDate)
131 Given path 'hub',hubId
134 Given path 'test/listener',eventId
137 Given path 'serviceOrder',serviceOrderId