Skip to content

Commit 105fb53

Browse files
committed
Release 0.7.9
- Fix variable resolution by prepending dynamic environment - Add @JvmSynthetic to hide internal methods Signed-off-by: Gopal S Akshintala <gopala.akshintala@salesforce.com>
1 parent 5b139fd commit 105fb53

File tree

16 files changed

+2392
-80
lines changed

16 files changed

+2392
-80
lines changed

README.adoc

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ endif::[]
1818
:pmtemplates: src/integrationTest/resources/pm-templates
1919
:imagesdir: docs/images
2020
:prewrap!:
21-
:revoman-version: 0.7.8.1
21+
:revoman-version: 0.7.9
2222

2323
'''
2424

@@ -52,8 +52,9 @@ to always be ready for Manually trying them out importing into Postman.
5252
== Why not use https://learning.postman.com/docs/collections/using-newman-cli/command-line-integration-with-newman[Newman] or https://learning.postman.com/docs/postman-cli/postman-cli-overview/#comparing-the-postman-cli-and-newman[Postman CLI]?
5353

5454
* ReṼoman may be similar to Newman or Postman CLI when it comes to executing a Postman collection, but the _similarities end there_
55-
* Newman or Postman CLI are built for node and cannot be executed within a JVM. Even if you are able to run in some hacky way, there is no easy way to assert results.
56-
* ReṼoman is JVM first that lets you seamlessly integrate with your existing Java ecosystem. It lets you configure more — for example, the <<#_pre_step_and_post_step_hooks,Hooks>> feature lets you plug in your custom JVM code in-between the execution.
55+
* Newman or Postman CLI are built for node and cannot be executed within a JVM. Even if you are able to run with some hacky way, there is no easy way to assert results.
56+
* ReṼoman is JVM first that lets you seamlessly integrate with your existing Java ecosystem.
57+
* It has more features, like <<#_pre_step_and_post_step_hooks,Hooks>> feature lets you plug in your custom JVM code in-between the execution. The <<Rundown>> is much richer in providing execution information than the link:{pmtemplates}/restfulapidev/postman-cli-reports/restful-api.dev-2025-04-14-13-16-43.json[newman/postman-cli reports]
5758
* ReṼoman has a strong emphasis on <<#_type_safety_with_flexible_json_pojo_marshallingserialization_and_unmarshallingdeserialization,Type-Safety>>, leveraging JVM strong types over JSON for writing assertions and custom code
5859

5960
[.lead]
@@ -128,25 +129,7 @@ ____
128129
==== Why Postman Templates?
129130

130131
The exported Postman collection JSON file is referred to as a Postman template, as it contains some placeholders/variables in the `+{{variable-key}}+` pattern. You can read more about it https://learning.postman.com/docs/sending-requests/variables/[here].
131-
This is a popular and proven pattern that interconnects multiple requests like a Graph. This is not unique to Postman, but Postman is popular and familiar in the dev community and has a full-blown UI, which makes it an attractive choice to support Postman templates. But that said, ReṼoman is modular, and the implementation is not coupled with any Postman related contracts. *In the future, we can think of supporting more template formats*
132-
133-
==== Variable support in ReṼoman
134-
135-
* Variables, e.g., `+{{variable-key}}+`
136-
* Nested variables, e.g., `+{{variable-key{{nested-variable-key}}}}+`
137-
* link:{sourcedir}/com/salesforce/revoman/internal/postman/DynamicVariableGenerator.kt[Dynamic variables],
138-
e.g., `{{$randomUUID}}`, `{{$randomEmail}}`
139-
* <<Custom Dynamic variables>>
140-
141-
[#_variable_resolution_precedence]
142-
==== Variable resolution precedence
143-
In the case of collision between variable keys, the precedence order to derive a value to replace any key is:
144-
145-
* Custom Dynamic variables
146-
* Generated Dynamic variables
147-
* Dynamic Environment supplied through config + Environment built during execution + Postman environment supplied as a file through config
148-
149-
TIP: For Dynamic variables, which gets populated from Java code, use $ sign within a variable to indicate it needs to be populated during manual testing.E.g.: `{{$unitPrice}}`
132+
This is a popular and proven pattern that interconnects multiple endpoint requests like a Graph. This is not unique to Postman, but Postman is popular and familiar in the dev community and has a full-blown UI, which makes it an attractive choice to start with supporting Postman templates. But that said, ReṼoman is modular, and the implementation is not coupled with any Postman related contracts. *In the future, we can think of supporting more template formats*
150133

151134
[.lead]
152135
You can _kick off_ this *Template-Driven Testing* by invoking `ReVoman.revUp()`,
@@ -362,7 +345,26 @@ include::{integrationtestdir}/com/salesforce/revoman/integration/core/pq/PQE2EWi
362345
<14> Run more assertions on the <<Rundown>>
363346
endif::[]
364347

365-
== Config
348+
=== Variables
349+
350+
* Variables, e.g., `+{{variable-key}}+`
351+
* Nested variables, e.g., `+{{variable-key{{nested-variable-key}}}}+`
352+
* link:{sourcedir}/com/salesforce/revoman/internal/postman/DynamicVariableGenerator.kt[Dynamic variables],
353+
e.g., `{{$randomUUID}}`, `{{$randomEmail}}`
354+
* <<Custom Dynamic variables>>
355+
356+
==== Variable resolution precedence
357+
In the case of collision between variable keys, the precedence order to derive a value to replace any key is:
358+
359+
* <<Custom Dynamic variables>>
360+
* link:{sourcedir}/com/salesforce/revoman/internal/postman/DynamicVariableGenerator.kt[Dynamic variables]
361+
* Environment built during execution
362+
* Dynamic Environment supplied through config
363+
* Postman Environment supplied as a file path through config
364+
365+
TIP: Variable naming Convention: For Dynamic variables, which gets populated from Java code, use `$` sign within a variable to indicate it needs to be populated during manual testing, e.g.: `{{$unitPrice}}`.
366+
367+
=== Config management
366368

367369
[.lead]
368370
Config built using `Kick.configure()` is *Immutable*.
@@ -377,7 +379,7 @@ CAUTION: The new instance created from common config using `override...()` repla
377379

378380
[source,java,indent=0,tabsize=2,options="nowrap"]
379381
----
380-
POKEMON_COMMON_CONFIG.overrideHooks(kotlin.collections.CollectionsKt.plus(POKEMON_COMMON_CONFIG.hooks(), post(.../*My Hooks*/))
382+
COMMON_CONFIG.overrideHooks(kotlin.collections.CollectionsKt.plus(COMMON_CONFIG.hooks(), post(.../*My Hooks*/))
381383
----
382384

383385
* You can also construct a new instance by accumulating attributes from other instances using `from()` method, like below:
@@ -389,7 +391,6 @@ Kick.configure().from(configInstance1).from(configInstance2)...off();
389391

390392
CAUTION: Iterable attributes (like `List`, `Map` etc) accept an `Iterable`. If you are particular about the order, make sure to pass an Ordered instance of `Iterable` (like `ArrayList`)
391393

392-
[#_debugging_dx]
393394
== Troubleshooting DX
394395

395396
[#_ide_debugger_view]

buildSrc/src/main/kotlin/Config.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
* ************************************************************************************************
77
*/
88
const val GROUP_ID = "com.salesforce.revoman"
9-
const val VERSION = "0.7.8.1"
9+
const val VERSION = "0.7.9"
1010
const val ARTIFACT_ID = "revoman"
1111
const val STAGING_PROFILE_ID = "1ea0a23e61ba7d"

src/integrationTest/kotlin/com/salesforce/revoman/integration/restfulapidev/RestfulAPIDevKtTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ class RestfulAPIDevKtTest {
1616
@Test
1717
fun `execute restful-api dev pm collection`() {
1818
val rundown =
19-
ReVoman.revUp( // <1>
19+
ReVoman.revUp(
20+
// <1>
2021
Kick.configure()
2122
.templatePath(PM_COLLECTION_PATH) // <2>
2223
.environmentPath(PM_ENVIRONMENT_PATH) // <3>

src/integrationTest/resources/pm-templates/core/milestone/env.postman_environment.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
"values": [
55
{
66
"key" : "baseUrl",
7-
"value" : "https://localhost:6101/",
7+
"value" : "https://orgfarm-fe6a79aee6.test1.my.pc-rnd.salesforce.com/",
88
"type" : "default",
99
"enabled" : true
1010
},
1111
{
1212
"key" : "username",
13-
"value" : "blng1@256.org",
13+
"value" : "epic.cdfddbbc08b7@orgfarm.out",
1414
"type" : "default",
1515
"enabled" : true
1616
},
1717
{
1818
"key" : "password",
19-
"value" : "123456",
19+
"value" : "orgfarm1234",
2020
"type" : "default",
2121
"enabled" : true
2222
},

0 commit comments

Comments
 (0)