Exemplo n.º 1
0
	"code.cloudfoundry.org/lager/lagertest"

	"github.com/nats-io/nats"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/tedsuo/ifrit"
)

var _ = Describe("Subscriber", func() {
	var (
		sub     *mbus.Subscriber
		subOpts *mbus.SubscriberOpts
		process ifrit.Process

		registry *fakes.FakeRegistryInterface

		natsRunner   *test_util.NATSRunner
		natsPort     uint16
		natsClient   *nats.Conn
		startMsgChan chan struct{}

		logger lager.Logger
	)

	BeforeEach(func() {
		natsPort = test_util.NextAvailPort()

		natsRunner = test_util.NewNATSRunner(int(natsPort))
		natsRunner.Start()
		natsClient = natsRunner.MessageBus

		registry = new(fakes.FakeRegistryInterface)
Exemplo n.º 2
0
func init() {
	sender = metrics_fakes.NewFakeMetricSender()
	metrics.Initialize(sender, nil)
}

var _ = Describe("RouteFetcher", func() {
	var (
		cfg         *config.Config
		uaaClient   *testUaaClient.FakeClient
		registry    *testRegistry.FakeRegistryInterface
		fetcher     *RouteFetcher
		logger      lager.Logger
		client      *fake_routing_api.FakeClient
		eventSource *fake_routing_api.FakeEventSource

		token *schema.Token

		response     []models.Route
		process      ifrit.Process
		eventChannel chan routing_api.Event
		errorChannel chan error

		clock *fakeclock.FakeClock
	)

	BeforeEach(func() {
		logger = lagertest.NewTestLogger("test")
		cfg = config.DefaultConfig()
		cfg.PruneStaleDropletsInterval = 2 * time.Millisecond

		retryInterval := 0