diff options
author | Konrad Bańka <k.banka@samsung.com> | 2020-01-07 16:01:07 +0100 |
---|---|---|
committer | Konrad Bańka <k.banka@samsung.com> | 2020-01-07 16:01:07 +0100 |
commit | 731f6cc1a411276ef348804184416acf11f9477b (patch) | |
tree | abbe302d0009ae40a9d577990de44e2a21028a6c /src/k8splugin/api/profilehandler_test.go | |
parent | 2a35410560f1c22ed12cd137cbf843e36f74740e (diff) |
Change missing profile HTTP response code to 404
Issue-ID: MULTICLOUD-967
Signed-off-by: Konrad Bańka <k.banka@samsung.com>
Change-Id: I3d213f65ee37443a55b74255b475e27c0d93cf2c
Diffstat (limited to 'src/k8splugin/api/profilehandler_test.go')
-rw-r--r-- | src/k8splugin/api/profilehandler_test.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/k8splugin/api/profilehandler_test.go b/src/k8splugin/api/profilehandler_test.go index 4dae377c..9ec9c54c 100644 --- a/src/k8splugin/api/profilehandler_test.go +++ b/src/k8splugin/api/profilehandler_test.go @@ -184,10 +184,19 @@ func TestRBProfileGetHandler(t *testing.T) { }, }, { - label: "Get Non-Exiting Bundle Profile", - expectedCode: http.StatusInternalServerError, + label: "Get Non-Existing Profile", + expectedCode: http.StatusNotFound, prname: "non-existing-profile", rbProClient: &mockRBProfile{ + Items: nil, + Err: pkgerrors.New("Error finding master table"), + }, + }, + { + label: "Faulty DB response", + expectedCode: http.StatusInternalServerError, + prname: "profile", + rbProClient: &mockRBProfile{ // list of Profiles that will be returned by the mockclient Items: []rb.Profile{}, Err: pkgerrors.New("Internal Error"), |