2 * Copyright 2016-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.openo.nfvo.resmanagement.service.business.impl;
19 import org.junit.Before;
20 import org.junit.Test;
21 import org.openo.baseservice.remoteservice.exception.ServiceException;
22 import org.openo.baseservice.roa.util.restclient.HttpRest;
23 import org.openo.baseservice.roa.util.restclient.RestfulOptions;
24 import org.openo.baseservice.roa.util.restclient.RestfulParametes;
25 import org.openo.baseservice.roa.util.restclient.RestfulResponse;
29 import net.sf.json.JSONObject;
31 public class LimitsBusinessImplTest {
33 private LimitsBusinessImpl limitsBusinessImpl;
36 public void setUp() throws ServiceException {
37 limitsBusinessImpl = new LimitsBusinessImpl();
41 public void testGetCpuLimits() throws ServiceException {
42 new MockUp<HttpRest>() {
45 public RestfulResponse get(String servicePath, RestfulParametes restParametes, RestfulOptions option)
46 throws ServiceException {
47 RestfulResponse rsp = new RestfulResponse();
52 JSONObject paramJson = new JSONObject();
53 paramJson.put("vimId", "vimId");
54 paramJson.put("tenantId", "tenantId");
58 public void testgetLimits() throws ServiceException {
59 new MockUp<HttpRest>() {
62 public RestfulResponse get(String servicePath, RestfulParametes restParametes, RestfulOptions option)
63 throws ServiceException {
64 RestfulResponse rsp = new RestfulResponse();