コード例 #1
0
ファイル: mother.go プロジェクト: dieucao/notifications
func (m *Mother) EveryoneStrategy() services.EveryoneStrategy {
	env := NewEnvironment()
	uaaClient := uaa.NewZonedUAAClient(env.UAAClientID, env.UAAClientSecret, env.VerifySSL, UAAPublicKey)
	tokenLoader := uaa.NewTokenLoader(uaaClient)
	allUsers := services.NewAllUsers(uaaClient)
	enqueuer := m.Enqueuer()

	return services.NewEveryoneStrategy(tokenLoader, allUsers, enqueuer, m.V2Enqueuer())
}
コード例 #2
0
	"github.com/cloudfoundry-incubator/notifications/testing/mocks"
	"github.com/cloudfoundry-incubator/notifications/uaa"
	"github.com/cloudfoundry-incubator/notifications/v1/services"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("AllUserGUIDs", func() {
	var allUsers services.AllUsers
	var uaaClient *mocks.ZonedUAAClient
	var users []uaa.User

	BeforeEach(func() {
		uaaClient = mocks.NewZonedUAAClient()
		allUsers = services.NewAllUsers(uaaClient)
	})

	Context("when the request succeeds", func() {
		BeforeEach(func() {
			users = []uaa.User{
				{
					Emails: []string{"*****@*****.**"},
					ID:     "user-123",
				},
				{
					Emails: []string{"*****@*****.**"},
					ID:     "user-456",
				},
				{
					Emails: []string{"*****@*****.**"},