2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.mso.requestsdb;
23 import static org.junit.Assert.assertEquals;
24 import java.sql.Timestamp;
25 import org.junit.Test;
27 public class WatchdogServiceModVerIdLookupTest {
29 WatchdogServiceModVerIdLookup wsmil=new WatchdogServiceModVerIdLookup();
30 Timestamp time=new Timestamp(10);
33 wsmil.setCreateTime(time);
34 wsmil.setDistributionId("distributionId");
35 wsmil.setServiceModelVersionId("serviceModelVersionId");
37 assertEquals(wsmil.getCreateTime(),time);
38 assertEquals(wsmil.getDistributionId(), "distributionId");
39 assertEquals(wsmil.getServiceModelVersionId(), "serviceModelVersionId");
42 /*WatchdogServiceModVerIdLookup _watchdogServiceModVerIdLookup;
44 protected String _distributionId;
45 protected String _serviceModelVersionId;
46 protected Timestamp _createTime;
48 public WatchdogServiceModVerIdLookupTest() {
53 _watchdogServiceModVerIdLookup = mock(WatchdogServiceModVerIdLookup.class);
54 _serviceModelVersionId = "12abad84e7ff";
55 _createTime = new Timestamp (System.currentTimeMillis());
57 when(_watchdogServiceModVerIdLookup.getDistributionId()).thenReturn(_distributionId);
58 when(_watchdogServiceModVerIdLookup.getServiceModelVersionId()).thenReturn(_serviceModelVersionId);
59 when(_watchdogServiceModVerIdLookup.getCreateTime()).thenReturn(_createTime);
63 public void tearDown() {
64 _watchdogServiceModVerIdLookup = null;
68 * Test of getDistributionId method
71 public void testGetDistributionId() {
72 _watchdogServiceModVerIdLookup.setDistributionId(_distributionId);
73 assertEquals(_watchdogServiceModVerIdLookup.getDistributionId(),_distributionId);
78 * Test setDistributionId method
81 public void testSetDistributionId() {
82 _watchdogServiceModVerIdLookup.setDistributionId(_distributionId);
83 verify(_watchdogServiceModVerIdLookup).setDistributionId(_distributionId);
87 * Test of getServiceModelVersionId method
90 public void testGetServiceModelVersionId() {
91 _watchdogServiceModVerIdLookup.setServiceModelVersionId(_serviceModelVersionId);
92 assertEquals(_watchdogServiceModVerIdLookup.getServiceModelVersionId(),_serviceModelVersionId);
97 * Test setServiceModelVersionId method
100 public void testSetServiceModelVersionId() {
101 _watchdogServiceModVerIdLookup.setServiceModelVersionId(_serviceModelVersionId);
102 verify(_watchdogServiceModVerIdLookup).setServiceModelVersionId(_serviceModelVersionId);
106 * Test of getCreateTime method
109 public void testGetCreateTime() {
110 _watchdogServiceModVerIdLookup.setCreateTime(_createTime);
111 assertEquals(_watchdogServiceModVerIdLookup.getCreateTime(),_createTime);
116 * Test setCreateTime method
119 public void testSetCreateTime() {
120 _watchdogServiceModVerIdLookup.setCreateTime(_createTime);
121 verify(_watchdogServiceModVerIdLookup).setCreateTime(_createTime);