@@ -59,18 +59,18 @@ func TestAggregateOpt(t *testing.T) {
59
59
bundle1 = bundle1 .BypassDocumentValidation (true ).Comment ("hello world" ).BypassDocumentValidation (false )
60
60
testhelpers .RequireNotNil (t , bundle1 , "created bundle was nil" )
61
61
bundle1Opts := []option.Optioner {
62
- BypassDocumentValidation (true ).ConvertOption (),
63
- Comment ("hello world" ).ConvertOption (),
64
- BypassDocumentValidation (false ).ConvertOption (),
62
+ BypassDocumentValidation (true ).ConvertAggregateOption (),
63
+ Comment ("hello world" ).ConvertAggregateOption (),
64
+ BypassDocumentValidation (false ).ConvertAggregateOption (),
65
65
}
66
66
bundle1DedupOpts := []option.Optioner {
67
- Comment ("hello world" ).ConvertOption (),
68
- BypassDocumentValidation (false ).ConvertOption (),
67
+ Comment ("hello world" ).ConvertAggregateOption (),
68
+ BypassDocumentValidation (false ).ConvertAggregateOption (),
69
69
}
70
70
71
71
bundle2 := BundleAggregate (BatchSize (1 ))
72
72
bundle2Opts := []option.Optioner {
73
- OptBatchSize (1 ).ConvertOption (),
73
+ OptBatchSize (1 ).ConvertAggregateOption (),
74
74
}
75
75
76
76
bundle3 := BundleAggregate ().
@@ -82,73 +82,73 @@ func TestAggregateOpt(t *testing.T) {
82
82
Comment ("World" )
83
83
84
84
bundle3Opts := []option.Optioner {
85
- OptBatchSize (1 ).ConvertOption (),
86
- OptComment ("Hello" ).ConvertOption (),
87
- OptBatchSize (2 ).ConvertOption (),
88
- OptBypassDocumentValidation (false ).ConvertOption (),
89
- OptBypassDocumentValidation (true ).ConvertOption (),
90
- OptComment ("World" ).ConvertOption (),
85
+ OptBatchSize (1 ).ConvertAggregateOption (),
86
+ OptComment ("Hello" ).ConvertAggregateOption (),
87
+ OptBatchSize (2 ).ConvertAggregateOption (),
88
+ OptBypassDocumentValidation (false ).ConvertAggregateOption (),
89
+ OptBypassDocumentValidation (true ).ConvertAggregateOption (),
90
+ OptComment ("World" ).ConvertAggregateOption (),
91
91
}
92
92
93
93
bundle3DedupOpts := []option.Optioner {
94
- OptBatchSize (2 ).ConvertOption (),
95
- OptBypassDocumentValidation (true ).ConvertOption (),
96
- OptComment ("World" ).ConvertOption (),
94
+ OptBatchSize (2 ).ConvertAggregateOption (),
95
+ OptBypassDocumentValidation (true ).ConvertAggregateOption (),
96
+ OptComment ("World" ).ConvertAggregateOption (),
97
97
}
98
98
99
99
nilBundle := BundleAggregate ()
100
100
var nilBundleOpts []option.Optioner
101
101
102
102
nestedBundle1 := createNestedBundle1 (t )
103
103
nestedBundleOpts1 := []option.Optioner {
104
- OptAllowDiskUse (true ).ConvertOption (),
105
- OptMaxTime (500 ).ConvertOption (),
106
- OptAllowDiskUse (false ).ConvertOption (),
107
- OptComment ("hello world nested" ).ConvertOption (),
108
- OptBatchSize (1000 ).ConvertOption (),
104
+ OptAllowDiskUse (true ).ConvertAggregateOption (),
105
+ OptMaxTime (500 ).ConvertAggregateOption (),
106
+ OptAllowDiskUse (false ).ConvertAggregateOption (),
107
+ OptComment ("hello world nested" ).ConvertAggregateOption (),
108
+ OptBatchSize (1000 ).ConvertAggregateOption (),
109
109
}
110
110
nestedBundleDedupOpts1 := []option.Optioner {
111
- OptMaxTime (500 ).ConvertOption (),
112
- OptAllowDiskUse (false ).ConvertOption (),
113
- OptComment ("hello world nested" ).ConvertOption (),
114
- OptBatchSize (1000 ).ConvertOption (),
111
+ OptMaxTime (500 ).ConvertAggregateOption (),
112
+ OptAllowDiskUse (false ).ConvertAggregateOption (),
113
+ OptComment ("hello world nested" ).ConvertAggregateOption (),
114
+ OptBatchSize (1000 ).ConvertAggregateOption (),
115
115
}
116
116
117
117
nestedBundle2 := createNestedBundle2 (t )
118
118
nestedBundleOpts2 := []option.Optioner {
119
- OptAllowDiskUse (true ).ConvertOption (),
120
- OptMaxTime (500 ).ConvertOption (),
121
- OptMaxTime (100 ).ConvertOption (),
122
- OptAllowDiskUse (false ).ConvertOption (),
123
- OptComment ("nest1" ).ConvertOption (),
124
- OptComment ("nest2" ).ConvertOption (),
125
- OptBatchSize (1000 ).ConvertOption (),
119
+ OptAllowDiskUse (true ).ConvertAggregateOption (),
120
+ OptMaxTime (500 ).ConvertAggregateOption (),
121
+ OptMaxTime (100 ).ConvertAggregateOption (),
122
+ OptAllowDiskUse (false ).ConvertAggregateOption (),
123
+ OptComment ("nest1" ).ConvertAggregateOption (),
124
+ OptComment ("nest2" ).ConvertAggregateOption (),
125
+ OptBatchSize (1000 ).ConvertAggregateOption (),
126
126
}
127
127
nestedBundleDedupOpts2 := []option.Optioner {
128
- OptMaxTime (100 ).ConvertOption (),
129
- OptAllowDiskUse (false ).ConvertOption (),
130
- OptComment ("nest2" ).ConvertOption (),
131
- OptBatchSize (1000 ).ConvertOption (),
128
+ OptMaxTime (100 ).ConvertAggregateOption (),
129
+ OptAllowDiskUse (false ).ConvertAggregateOption (),
130
+ OptComment ("nest2" ).ConvertAggregateOption (),
131
+ OptBatchSize (1000 ).ConvertAggregateOption (),
132
132
}
133
133
134
134
nestedBundle3 := createNestedBundle3 (t )
135
135
nestedBundleOpts3 := []option.Optioner {
136
- OptMaxTime (100 ).ConvertOption (),
137
- OptAllowDiskUse (true ).ConvertOption (),
138
- OptComment ("nest3" ).ConvertOption (),
139
- OptComment ("nest4" ).ConvertOption (),
140
- OptMaxTime (500 ).ConvertOption (),
141
- OptMaxTime (100 ).ConvertOption (),
142
- OptAllowDiskUse (false ).ConvertOption (),
143
- OptComment ("nest1" ).ConvertOption (),
144
- OptComment ("nest2" ).ConvertOption (),
145
- OptBatchSize (1000 ).ConvertOption (),
136
+ OptMaxTime (100 ).ConvertAggregateOption (),
137
+ OptAllowDiskUse (true ).ConvertAggregateOption (),
138
+ OptComment ("nest3" ).ConvertAggregateOption (),
139
+ OptComment ("nest4" ).ConvertAggregateOption (),
140
+ OptMaxTime (500 ).ConvertAggregateOption (),
141
+ OptMaxTime (100 ).ConvertAggregateOption (),
142
+ OptAllowDiskUse (false ).ConvertAggregateOption (),
143
+ OptComment ("nest1" ).ConvertAggregateOption (),
144
+ OptComment ("nest2" ).ConvertAggregateOption (),
145
+ OptBatchSize (1000 ).ConvertAggregateOption (),
146
146
}
147
147
nestedBundleDedupOpts3 := []option.Optioner {
148
- OptMaxTime (100 ).ConvertOption (),
149
- OptAllowDiskUse (false ).ConvertOption (),
150
- OptComment ("nest2" ).ConvertOption (),
151
- OptBatchSize (1000 ).ConvertOption (),
148
+ OptMaxTime (100 ).ConvertAggregateOption (),
149
+ OptAllowDiskUse (false ).ConvertAggregateOption (),
150
+ OptComment ("nest2" ).ConvertAggregateOption (),
151
+ OptBatchSize (1000 ).ConvertAggregateOption (),
152
152
}
153
153
154
154
t .Run ("TestAll" , func (t * testing.T ) {
@@ -175,7 +175,7 @@ func TestAggregateOpt(t *testing.T) {
175
175
}
176
176
177
177
for i , opt := range opts {
178
- if ! reflect .DeepEqual (opt .ConvertOption (), deleteOpts [i ]) {
178
+ if ! reflect .DeepEqual (opt .ConvertAggregateOption (), deleteOpts [i ]) {
179
179
t .Errorf ("opt mismatch. expected %#v, got %#v" , opt , deleteOpts [i ])
180
180
}
181
181
}
0 commit comments