2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 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
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 static org.mockito.Mockito.mock;
25 import static org.mockito.Mockito.verify;
26 import static org.mockito.Mockito.when;
28 import java.sql.Timestamp;
30 import org.junit.After;
31 import org.junit.Before;
32 import org.junit.Test;
34 public class WatchdogServiceModVerIdLookupTest {
36 WatchdogServiceModVerIdLookup _watchdogServiceModVerIdLookup;
38 protected String _distributionId;
39 protected String _serviceModelVersionId;
40 protected Timestamp _createTime;
42 public WatchdogServiceModVerIdLookupTest() {
47 _watchdogServiceModVerIdLookup = mock(WatchdogServiceModVerIdLookup.class);
48 _serviceModelVersionId = "12abad84e7ff";
49 _createTime = new Timestamp (System.currentTimeMillis());
51 when(_watchdogServiceModVerIdLookup.getDistributionId()).thenReturn(_distributionId);
52 when(_watchdogServiceModVerIdLookup.getServiceModelVersionId()).thenReturn(_serviceModelVersionId);
53 when(_watchdogServiceModVerIdLookup.getCreateTime()).thenReturn(_createTime);
57 public void tearDown() {
58 _watchdogServiceModVerIdLookup = null;
62 * Test of getDistributionId method
65 public void testGetDistributionId() {
66 _watchdogServiceModVerIdLookup.setDistributionId(_distributionId);
67 assertEquals(_watchdogServiceModVerIdLookup.getDistributionId(),_distributionId);
72 * Test setDistributionId method
75 public void testSetDistributionId() {
76 _watchdogServiceModVerIdLookup.setDistributionId(_distributionId);
77 verify(_watchdogServiceModVerIdLookup).setDistributionId(_distributionId);
81 * Test of getServiceModelVersionId method
84 public void testGetServiceModelVersionId() {
85 _watchdogServiceModVerIdLookup.setServiceModelVersionId(_serviceModelVersionId);
86 assertEquals(_watchdogServiceModVerIdLookup.getServiceModelVersionId(),_serviceModelVersionId);
91 * Test setServiceModelVersionId method
94 public void testSetServiceModelVersionId() {
95 _watchdogServiceModVerIdLookup.setServiceModelVersionId(_serviceModelVersionId);
96 verify(_watchdogServiceModVerIdLookup).setServiceModelVersionId(_serviceModelVersionId);
100 * Test of getCreateTime method
103 public void testGetCreateTime() {
104 _watchdogServiceModVerIdLookup.setCreateTime(_createTime);
105 assertEquals(_watchdogServiceModVerIdLookup.getCreateTime(),_createTime);
110 * Test setCreateTime method
113 public void testSetCreateTime() {
114 _watchdogServiceModVerIdLookup.setCreateTime(_createTime);
115 verify(_watchdogServiceModVerIdLookup).setCreateTime(_createTime);