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=========================================================
24 package org.openecomp.mso.requestsdb;
26 import org.junit.Test;
27 import org.mockito.Mockito;
29 import static org.junit.Assert.assertEquals;
30 import static org.mockito.Matchers.any;
31 import static org.mockito.Mockito.doNothing;
32 import static org.mockito.Mockito.mock;
33 import static org.mockito.Mockito.times;
34 import static org.mockito.Mockito.verify;
37 public class WatchdogServiceModVerIdLookupDbTest {
39 private static final String distributionId = "ff3514e3-5a33-55df-13ab-12abad84e7ff";
40 private static final String serviceModelVersionId = "SENT";
43 public void testInsertWatchdogServiceModVerIdLookup() {
45 WatchdogServiceModVerIdLookupDb wdsm = mock(WatchdogServiceModVerIdLookupDb.class);
47 wdsm.insertWatchdogServiceModVerIdLookup(distributionId, serviceModelVersionId);
48 doNothing().when(wdsm).insertWatchdogServiceModVerIdLookup(any(String.class), any(String.class));
49 verify(wdsm, times(1)).insertWatchdogServiceModVerIdLookup(any(String.class), any(String.class));
54 public void testGetWatchdogServiceModVerId() {
56 WatchdogServiceModVerIdLookupDb wdsm = Mockito.mock(WatchdogServiceModVerIdLookupDb.class);
57 Mockito.when(wdsm.getWatchdogServiceModVerId("ff305d54-75b4-431b-adb2-eb6b9e5ff001")).thenReturn("ff3514e3-5a33-55df-13ab-12abad84e7ff");
58 String actual = wdsm.getWatchdogServiceModVerId("ff305d54-75b4-431b-adb2-eb6b9e5ff001");
59 assertEquals(actual, "ff3514e3-5a33-55df-13ab-12abad84e7ff");
60 verify(wdsm, times(1)).getWatchdogServiceModVerId(any(String.class));