+}
+
+func TestPublishInvalidService(t *testing.T) {
+ _, _, requestHandler := getEcho(nil, nil)
+ newServiceDescription := getServiceAPIDescription("aefId", " ", "description")
+
+ // Publish a service
+ result := testutil.NewRequest().Post("/apfId/service-apis").WithJsonBody(newServiceDescription).Go(t, requestHandler)
+
+ assert.Equal(t, http.StatusBadRequest, result.Code())
+ var resultError common29122.ProblemDetails
+ err := result.UnmarshalBodyToObject(&resultError)
+ assert.NoError(t, err, "error unmarshaling response")
+ assert.Contains(t, *resultError.Cause, "missing")
+ assert.Contains(t, *resultError.Cause, "apiName")
+ assert.Equal(t, http.StatusBadRequest, *resultError.Status)
+