2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2018 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.onap.appc.seqgen.objects;
23 import static org.junit.Assert.assertEquals;
24 import static org.junit.Assert.assertNotNull;
26 import org.junit.Before;
27 import org.junit.Test;
29 public class RequestInfoBuilderTest {
30 private RequestInfoBuilder builder;
34 builder = new RequestInfoBuilder();
38 public void testAction() {
39 String action = builder.action("Action").build().getAction();
40 assertNotNull(action);
41 assertEquals(action, "Action");
46 public void testActionLevel() {
47 String actionLevel = builder.actionLevel("ActionLevel").build().getActionLevel();
48 assertNotNull(actionLevel);
49 assertEquals(actionLevel, "ActionLevel");
54 public void testPayload() {
55 String payload = builder.payload("Payload").build().getPayload();
56 assertNotNull(payload);
57 assertEquals(payload, "Payload");
61 public void testActionIdentifier() {
62 assertNotNull(builder.actionIdentifier());
63 assertNotNull(builder.build().getActionIdentifier());
67 public void testVnfId() {
68 assertNotNull(builder.actionIdentifier());
69 String vnfId = builder.vnfId("VnfId").build().getActionIdentifier().getVnfId();
71 assertEquals(vnfId, "VnfId");
75 public void testVnfcName() {
76 assertNotNull(builder.actionIdentifier());
77 String vnfcName = builder.vnfcName("VnfcName").build().getActionIdentifier().getVnfcName();
78 assertNotNull(vnfcName);
79 assertEquals(vnfcName, "VnfcName");
83 public void testVServerId() {
84 assertNotNull(builder.actionIdentifier());
85 String vServerId = builder.vServerId("VServerId").build().getActionIdentifier().getvServerId();
86 assertNotNull(vServerId);
87 assertEquals(vServerId, "VServerId");
91 public void testBuild() {
92 RequestInfo info = builder.actionIdentifier()
95 .vServerId("VServerId")
97 .actionLevel("ActionLevel")
101 ActionIdentifier id = info.getActionIdentifier();
106 assertEquals(str, "VnfId");
107 str = id.getVnfcName();
109 assertEquals(str, "VnfcName");
110 str = id.getvServerId();
112 assertEquals(str, "VServerId");
113 str = info.getAction();
115 assertEquals(str, "Action");
116 str = info.getActionLevel();
118 assertEquals(str, "ActionLevel");
119 str = info.getPayload();
121 assertEquals(str, "Payload");