+}
+
+func TestGetInvokerApiList(t *testing.T) {
+ apiRegisterMock := publishmocks.APIRegister{}
+ apiRegisterMock.On("AreAPIsRegistered", mock.Anything).Return(true)
+ invokerUnderTest, requestHandler := getEcho(&apiRegisterMock)
+
+ // Onboard two invokers
+ aefProfiles := []publishserviceapi.AefProfile{
+ getAefProfile("aefId"),
+ }
+ apiId := "apiId"
+ var apiList invokermanagementapi.APIList = []publishserviceapi.ServiceAPIDescription{
+ {
+ ApiId: &apiId,
+ AefProfiles: &aefProfiles,
+ },
+ }
+ newInvoker := getInvoker("invoker a", apiList)
+ testutil.NewRequest().Post("/onboardedInvokers").WithJsonBody(newInvoker).Go(t, requestHandler)
+ aefProfiles = []publishserviceapi.AefProfile{
+ getAefProfile("aefId2"),
+ }
+ apiId2 := "apiId2"
+ apiList = []publishserviceapi.ServiceAPIDescription{
+ {
+ ApiId: &apiId2,
+ AefProfiles: &aefProfiles,
+ },
+ }
+ newInvoker = getInvoker("invoker b", apiList)
+ testutil.NewRequest().Post("/onboardedInvokers").WithJsonBody(newInvoker).Go(t, requestHandler)