Using upstreams instead of upstream_url for loader
@@ -27,7 +27,12 @@ func TestLoadValidAPIDefinitions(t *testing.T) {
Active: true,
Proxy: &proxy.Definition{
ListenPath: "/test1",
- UpstreamURL: "http://test1",
+ Upstreams: &proxy.Upstreams{
+ Balancing: "roundrobin",
+ Targets: []*proxy.Target{
+ &proxy.Target{Target: "http://test1"},
+ },
+ },
Methods: []string{http.MethodGet},
},
Plugins: []api.Plugin{
@@ -51,7 +56,12 @@ func TestLoadValidAPIDefinitions(t *testing.T) {
Active: true,
Proxy: &proxy.Definition{
ListenPath: "/test2",
- UpstreamURL: "http://test2",
+ Upstreams: &proxy.Upstreams{
+ Balancing: "roundrobin",
+ Targets: []*proxy.Target{
+ &proxy.Target{Target: "http://test2"},
+ },
+ },
Methods: []string{http.MethodGet},
},
})
@@ -70,7 +80,12 @@ func TestLoadInvalidAPIDefinitions(t *testing.T) {
Active: true,
Proxy: &proxy.Definition{
ListenPath: "/test2",
- UpstreamURL: "http://test2",
+ Upstreams: &proxy.Upstreams{
+ Balancing: "roundrobin",
+ Targets: []*proxy.Target{
+ &proxy.Target{Target: "http://test2"},
+ },
+ },
Methods: []string{http.MethodGet},
},
}
@@ -92,7 +107,12 @@ func TestLoadAPIDefinitionsMissingHTTPMethods(t *testing.T) {
Active: true,
Proxy: &proxy.Definition{
ListenPath: "/test1",
- UpstreamURL: "http://test1",
+ Upstreams: &proxy.Upstreams{
+ Balancing: "roundrobin",
+ Targets: []*proxy.Target{
+ &proxy.Target{Target: "http://test1"},
+ },
+ },
},
})
@@ -110,7 +130,12 @@ func TestLoadInactiveAPIDefinitions(t *testing.T) {
Active: false,
Proxy: &proxy.Definition{
ListenPath: "/test1",
- UpstreamURL: "http://test1",
+ Upstreams: &proxy.Upstreams{
+ Balancing: "roundrobin",
+ Targets: []*proxy.Target{
+ &proxy.Target{Target: "http://test1"},
+ },
+ },
},
})
