Skip to content
This repository was archived by the owner on Apr 30, 2025. It is now read-only.

Commit efa7e82

Browse files
committed
Fix tests
1 parent 2b89f38 commit efa7e82

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

proxy/round_tripper/proxy_round_tripper_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ var _ = Describe("ProxyRoundTripper", func() {
655655
Context("when there are no more endpoints available", func() {
656656
JustBeforeEach(func() {
657657
removed := routePool.Remove(endpoint)
658-
Expect(removed).To(BeTrue())
658+
Expect(removed).To(Equal(route.EndpointUnregistered))
659659
})
660660

661661
It("returns a 502 Bad Gateway response", func() {
@@ -1147,7 +1147,7 @@ var _ = Describe("ProxyRoundTripper", func() {
11471147
added = routePool.Put(endpoint2)
11481148
Expect(added).To(Equal(route.Added))
11491149
removed := routePool.Remove(endpoint)
1150-
Expect(removed).To(BeTrue())
1150+
Expect(removed).To(Equal(route.EndpointUnregistered))
11511151
})
11521152

11531153
Context("when there are no cookies on the request", func() {
@@ -1439,10 +1439,10 @@ var _ = Describe("ProxyRoundTripper", func() {
14391439

14401440
JustBeforeEach(func() {
14411441
removed := routePool.Remove(endpoint1)
1442-
Expect(removed).To(BeTrue())
1442+
Expect(removed).To(Equal(route.EndpointUnregistered))
14431443

14441444
removed = routePool.Remove(endpoint2)
1445-
Expect(removed).To(BeTrue())
1445+
Expect(removed).To(Equal(route.EndpointUnregistered))
14461446

14471447
new_endpoint := route.NewEndpoint(&route.EndpointOpts{PrivateInstanceId: "id-5"})
14481448
added := routePool.Put(new_endpoint)
@@ -1502,10 +1502,10 @@ var _ = Describe("ProxyRoundTripper", func() {
15021502

15031503
JustBeforeEach(func() {
15041504
removed := routePool.Remove(endpoint1)
1505-
Expect(removed).To(BeTrue())
1505+
Expect(removed).To(Equal(route.EndpointUnregistered))
15061506

15071507
removed = routePool.Remove(endpoint2)
1508-
Expect(removed).To(BeTrue())
1508+
Expect(removed).To(Equal(route.EndpointUnregistered))
15091509

15101510
new_endpoint := route.NewEndpoint(&route.EndpointOpts{PrivateInstanceId: "id-5"})
15111511
added := routePool.Put(new_endpoint)
@@ -1568,10 +1568,10 @@ var _ = Describe("ProxyRoundTripper", func() {
15681568

15691569
JustBeforeEach(func() {
15701570
removed := routePool.Remove(endpoint1)
1571-
Expect(removed).To(BeTrue())
1571+
Expect(removed).To(Equal(route.EndpointUnregistered))
15721572

15731573
removed = routePool.Remove(endpoint2)
1574-
Expect(removed).To(BeTrue())
1574+
Expect(removed).To(Equal(route.EndpointUnregistered))
15751575

15761576
new_endpoint := route.NewEndpoint(&route.EndpointOpts{PrivateInstanceId: "id-5"})
15771577
added := routePool.Put(new_endpoint)

registry/registry_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ var _ = Describe("RouteRegistry", func() {
7676
Expect(reporter.CaptureRegistryMessageCallCount()).To(Equal(1))
7777
endpoint1, action1 := reporter.CaptureRegistryMessageArgsForCall(0)
7878
Expect(endpoint1).To(Equal(fooEndpoint))
79-
Expect(action1).To(Equal("endpoint-registered"))
79+
Expect(action1).To(Equal("endpoint-added"))
8080
})
8181
})
8282

@@ -91,7 +91,7 @@ var _ = Describe("RouteRegistry", func() {
9191
Expect(reporter.CaptureRegistryMessageCallCount()).To(Equal(2))
9292
endpointR1, action1 := reporter.CaptureRegistryMessageArgsForCall(0)
9393
Expect(endpointR1).To(Equal(endpoint1))
94-
Expect(action1).To(Equal("endpoint-registered"))
94+
Expect(action1).To(Equal("endpoint-added"))
9595
endpointR2, action2 := reporter.CaptureRegistryMessageArgsForCall(1)
9696
Expect(endpointR2).To(Equal(endpoint2))
9797
Expect(action2).To(Equal("endpoint-updated"))
@@ -109,7 +109,7 @@ var _ = Describe("RouteRegistry", func() {
109109
Expect(reporter.CaptureRegistryMessageCallCount()).To(Equal(2))
110110
endpointR1, action1 := reporter.CaptureRegistryMessageArgsForCall(0)
111111
Expect(endpointR1).To(Equal(endpoint1))
112-
Expect(action1).To(Equal("endpoint-registered"))
112+
Expect(action1).To(Equal("endpoint-added"))
113113
endpointR2, action2 := reporter.CaptureRegistryMessageArgsForCall(1)
114114
Expect(endpointR2).To(Equal(endpoint2))
115115
Expect(action2).To(Equal("endpoint-not-updated"))
@@ -278,7 +278,7 @@ var _ = Describe("RouteRegistry", func() {
278278
r.Register("a.route", fooEndpoint)
279279

280280
Eventually(logger).Should(gbytes.Say(`"log_level":1.*route-registered.*a\.route`))
281-
Eventually(logger).Should(gbytes.Say(`"log_level":1.*endpoint-registered.*a\.route.*192\.168\.1\.1`))
281+
Eventually(logger).Should(gbytes.Say(`"log_level":1.*endpoint-added.*a\.route.*192\.168\.1\.1`))
282282
})
283283

284284
It("logs 'uri-added' at debug level for backward compatibility", func() {

0 commit comments

Comments
 (0)