2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright 2018 TechMahindra
\r
6 *=================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
21 package org.openecomp.mso.bpmn.common.adapter.vnf;
\r
23 import static org.junit.Assert.*;
\r
24 import org.junit.Test;
\r
25 import org.openecomp.mso.bpmn.common.adapter.vnf.CreateVnfNotification.Outputs;
\r
26 import org.openecomp.mso.bpmn.common.adapter.vnf.CreateVnfNotification.Outputs.Entry;
\r
28 public class QueryVnfNotificationTest {
\r
29 private QueryVnfNotification qvn=new QueryVnfNotification();
\r
32 public void test() {
\r
33 Entry ent = new Entry();
\r
34 MsoExceptionCategory exception = MsoExceptionCategory.OPENSTACK;
\r
35 Outputs opt=new Outputs();
\r
36 VnfStatus vnf=VnfStatus.ACTIVE;
\r
37 qvn.setCompleted(true);
\r
38 qvn.setErrorMessage("error");
\r
39 qvn.setException(exception);
\r
40 qvn.setMessageId("id");
\r
43 qvn.setVnfExists(true);
\r
45 ent.setValue("value");
\r
46 assert(qvn.getErrorMessage().equals("error"));
\r
47 assert(qvn.getException()).equals(exception);
\r
48 assert(qvn.getMessageId()).equals("id");
\r
49 assert(qvn.getStatus()).equals(vnf);
\r
50 assert(qvn.getVnfId()).equals("id");
\r
51 assertTrue(qvn.isVnfExists());
\r
52 assertTrue(qvn.isCompleted());
\r
53 assert(opt.getEntry()!=null);
\r
54 assert(opt.toString()!=null);
\r
55 assert(ent.getValue()).equals("value");
\r
56 assert(ent.getKey()).equals("key");
\r
57 assert(ent.toString()!=null);
\r
58 assert(qvn.toString()!=null);
\r