Skip to content

Commit c149256

Browse files
committed
Add detailed comments for custom HttpClient setups
Clarify the purpose of HttpClient configurations in `SttpRestCallTest` and `JettyRestCallTest`. The added comments explain the use of a connection timeout significantly exceeding the CallTimeout value, improving code readability and maintainability.
1 parent 01cf9f0 commit c149256

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

rest/.jvm/src/test/scala/io/udash/rest/SttpRestCallTest.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ import scala.concurrent.duration.*
1111
import scala.concurrent.{Await, Future}
1212

1313
trait SttpClientRestTest extends ServletBasedRestApiTest {
14+
/**
15+
* Similar to the defaultHttpClient, but with a connection timeout
16+
* significantly exceeding the value of the CallTimeout
17+
*/
1418
implicit val backend: SttpBackend[Future, Any] = HttpClientFutureBackend.usingClient(
15-
//like defaultHttpClient but with connection timeout >> CallTimeout
1619
HttpClient
1720
.newBuilder()
1821
.connectTimeout(JDuration.ofMillis(IdleTimout.toMillis))

rest/jetty/src/test/scala/io/udash/rest/jetty/JettyRestCallTest.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ import io.udash.rest.{RestApiTestScenarios, ServletBasedRestApiTest}
66
import org.eclipse.jetty.client.HttpClient
77

88
final class JettyRestCallTest extends ServletBasedRestApiTest with RestApiTestScenarios {
9+
/**
10+
* Similar to the default HttpClient, but with a connection timeout
11+
* significantly exceeding the value of the CallTimeout
12+
*/
913
val client: HttpClient = new HttpClient() {
1014
setMaxConnectionsPerDestination(MaxConnections)
1115
setIdleTimeout(IdleTimout.toMillis)

0 commit comments

Comments
 (0)