"github.com/onsi/gomega/ghttp"
	"github.com/pivotal-golang/lager/lagertest"
	"golang.org/x/crypto/ssh"
)

var _ = Describe("CFAuthenticator", func() {
	var (
		authenticator      *authenticators.CFAuthenticator
		logger             *lagertest.TestLogger
		httpClient         *http.Client
		httpClientTimeout  time.Duration
		permissionsBuilder *fake_authenticators.FakePermissionsBuilder

		permissions *ssh.Permissions
		authenErr   error

		metadata *fake_ssh.FakeConnMetadata
		password []byte

		fakeCC      *ghttp.Server
		fakeUAA     *ghttp.Server
		ccURL       string
		uaaTokenURL string
		uaaUsername string
		uaaPassword string
	)

	BeforeEach(func() {
		logger = lagertest.NewTestLogger("test")

		httpClientTimeout = time.Second
		httpClient = &http.Client{Timeout: httpClientTimeout}
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/onsi/gomega/ghttp"
	"github.com/pivotal-golang/lager/lagertest"
	"golang.org/x/crypto/ssh"
)

var _ = Describe("CFAuthenticator", func() {
	var (
		authenticator   *authenticators.CFAuthenticator
		logger          *lagertest.TestLogger
		ccClient        *http.Client
		ccClientTimeout time.Duration
		receptorClient  *fake_receptor.FakeClient

		permissions *ssh.Permissions
		err         error

		metadata *fake_ssh.FakeConnMetadata
		password []byte

		fakeCC *ghttp.Server
		ccURL  string
	)

	BeforeEach(func() {
		logger = lagertest.NewTestLogger("test")
		ccClientTimeout = time.Second
		ccClient = &http.Client{Timeout: ccClientTimeout}
		receptorClient = new(fake_receptor.FakeClient)

		metadata = &fake_ssh.FakeConnMetadata{}