Esempio n. 1
0
						It("doesn't update endpoint with older mod tag", func() {
							Expect(r.NumUris()).To(Equal(1))
							Expect(r.NumEndpoints()).To(Equal(1))

							p := r.Lookup("foo.com")
							ep := p.Endpoints("", "").Next()
							Expect(ep.ModificationTag).To(Equal(modTag))
							Expect(ep).To(Equal(endpoint2))
						})
					})
				})

				Context("when modification tag guid changes", func() {
					BeforeEach(func() {
						modTag.Guid = "def"
						endpoint2 = route.NewEndpoint("", "1.1.1.1", 1234, "", "", nil, -1, "", modTag)
						r.Register("foo.com", endpoint2)
					})

					It("adds a new entry to the routing table", func() {
						Expect(r.NumUris()).To(Equal(1))
						Expect(r.NumEndpoints()).To(Equal(1))

						p := r.Lookup("foo.com")
						Expect(p.Endpoints("", "").Next().ModificationTag).To(Equal(modTag))
					})
				})
			})

		})