Esempio n. 1
0
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/onsi/gomega/ghttp"
)

var _ = Describe("Credential", func() {
	var (
		fakeCliConnection *fakes.FakeCliConnection
		fakeInfoFactory   *info_fakes.FakeInfoFactory
		credFactory       credential.CredentialFactory
	)

	BeforeEach(func() {
		fakeCliConnection = &fakes.FakeCliConnection{}
		fakeCliConnection.IsSSLDisabledReturns(true, nil)
		fakeInfoFactory = &info_fakes.FakeInfoFactory{}
	})

	JustBeforeEach(func() {
		credFactory = credential.NewCredentialFactory(fakeCliConnection, fakeInfoFactory)
	})

	Describe("AuthorizationCode", func() {
		var v2Info info.Info
		var fakeUAA *ghttp.Server

		BeforeEach(func() {
			fakeCliConnection.AccessTokenReturns("bearer client-bearer-token", nil)

			fakeUAA = ghttp.NewTLSServer()