@@ -31,38 +31,38 @@ private val faker = faker {}
3131private val dynamicVariableGenerators: Map <String , () - > String > =
3232 mapOf (
3333 // Common
34- " \ $ guid" to { UUID .randomUUID().toString() },
35- " \ $ timestamp" to { Clock .System .now().epochSeconds.toString() },
36- " \ $ isoTimestamp" to { Clock .System .now().toString() },
37- " \ $ randomUUID" to { UUID .randomUUID().toString() },
34+ $$ " $guid " to { UUID .randomUUID().toString() },
35+ $$ " $timestamp " to { Clock .System .now().epochSeconds.toString() },
36+ $$ " $isoTimestamp " to { Clock .System .now().toString() },
37+ $$ " $randomUUID " to { UUID .randomUUID().toString() },
3838 // Text, numbers, and colors
39- " \ $ randomAlphaNumeric" to { randomAlphanumeric(1 ) },
40- " \ $ randomBoolean" to { nextBoolean().toString() },
41- " \ $ randomInt" to { nextInt(0 , Int .MAX_VALUE ).toString() },
42- " \ $ randomColor" to faker.color::name,
43- " \ $ randomHexColor" to { " #${getRandomHex()}${getRandomHex()}${getRandomHex()} " },
39+ $$ " $randomAlphaNumeric " to { randomAlphanumeric(1 ) },
40+ $$ " $randomBoolean " to { nextBoolean().toString() },
41+ $$ " $randomInt " to { nextInt(0 , Int .MAX_VALUE ).toString() },
42+ $$ " $randomColor " to faker.color::name,
43+ $$ " $randomHexColor " to { " #${getRandomHex()}${getRandomHex()}${getRandomHex()} " },
4444 // Internet and IP addresses
45- " \ $ randomIP" to faker.internet::iPv4Address,
46- " \ $ randomIPV6" to faker.internet::iPv6Address,
47- " \ $ randomMACAddress" to { faker.internet.macAddress() },
48- " \ $ randomPassword" to { randomAlphanumeric(15 ) },
45+ $$ " $randomIP " to faker.internet::iPv4Address,
46+ $$ " $randomIPV6 " to faker.internet::iPv6Address,
47+ $$ " $randomMACAddress " to { faker.internet.macAddress() },
48+ $$ " $randomPassword " to { randomAlphanumeric(15 ) },
4949 // Names
50- " \ $ randomFirstName" to faker.name::firstName,
51- " \ $ randomLastName" to faker.name::lastName,
52- " \ $ randomUserName" to { faker.name.firstName() + faker.name.lastName() },
50+ $$ " $randomFirstName " to faker.name::firstName,
51+ $$ " $randomLastName " to faker.name::lastName,
52+ $$ " $randomUserName " to { faker.name.firstName() + faker.name.lastName() },
5353 // Phone, address, and location
54- " \ $ randomCity" to faker.address::city,
54+ $$ " $randomCity " to faker.address::city,
5555 // Grammar
56- " \ $ randomAdjective" to faker.adjective::positive,
57- " \ $ randomWord" to faker.lorem::words,
56+ $$ " $randomAdjective " to faker.adjective::positive,
57+ $$ " $randomWord " to faker.lorem::words,
5858 // Business
59- " \ $ randomCompanyName" to faker.company::name,
60- " \ $ randomProduct" to faker.industrySegments::sector,
59+ $$ " $randomCompanyName " to faker.company::name,
60+ $$ " $randomProduct " to faker.industrySegments::sector,
6161 // Domains, emails, and usernames
62- " \ $ randomEmail" to { faker.internet.email() },
62+ $$ " $randomEmail " to { faker.internet.email() },
6363 // Date time
64- " \ $ currentDate" to { LocalDate .now().toString() },
65- " \ $ randomFutureDate" to
64+ $$ " $currentDate " to { LocalDate .now().toString() },
65+ $$ " $randomFutureDate " to
6666 {
6767 LocalDate .now().let { it.plusDays(nextLong(1 , it.lengthOfYear().toLong())).toString() }
6868 },
@@ -76,7 +76,7 @@ fun randomAlphanumeric(length: Int) =
7676 (1 .. length).map { charPool[nextInt(0 , charPool.size)] }.joinToString(" " )
7777
7878private val dynamicVariableGeneratorsWithPM: Map <String , (PostmanSDK ) - > String > =
79- mapOf (" \ $ currentRequestName" to { it.info.requestName })
79+ mapOf ($$ " $currentRequestName " to { it.info.requestName })
8080
8181internal fun dynamicVariableGenerator (key : String , pm : PostmanSDK ): String? =
8282 dynamicVariableGenerators[key]?.invoke() ? : dynamicVariableGeneratorsWithPM[key]?.invoke(pm)
0 commit comments