diff --git a/api/internal/handler/data_loader/route_import_test.go b/api/internal/handler/data_loader/route_import_test.go index 35bc61a771..50f76f7cc9 100644 --- a/api/internal/handler/data_loader/route_import_test.go +++ b/api/internal/handler/data_loader/route_import_test.go @@ -67,7 +67,7 @@ func TestImport_invalid_file_type(t *testing.T) { input.FileName = "file1.txt" input.FileContent = []byte("hello") - h := Handler{} + h := ImportHandler{} ctx := droplet.NewContext() ctx.SetInput(input) @@ -80,7 +80,7 @@ func TestImport_invalid_content(t *testing.T) { input.FileName = "file1.json" input.FileContent = []byte(`{"test": "a"}`) - h := Handler{} + h := ImportHandler{} ctx := droplet.NewContext() ctx.SetInput(input) @@ -110,7 +110,7 @@ func TestImport_with_service_id(t *testing.T) { mStore.On("Get", mock.Anything).Run(func(args mock.Arguments) { }).Return(nil, errors.New("data not found by key: service1")) - h := Handler{ + h := ImportHandler{ routeStore: &store.GenericStore{}, svcStore: mStore, upstreamStore: mStore, @@ -126,7 +126,7 @@ func TestImport_with_service_id(t *testing.T) { mStore.On("Get", mock.Anything).Run(func(args mock.Arguments) { }).Return(nil, data.ErrNotFound) - h = Handler{ + h = ImportHandler{ routeStore: &store.GenericStore{}, svcStore: mStore, upstreamStore: mStore, @@ -148,7 +148,7 @@ func TestImport_with_upstream_id(t *testing.T) { mStore.On("Get", mock.Anything).Run(func(args mock.Arguments) { }).Return(nil, errors.New("data not found by key: upstream1")) - h := Handler{ + h := ImportHandler{ routeStore: &store.GenericStore{}, svcStore: mStore, upstreamStore: mStore, @@ -164,7 +164,7 @@ func TestImport_with_upstream_id(t *testing.T) { mStore.On("Get", mock.Anything).Run(func(args mock.Arguments) { }).Return(nil, data.ErrNotFound) - h = Handler{ + h = ImportHandler{ routeStore: &store.GenericStore{}, svcStore: mStore, upstreamStore: mStore, diff --git a/api/test/e2e/route_import_test.go b/api/test/e2e/route_import_test.go index 2fb59e8233..88b8ddbb3c 100644 --- a/api/test/e2e/route_import_test.go +++ b/api/test/e2e/route_import_test.go @@ -300,9 +300,15 @@ func TestImport_with_multi_routes(t *testing.T) { Sleep: sleepTime, } tests = append(tests, tc) - + uris := route["uris"].([]string) + isGet := false + for _, uri := range uris { + if uri == "/get" { + isGet = true + } + } // verify route data - if route["uri"].(string) == "/get" { + if isGet { tcDataVerify := HttpTestCase{ Desc: "verify data of route", Object: ManagerApiExpect(t),