-
Notifications
You must be signed in to change notification settings - Fork 5
/
testutils.go
82 lines (62 loc) · 2.89 KB
/
testutils.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package sandra
import (
"context"
"fmt"
"github.com/gocql/gocql"
)
type TestErrorCassandra struct{}
func (c *TestErrorCassandra) QueryCtx(_ context.Context, consistency gocql.Consistency, queryString string, queryParams ...interface{}) *gocql.Query {
return nil
}
func (c *TestErrorCassandra) Query(consistency gocql.Consistency, queryString string, queryParams ...interface{}) *gocql.Query {
return nil
}
func (c *TestErrorCassandra) Config() CassandraConfig {
return CassandraConfig{}
}
func (c *TestErrorCassandra) Session() *gocql.Session {
return nil
}
func (c *TestErrorCassandra) ExecuteQueryCtx(_ context.Context, queryString string, queryParams ...interface{}) error {
return fmt.Errorf("error during ExecuteQueryCtx")
}
func (c *TestErrorCassandra) ExecuteQuery(queryString string, queryParams ...interface{}) error {
return fmt.Errorf("Error during ExecuteQuery")
}
func (c *TestErrorCassandra) ExecuteBatchCtx(_ context.Context, batchType gocql.BatchType, queries []string, params [][]interface{}) error {
return fmt.Errorf("Error during ExecuteBatchCtx")
}
func (c *TestErrorCassandra) ExecuteBatch(batchType gocql.BatchType, queries []string, params [][]interface{}) error {
return fmt.Errorf("Error during ExecuteBatch")
}
func (c *TestErrorCassandra) ExecuteUnloggedBatchCtx(_ context.Context, queries []string, params [][]interface{}) error {
return fmt.Errorf("Error during ExecuteUnloggedBatchCtx")
}
func (c *TestErrorCassandra) ExecuteUnloggedBatch(queries []string, params [][]interface{}) error {
return fmt.Errorf("Error during ExecuteUnloggedBatch")
}
func (c *TestErrorCassandra) ScanQueryCtx(_ context.Context, queryString string, queryParams []interface{}, outParams ...interface{}) error {
return fmt.Errorf("Error during ScanQueryCtx")
}
func (c *TestErrorCassandra) ScanQuery(queryString string, queryParams []interface{}, outParams ...interface{}) error {
return fmt.Errorf("Error during ScanQuery")
}
func (c *TestErrorCassandra) ScanCASQueryCtx(_ context.Context, queryString string, queryParams []interface{}, outParams ...interface{}) (bool, error) {
return false, fmt.Errorf("Error during ScanCASQueryCtx")
}
func (c *TestErrorCassandra) ScanCASQuery(queryString string, queryParams []interface{}, outParams ...interface{}) (bool, error) {
return false, fmt.Errorf("Error during ScanCASQuery")
}
func (c *TestErrorCassandra) IterQueryCtx(_ context.Context, queryString string, queryParams []interface{}, outParams ...interface{}) func() (int, bool, error) {
return func() (int, bool, error) {
return 0, true, fmt.Errorf("Error during IterQueryCtx")
}
}
func (c *TestErrorCassandra) IterQuery(queryString string, queryParams []interface{}, outParams ...interface{}) func() (int, bool, error) {
return func() (int, bool, error) {
return 0, true, fmt.Errorf("Error during IterQuery")
}
}
func (c *TestErrorCassandra) Close() error {
return fmt.Errorf("Error during Close")
}