diff options
author | luxin <luxin7@huawei.com> | 2018-02-11 11:51:55 +0800 |
---|---|---|
committer | luxin <luxin7@huawei.com> | 2018-02-11 11:51:55 +0800 |
commit | 37dfb03f3f8557214867d44f4edfabd282cea429 (patch) | |
tree | 3f6b09dfa1f68a90cec8f55babbc8c17ed1841d6 /ResmanagementService/service | |
parent | f5c915d621d3038a0b7aaf65a6885645865e8192 (diff) |
Increase test for GrantResServiceImpl
Change-Id: Iaa1ddba7bb79f9fd620186d8ed4b380687a29089
Issue-ID: VFC-747
Signed-off-by: luxin <luxin7@huawei.com>
Diffstat (limited to 'ResmanagementService/service')
-rw-r--r-- | ResmanagementService/service/src/test/java/org/onap/vfc/nfvo/resmanagement/service/group/impl/GrantResServiceImplTest.java | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/ResmanagementService/service/src/test/java/org/onap/vfc/nfvo/resmanagement/service/group/impl/GrantResServiceImplTest.java b/ResmanagementService/service/src/test/java/org/onap/vfc/nfvo/resmanagement/service/group/impl/GrantResServiceImplTest.java index 16690f0..6595787 100644 --- a/ResmanagementService/service/src/test/java/org/onap/vfc/nfvo/resmanagement/service/group/impl/GrantResServiceImplTest.java +++ b/ResmanagementService/service/src/test/java/org/onap/vfc/nfvo/resmanagement/service/group/impl/GrantResServiceImplTest.java @@ -21,9 +21,11 @@ import static org.junit.Assert.assertNotNull; import org.junit.Test;
import org.onap.vfc.nfvo.resmanagement.common.VimUtil;
import org.onap.vfc.nfvo.resmanagement.common.util.restclient.ServiceException;
+import org.onap.vfc.nfvo.resmanagement.service.business.impl.LimitsBusinessImpl;
import mockit.Mock;
import mockit.MockUp;
+import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
public class GrantResServiceImplTest {
@@ -48,4 +50,50 @@ public class GrantResServiceImplTest { assertNotNull(result);
}
+ /**
+ * {
+ * "resourceDefinitionId": "11111",
+ * "resourceTemplate": {
+ * "virtualComputeDescriptor": {
+ * "virtualCpu": {
+ * "numVirtualCpu": 1
+ * },
+ * "virtualMemory": {
+ * "virtualMemSize": 1//meminMB
+ * }
+ * },
+ * "virtualStorageDescriptor": {
+ * "typeOfStorage": "",
+ * "sizeOfStorage": 111,
+ * //diskinGB"swImageDescriptor": ""
+ * }
+ * },
+ * "type": "vdu",
+ * "vdu": "vdu_name"
+ * }
+ * <br>
+ *
+ * @return
+ * @since VFC 1.0
+ */
+ private JSONObject getAddResObj() {
+ JSONObject addResObj = new JSONObject();
+ JSONObject virtualCpu = new JSONObject();
+ virtualCpu.put("numVirtualCpu", 1);
+ JSONObject virtualMemory = new JSONObject();
+ virtualMemory.put("virtualMemSize", 1);
+ JSONObject virtualComputeDescriptor = new JSONObject();
+ virtualComputeDescriptor.put("virtualCpu", virtualCpu);
+ virtualComputeDescriptor.put("virtualMemory", virtualMemory);
+ JSONObject virtualStorageDescriptor = new JSONObject();
+ virtualStorageDescriptor.put("typeOfStorage", "");
+ virtualStorageDescriptor.put("sizeOfStorage", "1");
+ JSONObject resourceTemplate = new JSONObject();
+ resourceTemplate.put("virtualComputeDescriptor", virtualComputeDescriptor);
+ resourceTemplate.put("virtualStorageDescriptor", virtualStorageDescriptor);
+ addResObj.put("resourceDefinitionId", "1");
+ addResObj.put("resourceTemplate", resourceTemplate);
+
+ return addResObj;
+ }
}
|