- errMsg = "The invoker to update has not been onboarded"
- assert.Equal(t, &errMsg, problemDetails.Cause)
+ assert.Contains(t, *problemDetails.Cause, "not been onboarded")
+ assert.Contains(t, *problemDetails.Cause, "invoker")
+}
+
+func TestGetInvokerApiList(t *testing.T) {
+ aefProfiles1 := []publishserviceapi.AefProfile{
+ getAefProfile("aefId"),
+ }
+ apiId := "apiId"
+ apiList := []publishserviceapi.ServiceAPIDescription{
+ {
+ ApiId: &apiId,
+ AefProfiles: &aefProfiles1,
+ },
+ }
+ aefProfiles2 := []publishserviceapi.AefProfile{
+ getAefProfile("aefId2"),
+ }
+ apiId2 := "apiId2"
+ apiList = append(apiList, publishserviceapi.ServiceAPIDescription{
+ ApiId: &apiId2,
+ AefProfiles: &aefProfiles2,
+ })
+ publishRegisterMock := publishmocks.PublishRegister{}
+ publishRegisterMock.On("GetAllPublishedServices").Return(apiList)
+ invokerUnderTest, requestHandler := getEcho(&publishRegisterMock)