From 432cee9b36a87f63e787fe4465ec385aa750e172 Mon Sep 17 00:00:00 2001 From: Kiran Kamineni Date: Tue, 19 Nov 2019 11:51:46 -0800 Subject: Add v2 with project API Definiton, Profile and other APIs will migrate to this area with support for Projects and v2. This patch adds the Project API only along with support for the Mongo database. Migration of other APIs will happen in future patches Issue-ID: MULTICLOUD-871 Change-Id: I2eb2d0db2384fd58d1ec874e24fa9125a1f5b288 Signed-off-by: Kiran Kamineni --- src/orchestrator/api/testing.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/orchestrator/api/testing.go (limited to 'src/orchestrator/api/testing.go') diff --git a/src/orchestrator/api/testing.go b/src/orchestrator/api/testing.go new file mode 100644 index 00000000..e99ec75b --- /dev/null +++ b/src/orchestrator/api/testing.go @@ -0,0 +1,31 @@ +/* + * Copyright 2018 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package api + +import ( + "net/http" + "net/http/httptest" + + "github.com/gorilla/mux" +) + +func executeRequest(request *http.Request, router *mux.Router) *http.Response { + recorder := httptest.NewRecorder() + router.ServeHTTP(recorder, request) + resp := recorder.Result() + return resp +} -- cgit 1.2.3-korg