Unit test for Workflow Management API classes
[appc.git] / appc-dispatcher / appc-workflow-management / appc-workflow-management-api / src / test / java / org / onap / appc / workflow / objects / TestWorkflowExistsOutput.java
1 /*
2 * ============LICENSE_START=======================================================
3 * ONAP : APPC
4 * ================================================================================
5 * Copyright 2018 TechMahindra
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
10 *
11 *     http://www.apache.org/licenses/LICENSE-2.0
12 *
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=========================================================
19 */
20 package org.onap.appc.workflow.objects;
21
22 import static org.junit.Assert.*;
23
24 import org.junit.Assert;
25 import org.junit.Before;
26 import org.junit.Test;
27
28 public class TestWorkflowExistsOutput {
29     private WorkflowExistsOutput workflowExistsOutput;
30
31     private WorkflowExistsOutput workflowExistsOutput1;
32     @Before
33     public void SetUp() {
34         workflowExistsOutput=new WorkflowExistsOutput();
35         workflowExistsOutput1=new WorkflowExistsOutput(true,true);
36     }
37
38     @Test
39     public void testGetWorkflowName() {
40         workflowExistsOutput.setWorkflowName("workflowName");
41         Assert.assertNotNull(workflowExistsOutput.getWorkflowName());
42         Assert.assertEquals(workflowExistsOutput.getWorkflowName(), "workflowName");
43     }
44
45     @Test
46     public void testGetWorkflowVersion() {
47         workflowExistsOutput.setWorkflowVersion("1.0");
48         Assert.assertNotNull(workflowExistsOutput.getWorkflowVersion());
49         Assert.assertEquals(workflowExistsOutput.getWorkflowVersion(), "1.0");
50     }
51
52     @Test
53     public void testGetWorkflowModule() {
54         workflowExistsOutput.setWorkflowModule("appc");
55         Assert.assertNotNull(workflowExistsOutput.getWorkflowModule());
56         Assert.assertEquals(workflowExistsOutput.getWorkflowModule(), "appc");
57     }
58
59     @Test
60     public void testMappingExist() {
61         workflowExistsOutput.setMappingExist(true);
62         Assert.assertNotNull(workflowExistsOutput.isMappingExist());
63         Assert.assertEquals(workflowExistsOutput.isMappingExist(), true);
64     }
65
66     @Test
67     public void testDgExist() {
68         workflowExistsOutput.setDgExist(true);
69         Assert.assertNotNull(workflowExistsOutput.isDgExist());
70         Assert.assertEquals(workflowExistsOutput.isDgExist(), true);
71     }
72
73     @Test
74     public void testexists() {
75         Assert.assertNotNull(workflowExistsOutput1.exists());
76         
77     }
78
79     @Test
80     public void testToString_ReturnNonEmptyString() {
81         assertNotEquals(workflowExistsOutput.toString(), "");
82         assertNotEquals(workflowExistsOutput.toString(), null);
83     }
84
85     @Test
86     public void testToString_ContainsString() {
87         assertTrue(workflowExistsOutput.toString().contains("dgExist"));
88     }
89 }