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 * def checkDateFormat =
15 var SimpleDateFormat = Java.type("java.text.SimpleDateFormat");
16 var sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
21 Scenario: testFindWhenNoSubscriber
27 Scenario: testCreationAndFindSubscriber
32 Given url 'http://localhost:8080/nbi/api/v3/hub/'
36 Scenario: testGetByIdSubscriber
42 And match $ contains { callback : 'http://localhost:8080/test' , query : 'eventType=ServiceOrderCreationNotification' }
44 Scenario: testFindSubscriber
56 And match $ == '#notnull'
58 Scenario: testFindWithFilteringSubscriber
60 And params { query.eventType : 'ServiceOrderCreationNotification' }
65 Scenario: testSubscriberDeletion
67 And request { id : 'id', callback : 'http://localhost:8080/test' , query : 'eventType = ServiceOrderCreationNotification' }
77 Scenario: testSubscriberWithTestListener
78 * def listenerUrl = nbiBaseUrl + "/test/listener"
79 Given path 'test/listener'
83 And request { id : 'id', callback : '#(listenerUrl)' , query : 'eventType = ServiceOrderCreationNotification' }
88 And def hubId = $[0].id
89 Given path 'serviceOrder'
90 And request serviceOrderData[17]
93 And def serviceOrderId = $.id
94 Given path 'test/listener'
95 And params {serviceOrderId : '#(serviceOrderId)'}
98 And assert response.length == 1
99 And match $[0] contains { eventId : '#notnull' , eventType : 'ServiceOrderCreationNotification' , eventDate : '#notnull' , event :'#notnull'}
100 And def eventId = $[0].eventId
101 And def eventDate = $[0].eventDate
102 And call checkDateFormat(eventDate)
103 Given path 'hub',hubId
106 Given path 'test/listener',eventId
109 Given path 'serviceOrder',serviceOrderId