diff options
-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;
+ }
}
|