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: testcreateEventSubscription
24 And header Target = 'http://localhost:8080/nbi/api/v4'
29 And header Target = 'http://localhost:8080/nbi/api/v4'
30 Given path 'hub',hubId
33 And match hubId == $.id
34 Given path 'hub',hubId
35 And header Target = 'http://localhost:8080/nbi/api/v4'
39 Scenario: testPostListenerResource
40 * def listenerUrl = nbiBaseUrl + "/test/listener"
41 Given path 'test/listener'
45 And header Target = 'http://localhost:8080/nbi/api/v4'
46 And request { callback : '#(listenerUrl)' , query : 'eventType = ServiceOrderCreationNotification' }
50 Given path 'serviceOrder'
51 And request serviceOrderData[17]
52 And header Target = 'http://localhost:8080/nbi/api/v4'
55 And def serviceOrderId = $.id
56 Given path 'test/listener'
57 And params {serviceOrderId : '#(serviceOrderId)'}
58 And retry until responseStatus == 200
60 And assert response.length == 1
61 And match $[0] contains { eventId : '#notnull' , eventType : 'ServiceOrderCreationNotification' , eventDate : '#notnull' , event :'#notnull'}
62 And def eventId = $[0].eventId
63 And def eventDate = $[0].eventDate
64 And call checkDateFormat(eventDate)
65 Given path 'serviceOrder',serviceOrderId
68 Given path 'hub',hubId
69 And header Target = 'http://localhost:8080/nbi/api/v4'
72 Given path 'test/listener',eventId