| 1337 | |
| 1338 | SC_TEST_EXPECT(client.init(clientStorage)); |
| 1339 | SC_TEST_EXPECT(StringBuilder::format(url1, "http://127.0.0.1:{}/first", port1)); |
| 1340 | SC_TEST_EXPECT(StringBuilder::format(url2, "http://127.0.0.1:{}/second", port2)); |
| 1341 | |
| 1342 | client.onResponse = [this, &ctx](HttpAsyncClientResponse& response) |
| 1343 | { |
| 1344 | ctx.collector.attach(response, |
| 1345 | [this, &ctx](HttpAsyncClientResponse& completedResponse) |
| 1346 | { |
| 1347 | ctx.collector.detach(); |
| 1348 | ctx.completions++; |
| 1349 | if (ctx.completions == 1) |
| 1350 | { |
| 1351 | SC_TEST_EXPECT(completedResponse.getParser().statusCode == 200); |
| 1352 | SC_TEST_EXPECT(StringView(ctx.collector.view()) == "first"); |
| 1353 | SC_TEST_EXPECT(ctx.scheduleDeferred(Context::DeferredAction::RepeatFirstRequest)); |
| 1354 | } |
| 1355 | else if (ctx.completions == 2) |