X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=capifcore%2Finternal%2Fprovidermanagement%2Fprovidermanagement_test.go;h=cbcf43899021976071ee9a887d46d5574087417e;hb=HEAD;hp=7d527292d9d1b3a9075f64ae2e563aecd3941ced;hpb=c4121cc21b3b088df1ee22a9bf7645e5dddb1f6a;p=nonrtric%2Fplt%2Fsme.git diff --git a/capifcore/internal/providermanagement/providermanagement_test.go b/capifcore/internal/providermanagement/providermanagement_test.go index 7d52729..cbcf438 100644 --- a/capifcore/internal/providermanagement/providermanagement_test.go +++ b/capifcore/internal/providermanagement/providermanagement_test.go @@ -62,7 +62,7 @@ func TestFailedUpdateValidProviderWithNewFunction(t *testing.T) { // Modify the provider updatedProvider := getProvider() - // We omit to set updatedProvider.ApiProvDomId + // For this test case, we do not set updatedProvider.ApiProvDomId, so that we can test for a 400 error below. (*updatedProvider.ApiProvFuncs)[0].ApiProvFuncId = &funcIdAPF (*updatedProvider.ApiProvFuncs)[1].ApiProvFuncId = &funcIdAMF (*updatedProvider.ApiProvFuncs)[2].ApiProvFuncId = &funcIdAEF @@ -82,13 +82,13 @@ func TestFailedUpdateValidProviderWithNewFunction(t *testing.T) { updatedProvider.ApiProvFuncs = &testFuncs result := testutil.NewRequest().Put("/registrations/"+domainID).WithJsonBody(updatedProvider).Go(t, requestHandler) - assert.Equal(t, http.StatusNotFound, result.Code()) + assert.Equal(t, http.StatusBadRequest, result.Code()) var resultError common29122.ProblemDetails err := result.UnmarshalJsonToObject(&resultError) assert.NoError(t, err, "error unmarshaling response") - assert.Contains(t, *resultError.Cause, "APIProviderEnrolmentDetails missing required ApiProvDomId") + assert.Contains(t, *resultError.Cause, "APIProviderEnrolmentDetails ApiProvDomId doesn't match path parameter") assert.False(t, managerUnderTest.IsFunctionRegistered("AEF_id_new_func_as_AEF")) }