2 * Copyright (c) 2018 Orange
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.onap.nbi.apis.assertions;
18 import org.onap.nbi.apis.hub.model.Event;
19 import org.onap.nbi.apis.hub.model.EventType;
20 import org.onap.nbi.apis.hub.model.Subscription;
22 import java.util.Date;
23 import java.util.UUID;
25 public class HubAssertions {
27 public static Subscription createServiceOrderCreationSubscription(){
28 Subscription subscription = new Subscription();
29 subscription.setId("id");
30 subscription.setCallback("http://localhost:8080/test");
31 subscription.setQuery("eventType = ServiceOrderCreationNotification");
35 public static Subscription createServiceOrderStateChangeSubscription(){
36 Subscription subscription = new Subscription();
37 subscription.setId("id");
38 subscription.setCallback("http://localhost/test");
39 subscription.setQuery("eventType = ServiceOrderStateChangeNotification");
43 public static Subscription createServiceOrderItemStateChangeSubscription(){
44 Subscription subscription = new Subscription();
45 subscription.setId("id");
46 subscription.setCallback("http://localhost/test");
47 subscription.setQuery("eventType = ServiceOrderItemStateChangeNotification");
51 public static Event createFakeEvent() {
52 Event event = new Event();
53 event.setEventId(UUID.randomUUID().toString());
54 event.setEventDate(new Date());
55 event.setEventType(EventType.SERVICE_ORDER_CREATION.value());