2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * ===================================================================
8 * Unless otherwise specified, all software contained herein is licensed
9 * under the Apache License, Version 2.0 (the "License");
10 * you may not use this software except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * Unless otherwise specified, all documentation contained herein is licensed
22 * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
23 * you may not use this documentation except in compliance with the License.
24 * You may obtain a copy of the License at
26 * https://creativecommons.org/licenses/by/4.0/
28 * Unless required by applicable law or agreed to in writing, documentation
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
34 * ============LICENSE_END============================================
38 package org.onap.portalapp.portal.model;
40 import static org.junit.Assert.assertEquals;
41 import static org.junit.Assert.assertFalse;
42 import static org.junit.Assert.assertNotNull;
43 import static org.junit.Assert.assertTrue;
45 import org.junit.Test;
46 import org.onap.portalapp.portal.ecomp.model.AppContactUsItem;
48 public class AppContactUsItemTest {
50 private static final String TEST="test";
52 public AppContactUsItem mockAppContactUsItem(){
53 AppContactUsItem appContactUsItem = new AppContactUsItem();
55 appContactUsItem.setAppId((long)1);
56 appContactUsItem.setAppName(TEST);
57 appContactUsItem.setDescription(TEST);
58 appContactUsItem.setContactName(TEST);
59 appContactUsItem.setContactEmail(TEST);
60 appContactUsItem.setUrl(TEST);
61 appContactUsItem.setActiveYN(TEST);
63 return appContactUsItem;
68 public void appContactUsItemTest(){
69 AppContactUsItem appContactUsItem1 = mockAppContactUsItem();
71 AppContactUsItem appContactUsItem = new AppContactUsItem();
72 appContactUsItem.setAppId(appContactUsItem1.getAppId());
73 appContactUsItem.setAppName(appContactUsItem1.getAppName());
74 appContactUsItem.setDescription(appContactUsItem1.getDescription());
75 appContactUsItem.setContactName(appContactUsItem1.getContactName());
76 appContactUsItem.setContactEmail(appContactUsItem1.getContactEmail());
77 appContactUsItem.setUrl(appContactUsItem1.getUrl());
78 appContactUsItem.setActiveYN(appContactUsItem1.getActiveYN());
79 assertNotNull(appContactUsItem.toString());
81 assertEquals(appContactUsItem.hashCode(), appContactUsItem1.hashCode());
82 assertTrue(appContactUsItem.equals(appContactUsItem1));
83 assertFalse(appContactUsItem.equals(null));
84 appContactUsItem.setUrl(null);
85 assertFalse(appContactUsItem.equals(appContactUsItem1));
86 appContactUsItem.setDescription(null);
87 assertFalse(appContactUsItem.equals(appContactUsItem1));
88 appContactUsItem.setContactName(null);
89 assertFalse(appContactUsItem.equals(appContactUsItem1));
90 appContactUsItem.setContactEmail(null);
91 assertFalse(appContactUsItem.equals(appContactUsItem1));
92 appContactUsItem.setAppName(null);
93 assertFalse(appContactUsItem.equals(appContactUsItem1));
94 appContactUsItem.setAppId(null);
95 assertFalse(appContactUsItem.equals(appContactUsItem1));
96 appContactUsItem.setActiveYN(null);
97 assertFalse(appContactUsItem.equals(appContactUsItem1));