You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Move CompositeGraphResponse adapter
- Minor corrections to Request and Response Info
- Add MilestoneBillingE2ETest
- Minor doc edits
Signed-off-by: Gopal S Akshintala <[email protected]>
<1> https://docs.vavr.io/#_either[`Either` type from the VAVR] library represents either of the two states, error or success
212
+
<1> https://docs.vavr.io/#_either[`Either` type from the VAVR] library represents either of the two states, used here to represent error or success
213
213
<2> Snapshot of Environment at the end of each step execution. It can be compared with previous or next step environment snapshots to see what changed in this step
214
214
215
215
[.lead]
@@ -399,8 +399,8 @@ where you can filter out these legacy types from Marshalling/Unmarshalling
399
399
* You may use the bundled static factory methods named `RequestConfig.unmarshallResponse()` for expressiveness.
400
400
* You can pass a `PreTxnStepPick` which is a `Predicate` used
401
401
to qualify a step whose Request JSON payload needs to be unmarshalled/deserialized.
402
-
* If you have set up `requestConfig()` once, wherever you wish to access the request in your <<#_pre_step_and_post_step_hooks,Pre-Step Hooks>>, you can call `stepReport.responseInfo.get().<TypeT>getTypedTxnObj()` which returns a Strong type to conveniently assert.
403
-
* If you don't pass anything in this config, Moshi unmarshalls into default data structures like `LinkedHashMap`
402
+
* If you have set up `requestConfig()` once, wherever you wish to read the request in your <<#_pre_step_and_post_step_hooks,Pre-Step Hooks>>, you can call `stepReport.requestInfo.get().<TypeT>getTypedTxnObj()` which returns your request JSON as a Strong type.
403
+
* If you don't configure it for a step, Moshi unmarshalls the step request JSON into default data structures like `LinkedHashMap`
404
404
405
405
==== `responseConfig()`
406
406
@@ -409,8 +409,8 @@ to qualify a step whose Request JSON payload needs to be unmarshalled/deserializ
409
409
* Use bundled static factory methods like `ResponseConfig.unmarshallSuccessResponse()` and `ResponseConfig.unmarshallErrorResponse()` for expressiveness.
410
410
* You can pass a `PostTxnStepPick` which is a `Predicate` used
411
411
to qualify a step whose Response JSON payload needs to be unmarshalled/deserialized.
412
-
* If you have set up `responseConfig()` once, wherever you wish to access or assert the response in your <<#_pre_step_and_post_step_hooks,Post-Step Hooks>>, you can call `stepReport.responseInfo.get().<TypeT>getTypedTxnObj()` which returns a Strong type to conveniently assert.
413
-
* If you don't pass anything in this config, Moshi unmarshalls into default data structures like `LinkedHashMap`
412
+
* If you have set up `responseConfig()` once, wherever you wish to read or assert the response in your <<#_pre_step_and_post_step_hooks,Post-Step Hooks>>, you can call `stepReport.responseInfo.get().<TypeT>getTypedTxnObj()` which returns your response JSON as a Strong type to conveniently assert.
413
+
* If you don't configure it for a step, Moshi unmarshalls the Step response JSON into default data structures like `LinkedHashMap`
414
414
415
415
[TIP]
416
416
====
@@ -425,16 +425,16 @@ See `DiMorphicAdapter` in action from the test `compositeGraphResponseDiMorphicM
425
425
426
426
==== `globalCustomTypeAdapters()`
427
427
428
-
These adapters are used for marshalling/unmarshalling request/response payload for any step.
429
-
These compliment the custom adapters setup in `requestConfig()` or `responseConfig()`
428
+
* These come handy when the same POJO/Data structure (e.g `ID`) is present across multiple Request or Response POJOs. These adapters compliment the custom adapters setup in `requestConfig()` or `responseConfig()` wherever these types are present.
429
+
* But these adapters won't be used to marshall/unmarshall before or after each step execution. Which means you won't be able to Strong types in the debug view. Although, you can get them on-demand using the respective `getTypedObj()` method.
430
430
431
431
==== JSON Reader/Writer Utils to build Moshi adapters
432
432
433
433
ReṼoman also comes
434
434
bundled with link:{sourcedir}/com/salesforce/revoman/input/json/JsonReaderUtils.kt[JSON Reader utils] and link:{sourcedir}/com/salesforce/revoman/input/json/JsonWriterUtils.kt[JSON Writer utils]
435
435
to help build Moshi adapters.
436
436
437
-
TIP: Refer link:{integrationtestdir}/com/salesforce/revoman/integration/core/pq/adapters/ConnectInputRepWithGraphAdapter.java[ConnectInputRepWithGraphAdapter] on how these utils come in handy in building an advanced Moshi adapter
437
+
TIP: Refer link:{integrationtestdir}/com/salesforce/revoman/integration/core/adapters/ConnectInputRepWithGraphAdapter.java[ConnectInputRepWithGraphAdapter] on how these utils come in handy in building an advanced Moshi adapter
You can read an environment variable value as a Strong type.
454
-
See it in action: `getTypedObj()`
455
-
test from link:{testdir}/com/salesforce/revoman/output/postman/PostmanEnvironmentTest.java[PostmanEnvironmentTest]
456
-
457
451
=== Execution Control
458
452
459
453
The configuration offers methods through which the execution strategy can be controlled without making any changes to the template:
@@ -577,6 +571,12 @@ so you can copy and import that environment conveniently into Postman.
577
571
TIP: You do NOT need to save the copied Postman environment JSON from the debugger into file.
578
572
You can paste (kbd:[Ctrl+v]) directly in the Postman environment window
579
573
574
+
==== Read Environment value into Strong type
575
+
576
+
You can read any value from mutableEnv as a Strong type using `rundown.mutableEnv.<TypeT>getTypedObj()`
577
+
See it in action: `getTypedObj()`
578
+
test from link:{testdir}/com/salesforce/revoman/output/postman/PostmanEnvironmentTest.java[PostmanEnvironmentTest]
579
+
580
580
==== `pmEnvSnapshot` in each StepReport
581
581
582
582
Each StepReport also has a `pmEnvSnapshot` to assert if a step has executed as expected and compare snapshots from different steps to examine the execution progress.
@@ -585,7 +585,7 @@ Each StepReport also has a `pmEnvSnapshot` to assert if a step has executed as e
585
585
586
586
* You don't have to squash all your steps into one mega collection. Instead, you can break them into easy-to-manage modular collections. `ReVoman.revUp()` accepts a list of collection paths through `templatePaths()`
587
587
* But that doesn't mean you have to execute all these templates in one-go. You can make multiple `ReVoman.revUp()` calls for different collections.
588
-
* If you wish to compose these executions in a specific order, you can use the `revUp` overload which accepts a vararg `Kick` configs.
588
+
* If you wish to compose these executions in a specific order, you can use the `revUp()` overload which accepts a vararg `Kick` configs.
589
589
** You can also achieve the same yourself, by adding the previous execution's `mutableEnv` to the current execution using the `dynamicEnvironment` parameter. This also comes in handy when you wish to execute a common step (e.g. `UserSetup`) inside a Test setup method and use that environment for all the tests.
590
590
591
591
=== Custom Dynamic variables
@@ -603,6 +603,12 @@ TIP: Here is an example of a low-code link:{integrationtestdir}/com/salesforce/r
603
603
Compared to a traditional Integration/Functional or E2E test, approximately, the amount of code needed is *89%* less using ReṼoman.
604
604
The above test doesn't just have low code, but also low in Cognitive Complexity and Transparent in what it does.
605
605
606
+
=== Low Learning Curve
607
+
608
+
Familiarity with Postman gets you a long way in understanding this tool.
609
+
Playing with the existing link:{integrationtestdir}[Integration Tests]
610
+
and writing a couple of hands-on tests should get you started.
611
+
606
612
=== CI/CD integrability
607
613
608
614
* ReṼoman is like any JVM library that you can plug into any JVM program/test (e.g., JUnit tests or Integration tests).
@@ -658,7 +664,7 @@ The future looks bright with multiple impactful features in the pipeline:
658
664
659
665
You don't have to.
660
666
This is a JVM-first tool,
661
-
and you can interlace your TestUtils through <<#_plug_in_your_java_code_in_between_postman_execution,Pre-/Post-Hooks>>
667
+
and you can interlace your TestUtils through <<#_plug_in_your_java_code_in_between_postman_execution,Pre-Step/Post-Step Hooks>>
662
668
663
669
=== 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]?
Copy file name to clipboardExpand all lines: src/integrationTest/java/com/salesforce/revoman/integration/core/adapters/ConnectInputRepWithGraphAdapter.java
0 commit comments