|
16 | 16 | # limitations under the License.
|
17 | 17 | #
|
18 | 18 | require 'spec_helper'
|
| 19 | +require 'optimizely/logger' |
19 | 20 | require 'optimizely/cmab/cmab_client'
|
20 | 21 |
|
21 | 22 | describe Optimizely::DefaultCmabClient do
|
|
127 | 128 | end
|
128 | 129 |
|
129 | 130 | it 'should return the variation id on first try with retry config but no retry needed' do
|
130 |
| - client_with_retry = described_class.new( |
131 |
| - http_client: mock_http_client, |
132 |
| - logger: spy_logger, |
133 |
| - retry_config: retry_config |
134 |
| - ) |
| 131 | + client_with_retry = described_class.new(mock_http_client, retry_config, spy_logger) |
135 | 132 |
|
136 | 133 | # Mock successful response
|
137 | 134 | mock_response = double('response', status_code: 200, json: {'predictions' => [{'variationId' => 'abc123'}]})
|
|
153 | 150 | end
|
154 | 151 |
|
155 | 152 | it 'should return the variation id on third try with retry config' do
|
156 |
| - client_with_retry = described_class.new( |
157 |
| - http_client: mock_http_client, |
158 |
| - logger: spy_logger, |
159 |
| - retry_config: retry_config |
160 |
| - ) |
| 153 | + client_with_retry = described_class.new(mock_http_client, retry_config, spy_logger) |
161 | 154 |
|
162 | 155 | # Create failure and success responses
|
163 | 156 | failure_response = double('response', status_code: 500)
|
|
194 | 187 | end
|
195 | 188 |
|
196 | 189 | it 'should exhausts all retry attempts' do
|
197 |
| - client_with_retry = described_class.new( |
198 |
| - http_client: mock_http_client, |
199 |
| - logger: spy_logger, |
200 |
| - retry_config: retry_config |
201 |
| - ) |
| 190 | + client_with_retry = described_class.new(mock_http_client, retry_config, spy_logger) |
202 | 191 |
|
203 | 192 | # Create failure response
|
204 | 193 | failure_response = double('response', status_code: 500)
|
|
0 commit comments