Merge "Reorder modifiers"
[so.git] / mso-api-handlers / mso-requests-db / src / test / java / org / openecomp / mso / requestsdb / WatchdogComponentDistributionStatusTest.java
1 /*
2 * ============LICENSE_START=======================================================
3 * ONAP : SO
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.openecomp.mso.requestsdb;
21
22 import static org.junit.Assert.assertEquals;
23 import java.sql.Timestamp;
24 import org.junit.Test;
25
26 public class WatchdogComponentDistributionStatusTest {
27     
28   WatchdogComponentDistributionStatus wcds=new WatchdogComponentDistributionStatus();
29   Timestamp time=new Timestamp(10);
30   
31   @Test
32   public void test(){
33       wcds.setComponentDistributionStatus("componentDistributionStatus");
34       wcds.setComponentName("componentName");
35       wcds.setCreateTime(time);
36       wcds.setDistributionId("distributionId");
37       wcds.setModifyTime(time);
38       
39       assertEquals(wcds.getComponentDistributionStatus(), "componentDistributionStatus");
40       assertEquals(wcds.getComponentName(), "componentName");
41       assertEquals(wcds.getCreateTime(), time);
42       assertEquals(wcds.getDistributionId(), "distributionId");
43       assertEquals(wcds.getModifyTime(), time);
44   }
45 }
46                 
47         /*WatchdogComponentDistributionStatus _watchdogComponentDistributionStatus;
48         
49         protected String _distributionId;
50         protected String _componentName;
51         protected String _componentDistributionStatus;
52         protected Timestamp _createTime;
53         protected Timestamp _modifyTime;
54
55         public WatchdogComponentDistributionStatusTest() {
56         }
57         
58     @Before
59         public void setUp() {
60         _watchdogComponentDistributionStatus = mock(WatchdogComponentDistributionStatus.class);
61         _distributionId = "12abad84e7ff";
62         _componentName = "MSO";
63         _componentDistributionStatus = "SENT";  
64         _createTime = new Timestamp (System.currentTimeMillis());
65         _modifyTime = new Timestamp (System.currentTimeMillis());
66         
67         when(_watchdogComponentDistributionStatus.getDistributionId()).thenReturn(_distributionId);
68         when(_watchdogComponentDistributionStatus.getComponentName()).thenReturn(_componentName);
69         when(_watchdogComponentDistributionStatus.getComponentDistributionStatus()).thenReturn(_componentDistributionStatus);
70         when(_watchdogComponentDistributionStatus.getCreateTime()).thenReturn(_createTime);
71         when(_watchdogComponentDistributionStatus.getModifyTime()).thenReturn(_modifyTime);
72         }
73     
74         @After
75         public void tearDown() {
76                 _watchdogComponentDistributionStatus = null;
77         }
78         
79         *//**
80          * Test of getDistributionId method
81          *//*
82         @Test
83         public void testGetDistributionId() {
84                 _watchdogComponentDistributionStatus.setDistributionId(_distributionId);
85                 assertEquals(_watchdogComponentDistributionStatus.getDistributionId(),_distributionId);
86
87         }
88
89         *//**
90          * Test setDistributionId  method
91          *//*
92         @Test
93         public void testSetDistributionId() {
94                 _watchdogComponentDistributionStatus.setDistributionId(_distributionId);
95                 verify(_watchdogComponentDistributionStatus).setDistributionId(_distributionId);
96         }
97         
98         *//**
99          * Test of getDistributionId method
100          *//*
101         @Test
102         public void testGetComponentName() {
103                 _watchdogComponentDistributionStatus.setComponentName(_componentName);
104                 assertEquals(_watchdogComponentDistributionStatus.getComponentName(),_componentName);
105
106         }
107
108         *//**
109          * Test setDistributionId  method
110          *//*
111         @Test
112         public void testSetComponentName() {
113                 _watchdogComponentDistributionStatus.setComponentName(_componentName);
114                 verify(_watchdogComponentDistributionStatus).setComponentName(_componentName);
115         }
116         
117         *//**
118          * Test of getDistributionId method
119          *//*
120         @Test
121         public void testGetComponentDistributionStatus() {
122                 _watchdogComponentDistributionStatus.setComponentDistributionStatus(_componentDistributionStatus);
123                 assertEquals(_watchdogComponentDistributionStatus.getComponentDistributionStatus(),_componentDistributionStatus);
124
125         }
126
127         *//**
128          * Test setDistributionId  method
129          *//*
130         @Test
131         public void testSetComponentDistributionStatus() {
132                 _watchdogComponentDistributionStatus.setComponentDistributionStatus(_componentDistributionStatus);
133                 verify(_watchdogComponentDistributionStatus).setComponentDistributionStatus(_componentDistributionStatus);
134         }
135         
136         *//**
137          * Test of getCreateTime method
138          *//*
139         @Test
140         public void testGetCreateTime() {
141                 _watchdogComponentDistributionStatus.setCreateTime(_createTime);
142                 System.out.println("CreateTime : " + _createTime);
143                 assertEquals(_watchdogComponentDistributionStatus.getCreateTime(),_createTime);
144
145         }
146
147         *//**
148          * Test setCreateTime method
149          *//*
150         @Test
151         public void testSetCreateTime() {
152                 _watchdogComponentDistributionStatus.setCreateTime(_createTime);
153                 verify(_watchdogComponentDistributionStatus).setCreateTime(_createTime);
154         }
155         
156         *//**
157          * Test of getModifyTime method
158          *//*
159         @Test
160         public void testGetModifyTime() {
161                 _watchdogComponentDistributionStatus.setModifyTime(_modifyTime);
162                 System.out.println("ModifyTime : " + _modifyTime);
163                 assertEquals(_watchdogComponentDistributionStatus.getModifyTime(),_modifyTime);
164
165         }
166
167         *//**
168          * Test setModifyTime method
169          *//*
170         @Test
171         public void testSetModifyTime() {
172                 _watchdogComponentDistributionStatus.setModifyTime(_modifyTime);
173                 verify(_watchdogComponentDistributionStatus).setModifyTime(_modifyTime);
174         }
175         
176 }
177 */