Catalog alignment
[sdc.git] / catalog-be / src / test / java / org / openecomp / sdc / be / info / DistributionStatusOfServiceInfoTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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
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  * Modifications copyright (c) 2019 Nokia
20  * ================================================================================
21  */
22 package org.openecomp.sdc.be.info;
23
24 import org.junit.Test;
25
26 import static com.google.code.beanmatchers.BeanMatchers.hasValidBeanConstructor;
27 import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters;
28 import static org.hamcrest.CoreMatchers.is;
29 import static org.hamcrest.MatcherAssert.assertThat;
30
31 public class DistributionStatusOfServiceInfoTest {
32
33         private static final String STATUS = "status";
34         private static final String USER_ID = "userID";
35         private static final String TIMESTAMP = "timestamp";
36         private static final String DISTRIBUTION_ID = "distributionID";
37
38         private DistributionStatusOfServiceInfo createTestSubject() {
39                 return new DistributionStatusOfServiceInfo();
40         }
41
42         @Test
43         public void testCtor() throws Exception {
44                 new DistributionStatusOfServiceInfo("","","","");
45         }
46
47
48         @Test
49         public void testGetDistributionID() throws Exception {
50                 DistributionStatusOfServiceInfo testSubject;
51                 String result;
52
53                 // default test
54                 testSubject = createTestSubject();
55                 result = testSubject.getDistributionID();
56         }
57
58
59         @Test
60         public void testSetDistributionID() throws Exception {
61                 DistributionStatusOfServiceInfo testSubject;
62                 String distributionID = "";
63
64                 // default test
65                 testSubject = createTestSubject();
66                 testSubject.setDistributionID(distributionID);
67         }
68
69
70         @Test
71         public void testGetTimestamp() throws Exception {
72                 DistributionStatusOfServiceInfo testSubject;
73                 String result;
74
75                 // default test
76                 testSubject = createTestSubject();
77                 result = testSubject.getTimestamp();
78         }
79
80
81         @Test
82         public void testSetTimestamp() throws Exception {
83                 DistributionStatusOfServiceInfo testSubject;
84                 String timestamp = "";
85
86                 // default test
87                 testSubject = createTestSubject();
88                 testSubject.setTimestamp(timestamp);
89         }
90
91
92         @Test
93         public void testGetUserId() throws Exception {
94                 DistributionStatusOfServiceInfo testSubject;
95                 String result;
96
97                 // default test
98                 testSubject = createTestSubject();
99                 result = testSubject.getUserId();
100         }
101
102
103         @Test
104         public void testSetUserId() throws Exception {
105                 DistributionStatusOfServiceInfo testSubject;
106                 String userId = "";
107
108                 // default test
109                 testSubject = createTestSubject();
110                 testSubject.setUserId(userId);
111         }
112
113
114         @Test
115         public void testGetDeployementStatus() throws Exception {
116                 DistributionStatusOfServiceInfo testSubject;
117                 String result;
118
119                 // default test
120                 testSubject = createTestSubject();
121                 result = testSubject.getDeployementStatus();
122         }
123
124
125         @Test
126         public void testSetDeployementStatus() throws Exception {
127                 DistributionStatusOfServiceInfo testSubject;
128                 String deployementStatus = "";
129
130                 // default test
131                 testSubject = createTestSubject();
132                 testSubject.setDeployementStatus(deployementStatus);
133         }
134
135
136         @Test
137         public void shouldHaveValidDefaultConstructor() {
138                 assertThat(DistributionStatusOfServiceInfo.class, hasValidBeanConstructor());
139         }
140
141         @Test
142         public void shouldHaveValidGettersAndSetters() {
143                 assertThat(DistributionStatusOfServiceInfo.class, hasValidGettersAndSetters());
144         }
145
146         @Test
147         public void shouldTestWhetherTheDefaultConstructorCorrectlySetAllFields() {
148                 DistributionStatusOfServiceInfo distributionStatusOfServiceInfo = new DistributionStatusOfServiceInfo(
149                                 DISTRIBUTION_ID, TIMESTAMP, USER_ID, STATUS);
150                 assertThat(distributionStatusOfServiceInfo.getDistributionID(), is(DISTRIBUTION_ID));
151                 assertThat(distributionStatusOfServiceInfo.getTimestamp(), is(TIMESTAMP));
152                 assertThat(distributionStatusOfServiceInfo.getUserId(), is(USER_ID));
153                 assertThat(distributionStatusOfServiceInfo.getDeployementStatus(), is(STATUS));
154         }
155
156
157 }