+ result = testutil.NewRequest().Get("/"+apfId+"/service-apis/"+newApiId).Go(t, requestHandler)
+
+ assert.Equal(t, http.StatusNotFound, result.Code())
+}
+
+func TestPostUnpublishedServiceWithUnregisteredFunction(t *testing.T) {
+ apfId := "apfId"
+ aefId := "aefId"
+ serviceRegisterMock := serviceMocks.ServiceRegister{}
+ serviceRegisterMock.On("GetAefsForPublisher", apfId).Return([]string{"otherAefId"})
+ _, requestHandler := getEcho(&serviceRegisterMock, nil)
+
+ domainName := "domain"
+ var protocol publishapi.Protocol = "HTTP_1_1"
+ description := "Description"
+ newServiceDescription := getServiceAPIDescription(aefId, domainName, description, protocol)
+
+ // Publish a service
+ result := testutil.NewRequest().Post("/"+apfId+"/service-apis").WithJsonBody(newServiceDescription).Go(t, requestHandler)