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

Commit 8c017fb

Browse files
committed
Fix tests
1 parent 2b89f38 commit 8c017fb

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

metrics/metricsreporter_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ var _ = Describe("MetricsReporter", func() {
462462
metricReporter.CaptureRegistryMessage(endpoint, "some-action")
463463

464464
Expect(batcher.BatchIncrementCounterCallCount()).To(Equal(2))
465-
Expect(batcher.BatchIncrementCounterArgsForCall(0)).To(Equal("registry_message.uaa.some-action"))
466-
Expect(batcher.BatchIncrementCounterArgsForCall(1)).To(Equal("registry_message.route-emitter.some-action"))
465+
Expect(batcher.BatchIncrementCounterArgsForCall(0)).To(Equal("registry_message.some-action.uaa"))
466+
Expect(batcher.BatchIncrementCounterArgsForCall(1)).To(Equal("registry_message.some-action.route-emitter"))
467467
})
468468

469469
It("sends the total routes", func() {
@@ -522,7 +522,7 @@ var _ = Describe("MetricsReporter", func() {
522522

523523
It("increments the counter metric", func() {
524524
Expect(sender.IncrementCounterCallCount()).To(Equal(1))
525-
Expect(sender.IncrementCounterArgsForCall(0)).To(Equal("unregistry_message.oauth-server.some-action"))
525+
Expect(sender.IncrementCounterArgsForCall(0)).To(Equal("unregistry_message.some-action.oauth-server"))
526526
})
527527

528528
It("increments the counter metric for each component unregistered", func() {
@@ -531,8 +531,8 @@ var _ = Describe("MetricsReporter", func() {
531531
metricReporter.CaptureUnregistryMessage(endpointTwo, "some-action")
532532

533533
Expect(sender.IncrementCounterCallCount()).To(Equal(2))
534-
Expect(sender.IncrementCounterArgsForCall(0)).To(Equal("unregistry_message.oauth-server.some-action"))
535-
Expect(sender.IncrementCounterArgsForCall(1)).To(Equal("unregistry_message.api-server.some-action"))
534+
Expect(sender.IncrementCounterArgsForCall(0)).To(Equal("unregistry_message.some-action.oauth-server"))
535+
Expect(sender.IncrementCounterArgsForCall(1)).To(Equal("unregistry_message.some-action.api-server"))
536536
})
537537
})
538538
Context("when unregister msg with empty component name is incremented", func() {

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)