2 * Copyright 2017 Huawei Technologies Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.onap.vfc.nfvo.res.service.dao.impl;
19 import static org.junit.Assert.*;
21 import org.junit.Test;
22 import org.onap.vfc.nfvo.res.service.dao.impl.AbstractDao;
23 import org.onap.vfc.nfvo.res.service.dao.impl.LocationDaoImpl;
24 import org.onap.vfc.nfvo.res.service.dao.impl.NetworkDaoImpl;
25 import org.onap.vfc.nfvo.res.service.entity.LocationEntity;
26 import org.onap.vfc.nfvo.res.service.entity.NetworkEntity;
27 import org.onap.vfc.nfvo.res.service.mapper.LocationMapper;
28 import org.openo.baseservice.remoteservice.exception.ServiceException;
33 public class LocationDaoImplTest {
34 LocationMapper mapper;
36 public void testaddHost() throws ServiceException {
38 new MockUp<AbstractDao>() {
41 public <T> T getMapperManager(Class<T> type) {
46 LocationDaoImpl impl = new LocationDaoImpl();
47 LocationEntity locationEntity =new LocationEntity();
48 locationEntity.setId("locationEntity");
54 public void testaddLocationSelective() throws ServiceException {
56 new MockUp<AbstractDao>() {
59 public <T> T getMapperManager(Class<T> type) {
64 LocationDaoImpl impl = new LocationDaoImpl();
65 LocationEntity locationEntity =new LocationEntity();
66 locationEntity.setId("1");
72 public void testupdateNetwork() throws ServiceException {
74 new MockUp<AbstractDao>() {
77 public <T> T getMapperManager(Class<T> type) {
82 NetworkDaoImpl impl = new NetworkDaoImpl();
83 NetworkEntity networkEntity =new NetworkEntity();
84 networkEntity.setId("1");