diff options
author | 2018-02-11 06:11:52 +0000 | |
---|---|---|
committer | 2018-02-11 06:11:52 +0000 | |
commit | f21bb5f000ac8afb398234495afd331da56741a0 (patch) | |
tree | cf70ab7aca2c1bd174f1c626a4253eb304dbc1c1 | |
parent | 6efa70d28736aab464218277e25661b6f9b0fc95 (diff) | |
parent | 37dfb03f3f8557214867d44f4edfabd282cea429 (diff) |
Merge "Increase test for GrantResServiceImpl"
-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;
+ }
}
|