2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.policy.template.demo;
23 import java.util.HashMap;
24 import java.util.UUID;
26 import org.junit.Test;
27 import org.openecomp.policy.appc.CommonHeader;
28 import org.openecomp.policy.appc.Request;
29 import org.openecomp.policy.appc.util.Serialization;
30 import org.openecomp.policy.vnf.trafficgenerator.PGRequest;
31 import org.openecomp.policy.vnf.trafficgenerator.PGStream;
32 import org.openecomp.policy.vnf.trafficgenerator.PGStreams;
34 public class TestAPPCPayload {
38 PGRequest request = new PGRequest();
39 request.pgStreams = new PGStreams();
42 for(int i = 0; i < 5; i++){
43 pgStream = new PGStream();
44 pgStream.streamId = "fw_udp"+(i+1);
45 pgStream.isEnabled = "true";
46 request.pgStreams.pgStream.add(pgStream);
49 Request appc = new Request();
50 appc.CommonHeader = new CommonHeader();
51 appc.CommonHeader.RequestID = UUID.randomUUID();
52 appc.Action = "ModifyConfig";
53 appc.Payload = new HashMap<String, Object>();
54 appc.Payload.put("pg-streams", request);
55 System.out.println(Serialization.gsonPretty.toJson(appc));