aboutsummaryrefslogtreecommitdiffstats
path: root/src/orchestrator/pkg/module/project_test.go
diff options
context:
space:
mode:
authorRajamohan Raj <rajamohan.raj@intel.com>2020-02-19 19:35:38 +0000
committerRajamohan Raj <rajamohan.raj@intel.com>2020-02-19 20:54:37 +0000
commit260be59a550c865ce5be6b127e198c40fb45714d (patch)
tree1b0c97fbb528a9a309edd0d438b7939a70847116 /src/orchestrator/pkg/module/project_test.go
parent8af74ae61508a3fbfd54c25d1cfe037f3ad08ca5 (diff)
Made changes to the Project API.
Issue-ID: MULTICLOUD-875 Signed-off-by: Rajamohan Raj <rajamohan.raj@intel.com> Change-Id: Ie1e9404069dae883ece8c6b1ca5eb07d284f96c0
Diffstat (limited to 'src/orchestrator/pkg/module/project_test.go')
-rw-r--r--src/orchestrator/pkg/module/project_test.go36
1 files changed, 27 insertions, 9 deletions
diff --git a/src/orchestrator/pkg/module/project_test.go b/src/orchestrator/pkg/module/project_test.go
index 7f4d9b3e..90fe30bc 100644
--- a/src/orchestrator/pkg/module/project_test.go
+++ b/src/orchestrator/pkg/module/project_test.go
@@ -1,5 +1,5 @@
/*
- * Copyright 2018 Intel Corporation, Inc
+ * Copyright 2020 Intel Corporation, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@ import (
"github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/db"
+
pkgerrors "github.com/pkg/errors"
)
@@ -37,12 +38,20 @@ func TestCreateProject(t *testing.T) {
{
label: "Create Project",
inp: Project{
- ProjectName: "testProject",
- Description: "A sample Project used for unit testing",
+ MetaData: ProjectMetaData{
+ Name: "testProject",
+ Description: "A sample Project used for unit testing",
+ UserData1: "data1",
+ UserData2: "data2",
+ },
},
expected: Project{
- ProjectName: "testProject",
- Description: "A sample Project used for unit testing",
+ MetaData: ProjectMetaData{
+ Name:"testProject",
+ Description: "A sample Project used for unit testing",
+ UserData1: "data1",
+ UserData2: "data2",
+ },
},
expectedError: "",
mockdb: &db.MockDB{},
@@ -92,16 +101,25 @@ func TestGetProject(t *testing.T) {
label: "Get Project",
name: "testProject",
expected: Project{
- ProjectName: "testProject",
- Description: "Test project for unit testing",
+ MetaData: ProjectMetaData{
+ Name: "testProject",
+ Description: "Test project for unit testing",
+ UserData1: "userData1",
+ UserData2: "userData2",
+ },
},
expectedError: "",
mockdb: &db.MockDB{
Items: map[string]map[string][]byte{
ProjectKey{ProjectName: "testProject"}.String(): {
"projectmetadata": []byte(
- "{\"project-name\":\"testProject\"," +
- "\"description\":\"Test project for unit testing\"}"),
+ "{" +
+ "\"metadata\" : {"+
+ "\"Name\":\"testProject\"," +
+ "\"Description\":\"Test project for unit testing\"," +
+ "\"UserData1\": \"userData1\","+
+ "\"UserData2\":\"userData2\"}"+
+ "}"),
},
},
},