forked from cloudfoundry/rep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rep_suite_test.go
42 lines (35 loc) · 1.04 KB
/
rep_suite_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package rep_test
import (
"testing"
"time"
cfhttp "code.cloudfoundry.org/cfhttp/v2"
executorfakes "code.cloudfoundry.org/executor/fakes"
"code.cloudfoundry.org/rep"
"code.cloudfoundry.org/rep/evacuation/evacuation_context/fake_evacuation_context"
"code.cloudfoundry.org/rep/repfakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var (
cfHttpTimeout time.Duration
auctionRep *repfakes.FakeClient
factory rep.ClientFactory
fakeExecutorClient *executorfakes.FakeClient
fakeEvacuatable *fake_evacuation_context.FakeEvacuatable
)
func TestRep(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Rep Suite")
}
var _ = BeforeEach(func() {
auctionRep = &repfakes.FakeClient{}
fakeExecutorClient = &executorfakes.FakeClient{}
fakeEvacuatable = &fake_evacuation_context.FakeEvacuatable{}
cfHttpTimeout = 1 * time.Second
var err error
httpClient := cfhttp.NewClient(
cfhttp.WithRequestTimeout(cfHttpTimeout),
)
factory, err = rep.NewClientFactory(httpClient, httpClient, nil)
Expect(err).NotTo(HaveOccurred())
})