Epic-231:versioning, and backup the configuration
[sdnc/oam.git] / configbackuprestore / vnfconfigbackupservice / src / test / java / com / onap / sdnc / vnfbackupservice / model / VnfConfigDetailsDBTest.java
1 /*
2 * ============LICENSE_START=======================================================
3 * ONAP : SDNC-FEATURES
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 com.onap.sdnc.vnfbackupservice.model;
21
22 import static org.junit.Assert.assertEquals;
23
24 import java.sql.Timestamp;
25
26 import org.junit.Test;
27
28 import com.onap.sdnc.vnfbackupservice.model.VnfConfigDetailsDB;
29
30 public class VnfConfigDetailsDBTest {
31
32         @Test
33         public void configDetailsDbTest() {
34
35                 long millis = System.currentTimeMillis();
36                 Timestamp date = new java.sql.Timestamp(millis);
37                 String configinfo = "configifo";
38                 Timestamp creationDate = date;
39                 Timestamp lastupdated = date;
40                 int status = 1;
41                 String vnfid = "vnfId";
42                 String vnfname = "vnfname";
43                 String vnfversion = "Version-1";
44
45                 VnfConfigDetailsDB vnfConfigDetailsDB = new VnfConfigDetailsDB();
46                 vnfConfigDetailsDB.setVnfid(vnfid);
47                 vnfConfigDetailsDB.setConfiginfo(configinfo);
48                 vnfConfigDetailsDB.setCreationdate(creationDate);
49                 vnfConfigDetailsDB.setLastupdated(lastupdated);
50                 vnfConfigDetailsDB.setStatus(status);
51                 vnfConfigDetailsDB.setVnfname(vnfname);
52                 vnfConfigDetailsDB.setVnfversion(vnfversion);
53
54                 assertEquals(vnfid, vnfConfigDetailsDB.getVnfid());
55                 assertEquals(configinfo, vnfConfigDetailsDB.getConfiginfo());
56                 assertEquals(creationDate, vnfConfigDetailsDB.getCreationdate());
57                 assertEquals(lastupdated, vnfConfigDetailsDB.getLastupdated());
58                 assertEquals(status, vnfConfigDetailsDB.getStatus());
59                 assertEquals(vnfname, vnfConfigDetailsDB.getVnfname());
60                 assertEquals(vnfversion, vnfConfigDetailsDB.getVnfversion());
61         }
62 }