diff options
author | Srivahni Chivukula <srivahni.chivukula@intel.com> | 2020-02-14 05:11:08 -0800 |
---|---|---|
committer | Srivahni Chivukula <srivahni.chivukula@intel.com> | 2020-02-20 03:41:00 -0800 |
commit | b11b37f11fa45ab149e8a88a183b70f077c0f48e (patch) | |
tree | a9e0d2c0c65d7d822a736caf4e093f7df2f5aed3 /src/orchestrator/api/projecthandler_test.go | |
parent | 38df1b0ee0f1d6cd3bf11f94adf7c952f32c191c (diff) |
Add Composite Application API
Implemented Composite application API and added create,
get and delete handlers for the composite applications.
Formatted Project related .go files
Issue-ID: MULTICLOUD-994
Signed-off-by: Srivahni Chivukula <srivahni.chivukula@intel.com>
Change-Id: I7cef1a2c75f8cb39f397dcbb3f5d7bb2a57b4a72
Diffstat (limited to 'src/orchestrator/api/projecthandler_test.go')
-rw-r--r-- | src/orchestrator/api/projecthandler_test.go | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/orchestrator/api/projecthandler_test.go b/src/orchestrator/api/projecthandler_test.go index ee6ed358..c76764b3 100644 --- a/src/orchestrator/api/projecthandler_test.go +++ b/src/orchestrator/api/projecthandler_test.go @@ -86,23 +86,23 @@ func TestProjectCreateHandler(t *testing.T) { }`)), expected: moduleLib.Project{ MetaData: moduleLib.ProjectMetaData{ - Name: "testProject", + Name: "testProject", Description: "Test Project used for unit testing", - UserData1: "data1", - UserData2: "data2", + UserData1: "data1", + UserData2: "data2", }, }, projectClient: &mockProjectManager{ //Items that will be returned by the mocked Client Items: []moduleLib.Project{ - moduleLib.Project{ - MetaData: moduleLib.ProjectMetaData{ - Name: "testProject", - Description: "Test Project used for unit testing", - UserData1: "data1", - UserData2: "data2", - }, - }, + moduleLib.Project{ + MetaData: moduleLib.ProjectMetaData{ + Name: "testProject", + Description: "Test Project used for unit testing", + UserData1: "data1", + UserData2: "data2", + }, + }, }, }, }, @@ -119,7 +119,7 @@ func TestProjectCreateHandler(t *testing.T) { for _, testCase := range testCases { t.Run(testCase.label, func(t *testing.T) { request := httptest.NewRequest("POST", "/v2/projects", testCase.reader) - resp := executeRequest(request, NewRouter(testCase.projectClient)) + resp := executeRequest(request, NewRouter(testCase.projectClient, nil)) //Check returned code if resp.StatusCode != testCase.expectedCode { @@ -154,23 +154,23 @@ func TestProjectGetHandler(t *testing.T) { expectedCode: http.StatusOK, expected: moduleLib.Project{ MetaData: moduleLib.ProjectMetaData{ - Name: "testProject", + Name: "testProject", Description: "Test Project used for unit testing", - UserData1: "data1", - UserData2: "data2", + UserData1: "data1", + UserData2: "data2", }, }, name: "testProject", projectClient: &mockProjectManager{ Items: []moduleLib.Project{ - moduleLib.Project{ - MetaData: moduleLib.ProjectMetaData{ - Name: "testProject", - Description: "Test Project used for unit testing", - UserData1: "data1", - UserData2: "data2", - }, - }, + moduleLib.Project{ + MetaData: moduleLib.ProjectMetaData{ + Name: "testProject", + Description: "Test Project used for unit testing", + UserData1: "data1", + UserData2: "data2", + }, + }, }, }, }, @@ -188,7 +188,7 @@ func TestProjectGetHandler(t *testing.T) { for _, testCase := range testCases { t.Run(testCase.label, func(t *testing.T) { request := httptest.NewRequest("GET", "/v2/projects/"+testCase.name, nil) - resp := executeRequest(request, NewRouter(testCase.projectClient)) + resp := executeRequest(request, NewRouter(testCase.projectClient, nil)) //Check returned code if resp.StatusCode != testCase.expectedCode { @@ -237,7 +237,7 @@ func TestProjectDeleteHandler(t *testing.T) { for _, testCase := range testCases { t.Run(testCase.label, func(t *testing.T) { request := httptest.NewRequest("DELETE", "/v2/projects/"+testCase.name, nil) - resp := executeRequest(request, NewRouter(testCase.projectClient)) + resp := executeRequest(request, NewRouter(testCase.projectClient, nil)) //Check returned code if resp.StatusCode != testCase.expectedCode { |