-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestHelpers_test.go
44 lines (38 loc) · 954 Bytes
/
testHelpers_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
43
44
package eventuate_test
import (
"net/http"
"testing"
//"github.com/eventuate-clients/eventuate-client-golang"
"github.com/stretchr/testify/assert"
)
//type RewriteTransport struct {
// Transport http.RoundTripper
//}
//
//func (t *RewriteTransport) RoundTrip(req *http.Request) (*http.Response, Error) {
// req.URL.Scheme = "http"
// if t.Transport == nil {
// return http.DefaultTransport.RoundTrip(req)
// }
// return t.Transport.RoundTrip(req)
//}
func assertMethod(t *testing.T, expectedMethod string, req *http.Request) {
assert.Equal(t, expectedMethod, req.Method)
}
func assertNoError(t *testing.T, err error) {
assert.Equal(t, nil, err)
}
//
//func readNEventsSequentially(sub *eventuate.Subscription, count int) []*eventuate.StompEvent {
//
// result := make([]*eventuate.StompEvent, count)
// for idx := range result {
// evt, err := sub.ReadEvent()
// if err != nil {
//
// }
// result[idx] = evt
// }
//
// return result
//}