|
126 | 126 | (http/get url {:throw-exceptions false |
127 | 127 | :hystrix/command-key command-key |
128 | 128 | :hystrix/bad-request-pred client-error?}) => (contains {:status 400})) |
129 | | - (Thread/sleep 1000) ;sleep to wait for Hystrix health snapshot |
| 129 | + (Thread/sleep 600) ;sleep to wait for Hystrix health snapshot |
130 | 130 | (http/get url {:throw-exceptions false |
131 | 131 | :hystrix/command-key command-key}) => (contains {:status 200})))) |
132 | 132 |
|
|
144 | 144 | (http/get url {:throw-exceptions true |
145 | 145 | :hystrix/command-key command-key |
146 | 146 | :hystrix/bad-request-pred client-error?}) => (throws ExceptionInfo)) |
147 | | - (Thread/sleep 1000) ;sleep to wait for Hystrix health snapshot |
| 147 | + (Thread/sleep 600) ;sleep to wait for Hystrix health snapshot |
148 | 148 | (http/get url {:throw-exceptions false |
149 | 149 | :hystrix/command-key command-key}) => (contains {:status 200})))) |
150 | 150 |
|
|
159 | 159 | (http/get url {:throw-exceptions false |
160 | 160 | :hystrix/command-key command-key |
161 | 161 | :hystrix/bad-request-pred (constantly false)}) => (contains {:status 400})) |
162 | | - (Thread/sleep 1000) ;sleep to wait for Hystrix health snapshot |
| 162 | + (Thread/sleep 600) ;sleep to wait for Hystrix health snapshot |
163 | 163 | (http/get url {:throw-exceptions false |
164 | 164 | :hystrix/command-key command-key}) => (contains {:status 503})))) |
| 165 | + |
| 166 | +(fact "status-codes predicate matches only given status codes" |
| 167 | + (let [predicate (status-codes 100 200 300)] |
| 168 | + (predicate {} {:status 100}) => true |
| 169 | + (predicate {} {:status 200}) => true |
| 170 | + (predicate {} {:status 300}) => true |
| 171 | + (predicate {} {:status 101}) => false |
| 172 | + (predicate {} {:status 202}) => false |
| 173 | + (predicate {} {:status 299}) => false)) |
0 commit comments