Skip to content

Commit 5d60481

Browse files
committed
refactor: essystem default url
1 parent d62578d commit 5d60481

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

lib/stove-testing-e2e-elasticsearch/src/main/kotlin/com/trendyol/stove/testing/e2e/elasticsearch/ElasticsearchSystem.kt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -320,19 +320,11 @@ class ElasticsearchSystem internal constructor(
320320
return "$scheme://${cfg.host}:${cfg.port}"
321321
}
322322

323-
private fun createHttpClient(cfg: ElasticSearchExposedConfiguration): HttpClient {
324-
val client = context.options.httpClientConfigurer
323+
private fun createHttpClient(cfg: ElasticSearchExposedConfiguration): HttpClient =
324+
context.options.httpClientConfigurer
325325
.getOrElse { { defaultHttpClient(cfg) } }
326326
.invoke(cfg)
327327

328-
// Apply base URL configuration to whatever client was created
329-
return client.config {
330-
defaultRequest {
331-
url(baseUrl)
332-
}
333-
}
334-
}
335-
336328
private fun defaultHttpClient(cfg: ElasticSearchExposedConfiguration): HttpClient =
337329
HttpClient(OkHttp) {
338330
engine {
@@ -355,6 +347,7 @@ class ElasticsearchSystem internal constructor(
355347
}
356348

357349
defaultRequest {
350+
url(buildBaseUrl(cfg))
358351
if (cfg.isSecure && cfg.password.isNotBlank()) {
359352
header(HttpHeaders.Authorization, cfg.basicAuthHeader())
360353
}

lib/stove-testing-e2e-http/api/stove-testing-e2e-http.api

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
public final class com/trendyol/stove/testing/e2e/http/HttpClientSystemOptions : com/trendyol/stove/testing/e2e/system/abstractions/SystemOptions {
22
public static final field Companion Lcom/trendyol/stove/testing/e2e/http/HttpClientSystemOptions$Companion;
3-
public synthetic fun <init> (Ljava/lang/String;Lio/ktor/serialization/ContentConverter;JLkotlin/jvm/functions/Function0;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
4-
public synthetic fun <init> (Ljava/lang/String;Lio/ktor/serialization/ContentConverter;JLkotlin/jvm/functions/Function0;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
3+
public synthetic fun <init> (Ljava/lang/String;Lio/ktor/serialization/ContentConverter;JLkotlin/jvm/functions/Function1;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
4+
public synthetic fun <init> (Ljava/lang/String;Lio/ktor/serialization/ContentConverter;JLkotlin/jvm/functions/Function1;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
55
public final fun component1 ()Ljava/lang/String;
66
public final fun component2 ()Lio/ktor/serialization/ContentConverter;
77
public final fun component3-UwyO8pc ()J
8-
public final fun component4 ()Lkotlin/jvm/functions/Function0;
9-
public final fun copy-exY8QGI (Ljava/lang/String;Lio/ktor/serialization/ContentConverter;JLkotlin/jvm/functions/Function0;)Lcom/trendyol/stove/testing/e2e/http/HttpClientSystemOptions;
10-
public static synthetic fun copy-exY8QGI$default (Lcom/trendyol/stove/testing/e2e/http/HttpClientSystemOptions;Ljava/lang/String;Lio/ktor/serialization/ContentConverter;JLkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lcom/trendyol/stove/testing/e2e/http/HttpClientSystemOptions;
8+
public final fun component4 ()Lkotlin/jvm/functions/Function1;
9+
public final fun copy-exY8QGI (Ljava/lang/String;Lio/ktor/serialization/ContentConverter;JLkotlin/jvm/functions/Function1;)Lcom/trendyol/stove/testing/e2e/http/HttpClientSystemOptions;
10+
public static synthetic fun copy-exY8QGI$default (Lcom/trendyol/stove/testing/e2e/http/HttpClientSystemOptions;Ljava/lang/String;Lio/ktor/serialization/ContentConverter;JLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lcom/trendyol/stove/testing/e2e/http/HttpClientSystemOptions;
1111
public fun equals (Ljava/lang/Object;)Z
1212
public final fun getBaseUrl ()Ljava/lang/String;
1313
public final fun getContentConverter ()Lio/ktor/serialization/ContentConverter;
14-
public final fun getCreateClient ()Lkotlin/jvm/functions/Function0;
14+
public final fun getCreateClient ()Lkotlin/jvm/functions/Function1;
1515
public final fun getTimeout-UwyO8pc ()J
1616
public fun hashCode ()I
1717
public fun toString ()Ljava/lang/String;

0 commit comments

Comments
 (0)