From aff377bca8c3ccaeeaf7275ade2cc8f91252d8e7 Mon Sep 17 00:00:00 2001 From: Tim Ysewyn Date: Tue, 6 Aug 2019 00:38:06 +0200 Subject: [PATCH] Updated withQueryParameters infix extension functions --- .../cloud/contract/spec/ContractDslExtensions.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/specs/spring-cloud-contract-spec-kotlin/src/main/kotlin/org/springframework/cloud/contract/spec/ContractDslExtensions.kt b/specs/spring-cloud-contract-spec-kotlin/src/main/kotlin/org/springframework/cloud/contract/spec/ContractDslExtensions.kt index fc5d9a99c3..1ad594574b 100644 --- a/specs/spring-cloud-contract-spec-kotlin/src/main/kotlin/org/springframework/cloud/contract/spec/ContractDslExtensions.kt +++ b/specs/spring-cloud-contract-spec-kotlin/src/main/kotlin/org/springframework/cloud/contract/spec/ContractDslExtensions.kt @@ -26,14 +26,12 @@ import java.util.stream.Collectors /** * @author Tim Ysewyn */ -infix fun Url.withQueryParameters(parameters: QueryParameters.() -> Unit): Url { - this.queryParameters = QueryParameters().apply(parameters) - return this +infix fun Url.withQueryParameters(parameters: QueryParameters.() -> Unit) = apply { + queryParameters = QueryParameters().apply(parameters) } -infix fun UrlPath.withQueryParameters(parameters: QueryParameters.() -> Unit): UrlPath { - this.queryParameters = QueryParameters().apply(parameters) - return this +infix fun UrlPath.withQueryParameters(parameters: QueryParameters.() -> Unit) = apply { + queryParameters = QueryParameters().apply(parameters) } fun Any.toDslProperty(): DslProperty {