├── .asciidoctor
└── docinfo.html
├── .asciidoctorconfig
├── .editorconfig
├── .github
└── workflows
│ └── build.yml
├── .gitignore
├── .idea
├── GitLink.xml
├── cody_history.xml
├── copyright
│ ├── oss_sf.xml
│ └── profiles_settings.xml
├── detekt.xml
├── git_toolbox_blame.xml
├── git_toolbox_prj.xml
├── icon.png
├── kotlin-statistics.xml
├── kotlinc.xml
├── ktfmt.xml
├── misc.xml
└── vcs.xml
├── BUILD.bazel
├── CODEOWNERS
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.adoc
├── LICENSE
├── MODULE.bazel
├── MODULE.bazel.lock
├── README.adoc
├── SECURITY.md
├── WORKSPACE
├── build.gradle.kts
├── buildSrc
├── build.gradle.kts
├── settings.gradle.kts
└── src
│ └── main
│ └── kotlin
│ ├── Config.kt
│ ├── preDef.kt
│ ├── revoman.kt-conventions.gradle.kts
│ ├── revoman.publishing-conventions.gradle.kts
│ └── revoman.root-conventions.gradle.kts
├── detekt
├── baseline.xml
└── config.yml
├── docs
├── images
│ ├── cognitive-complexity.png
│ ├── failure-hierarchy.png
│ ├── hybrid-tool.png
│ ├── manual-to-automation.png
│ ├── mutable-env.png
│ ├── node_modules.png
│ ├── postman-run.png
│ ├── pq-exe-logging.gif
│ ├── pq-revoman-test-time.png
│ ├── resfulapi-dev-pm.png
│ ├── revoman-demo-thumbnail.png
│ ├── rundown.png
│ ├── step-procedure.png
│ └── step-report.png
├── release-notes
│ └── revoman-2.0.adoc
└── revoman.exe.log
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── js
├── package-lock.json
└── package.json
├── libs.versions.toml
├── qodana.yaml
├── renovate.json
├── settings.gradle.kts
└── src
├── integrationTest
├── java
│ └── com
│ │ └── salesforce
│ │ └── revoman
│ │ ├── input
│ │ └── json
│ │ │ └── JsonPojoUtils2Test.java
│ │ └── integration
│ │ ├── core
│ │ ├── CoreUtils.java
│ │ ├── adapters
│ │ │ ├── ConnectInputRepWithGraphAdapter.java
│ │ │ └── IDAdapter.java
│ │ ├── bt2bs
│ │ │ ├── MilestoneBillingE2ETest.java
│ │ │ └── ReVomanConfigForBT2BS.java
│ │ └── pq
│ │ │ ├── PQE2EWithSMTest.java
│ │ │ └── connect
│ │ │ ├── request
│ │ │ ├── ConnectInputRepresentationWithGraph.java
│ │ │ ├── ObjectGraphInputRepresentation.java
│ │ │ ├── ObjectInputRepresentationMap.java
│ │ │ ├── ObjectWithReferenceInputRepresentation.java
│ │ │ ├── ObjectWithReferenceInputRepresentationList.java
│ │ │ ├── PlaceQuoteInputRepresentation.java
│ │ │ └── PricingPreferenceEnum.java
│ │ │ └── response
│ │ │ ├── ID.java
│ │ │ ├── PlaceQuoteErrorResponseRepresentation.java
│ │ │ └── PlaceQuoteOutputRepresentation.java
│ │ ├── pokemon
│ │ └── PokemonTest.java
│ │ └── restfulapidev
│ │ └── RestfulAPIDevTest.java
├── kotlin
│ └── com
│ │ └── salesforce
│ │ └── revoman
│ │ └── integration
│ │ ├── apigee
│ │ └── ApigeeKtTest.kt
│ │ └── restfulapidev
│ │ └── RestfulAPIDevKtTest.kt
└── resources
│ ├── json
│ ├── pq-payload.json
│ ├── pq-response.json
│ └── pricing-pref.json
│ ├── log4j2.xml
│ └── pm-templates
│ ├── apigee
│ └── apigee.postman_collection.json
│ ├── core
│ ├── milestone
│ │ ├── bmp-create-runtime.postman_collection.json
│ │ ├── env.postman_environment.json
│ │ ├── milestone-setup.postman_collection.json
│ │ └── persona-creation-and-setup.postman_collection.json
│ └── pq
│ │ ├── [sm] pq.postman_collection.json
│ │ ├── [sm] user-creation-with-ps-and-setup-pq.postman_collection.json
│ │ ├── pq-env.postman_environment.json
│ │ └── pre-salesRep.postman_collection.json
│ ├── pokemon
│ ├── pokemon.postman_collection.json
│ └── pokemon.postman_environment.json
│ └── restfulapidev
│ ├── postman-cli-reports
│ └── restful-api.dev-2025-04-14-13-16-43.json
│ ├── restful-api.dev.postman_collection.json
│ └── restful-api.dev.postman_environment.json
├── main
├── kotlin
│ └── com
│ │ └── salesforce
│ │ └── revoman
│ │ ├── ReVoman.kt
│ │ ├── input
│ │ ├── FileUtils.kt
│ │ ├── PostExeHook.kt
│ │ ├── config
│ │ │ ├── HookConfig.kt
│ │ │ ├── KickDef.kt
│ │ │ ├── RequestConfig.kt
│ │ │ ├── ResponseConfig.kt
│ │ │ └── StepPick.kt
│ │ └── json
│ │ │ ├── FnTypes.kt
│ │ │ ├── JsonPojoUtils.kt
│ │ │ ├── JsonReaderUtils.kt
│ │ │ ├── JsonWriterUtils.kt
│ │ │ ├── adapters
│ │ │ └── salesforce
│ │ │ │ ├── CompositeGraphRequest.kt
│ │ │ │ ├── CompositeGraphResponse.kt
│ │ │ │ ├── CompositeResponse.kt
│ │ │ │ └── Constants.kt
│ │ │ └── factories
│ │ │ └── DiMorphicAdapter.kt
│ │ ├── internal
│ │ ├── exe
│ │ │ ├── ExeUtils.kt
│ │ │ ├── HttpRequest.kt
│ │ │ ├── PmJsEval.kt
│ │ │ ├── PostStepHook.kt
│ │ │ ├── PreStepHook.kt
│ │ │ ├── UnmarshallRequest.kt
│ │ │ └── UnmarshallResponse.kt
│ │ ├── json
│ │ │ ├── MoshiReVoman.kt
│ │ │ ├── adapters
│ │ │ │ ├── BigDecimalAdapter.kt
│ │ │ │ ├── EpochAdapter.kt
│ │ │ │ ├── TypeAdapter.kt
│ │ │ │ └── UUIDAdapter.kt
│ │ │ └── factories
│ │ │ │ ├── AlwaysSerializeNullsFactory.kt
│ │ │ │ ├── CaseInsensitiveEnumAdapter.kt
│ │ │ │ └── IgnoreTypesFactory.kt
│ │ └── postman
│ │ │ ├── DynamicVariableGenerator.kt
│ │ │ ├── PostmanSDK.kt
│ │ │ ├── RegexReplacer.kt
│ │ │ └── template
│ │ │ ├── Auth.kt
│ │ │ ├── Environment.kt
│ │ │ └── Template.kt
│ │ └── output
│ │ ├── ExeType.kt
│ │ ├── Rundown.kt
│ │ ├── postman
│ │ └── PostmanEnvironment.kt
│ │ └── report
│ │ ├── Step.kt
│ │ ├── StepReport.kt
│ │ ├── TxnInfo.kt
│ │ └── failure
│ │ ├── ExeFailure.kt
│ │ ├── HookFailure.kt
│ │ ├── HttpStatusUnsuccessful.kt
│ │ ├── RequestFailure.kt
│ │ └── ResponseFailure.kt
└── resources
│ └── log4j2.xml
└── test
├── java
└── com
│ └── salesforce
│ └── revoman
│ ├── input
│ └── json
│ │ ├── JsonPojoUtilsTest.java
│ │ ├── adapters
│ │ └── SObjectGraphRequestMarshaller.java
│ │ └── pojo
│ │ └── SObjectGraphRequest.java
│ └── output
│ └── postman
│ └── PostmanEnvironmentTest.java
├── kotlin
└── com
│ └── salesforce
│ └── revoman
│ ├── input
│ ├── EvalJsTest.kt
│ ├── FileUtilsTest.kt
│ └── config
│ │ └── KickTest.kt
│ ├── internal
│ ├── ExeUtilsTest.kt
│ └── postman
│ │ └── RegexReplacerTest.kt
│ └── output
│ └── report
│ ├── PostmanEnvironmentKtTest.kt
│ ├── StepReportTest.kt
│ └── TxnInfoTest.kt
└── resources
├── composite
├── graph
│ ├── req
│ │ └── graph-request.json
│ └── resp
│ │ ├── graph-response-error.json
│ │ └── graph-response-success.json
└── query
│ └── resp
│ ├── query-response-all-error.json
│ ├── query-response-all-success.json
│ └── query-response-partial-success.json
├── env-from-revoman.json
├── env-with-regex.json
├── json
├── nested-bean.json
└── pq-graph-req-masked.json
└── pm-templates
├── steps-with-folders.json
└── steps-without-folders.postman_collection.json
/.asciidoctor/docinfo.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
21 |
--------------------------------------------------------------------------------
/.asciidoctorconfig:
--------------------------------------------------------------------------------
1 | :experimental:
2 | :linkcss:
3 | :docinfodir: {asciidoctorconfigdir}/.asciidoctor
4 | :docinfo: shared
5 | :icons: font
6 | ifdef::env-github[]
7 | :tip-caption: :bulb:
8 | :note-caption: :information_source:
9 | :important-caption: :heavy_exclamation_mark:
10 | :caution-caption: :fire:
11 | :warning-caption: :warning:
12 | endif::[]
13 | :listing-caption: Snippet
14 | :sectnums:
15 | :source-linenums-option:
16 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: 'Build and Scan'
2 | on: push
3 | jobs:
4 | gradle:
5 | runs-on: ubuntu-latest
6 | steps:
7 | - uses: actions/checkout@v4
8 | - uses: actions/setup-java@v4
9 | with:
10 | distribution: jetbrains
11 | java-version: 17
12 |
13 | - name: 'Setup Gradle'
14 | uses: gradle/gradle-build-action@v3
15 |
16 | - name: 'Gradle test'
17 | run: ./gradlew test integrationTest --tests com.salesforce.revoman.integration.pokemon.PokemonTest
18 |
--------------------------------------------------------------------------------
/.idea/GitLink.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/cody_history.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/.idea/copyright/oss_sf.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/detekt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/git_toolbox_blame.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/git_toolbox_prj.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/.idea/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/salesforce-misc/ReVoman/8465cb048ddc3ef1404b8ef414b5a18528e5e8cc/.idea/icon.png
--------------------------------------------------------------------------------
/.idea/kotlin-statistics.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/ktfmt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("@rules_java//java:defs.bzl", "java_import")
2 |
3 | package(default_visibility = ["//visibility:public"])
4 |
5 | java_import(
6 | name = "com_salesforce_revoman_revoman",
7 | jars = glob(
8 | ["build/libs/revoman-root-*.jar"],
9 | allow_empty = False,
10 | ),
11 | srcjar = glob(
12 | ["build/libs/revoman-root-*-sources.jar"],
13 | allow_empty = False,
14 | )[0],
15 | )
16 |
--------------------------------------------------------------------------------
/CODEOWNERS:
--------------------------------------------------------------------------------
1 | #GUSINFO:Rev Delphinus,Rev Delphinus Trust
2 | *
3 | # Comment line immediately above ownership line is reserved for related other information. Please be careful while editing.
4 | #ECCN:Open Source 5D002
5 | @overfullstack
6 |
--------------------------------------------------------------------------------
/CONTRIBUTING.adoc:
--------------------------------------------------------------------------------
1 | = Contributing
2 | Gopal S Akshintala
3 | :Revision: 1.0
4 | ifdef::env-github[]
5 | :tip-caption: :bulb:
6 | :note-caption: :information_source:
7 | :important-caption: :heavy_exclamation_mark:
8 | :caution-caption: :fire:
9 | :warning-caption: :warning:
10 | endif::[]
11 | :icons: font
12 | ifdef::env-github[]
13 | :tip-caption: :bulb:
14 | :note-caption: :information_source:
15 | :important-caption: :heavy_exclamation_mark:
16 | :caution-caption: :fire:
17 | :warning-caption: :warning:
18 | endif::[]
19 | :hide-uri-scheme:
20 | :sourcedir: src/main/java
21 | :imagesdir: images
22 | :toc:
23 |
24 | == Source-code Setup
25 |
26 | === Install Java
27 |
28 | It needs JDK 17 installed in your system.
29 | Recommendation is to do it via https://sdkman.io/install[SDKMAN].
30 | After you install SDKMAN,
31 | run `sdk list java` -> Pick Identifier for your favorite java distribution -> Run `sdk install java `
32 | to install Java. For example:
33 |
34 | [source,bash]
35 | ----
36 | sdk install java 17.0.14-amzn
37 | ----
38 |
39 | === Build with Gradle
40 |
41 | This is a simple Gradle project and has its own Gradle wrapper. Nothing to install, run just this command:
42 |
43 | [source,bash]
44 | ----
45 | ./gradlew clean build
46 | ----
47 |
48 | TIP: You *don't* need a local Gradle installation as the `gradlew` (Gradle wrapper) takes care of everything. But if you wish to install Gradle locally, the recommendation is to do it via https://sdkman.io/install[SDKMAN]. After you install SDKMAN, run `sdk install gradle` to install Gradle
49 |
50 | You can run/debug the existing unit tests or write your own to play with the tool.
51 |
52 | === Kotlin
53 |
54 | * The code-base is a mix of Java and Kotlin.
55 | If you're a Java developer and new to Kotlin, don't worry, Kotlin is a JVM language and can be used anywhere Java is used.
56 | In fact, it has got the reputation of *"Better Java!"*.
57 | * A typical Java developer can ramp up on Kotlin in less than a week. These resources can help catalyze your ramp-up:
58 | ** https://www.coursera.org/learn/kotlin-for-java-developers[*Kotlin for Java Developers | Coursera*], a free course
59 | ** https://www.kotlinprimer.com/[The Kotlin Primer], tailor-made to facilitate Kotlin adoption inside Java-centric organizations
60 | * If you use Intellij, Kotlin plugin comes bundled.
61 | Similar development aids should be present for other code editors too.
62 |
63 | == Code Formatting
64 |
65 | This repo uses https://github.com/diffplug/spotless[*Spotless*] for formatting files. Please run `./gradlew spotlessApply` before check-in to fix any formatting errors.
66 |
67 | TIP: If you're on Intellij, replace your kbd:[Cmd+Shift+L] habit with kbd:[Ctrl]-kbd:[Ctrl]
68 | and run `./gradlew spotlessApply` (Or the respective action if you're on VS Code/Eclipse).
69 | It may be slow for the first run, but subsequent runs should be faster.
70 |
71 | == Manual publishing
72 |
73 | === Versioning Strategy
74 |
75 | ====
76 | ..
77 | ====
78 |
79 | * A = Broke something on purpose (Breaking API change)
80 | * B = Profit (Feature / Improvement)
81 | * C = Broke something by accident (Bug)
82 |
83 | Follow the Versioning Strategy to increment version link:buildSrc/{sourcedir}/Config.kt[here]
84 |
85 | * For SNAPSHOT releases, add a `-SNAPSHOT` at the end of version number
86 | * Run this command to publish it to Nexus:
87 |
88 | [source,bash]
89 | ----
90 | ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -Dorg.gradle.parallel=false --no-configuration-cache
91 | ----
92 |
93 | * You can monitor for the new version jar to reflect in link:https://repo1.maven.org/maven2/com/salesforce/revoman/revoman/[Maven Central]. It usually takes less than 30 minutes.
94 |
95 | == Code of Conduct
96 | Please follow our link:CODE_OF_CONDUCT.md[Code of Conduct]
97 |
98 | == License
99 | By contributing your code,
100 | you agree to license your contribution under the terms of our project link:LICENSE[]
101 | and to sign the https://cla.salesforce.com/sign-cla[Salesforce CLA]
102 |
--------------------------------------------------------------------------------
/MODULE.bazel:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Bazel now uses Bzlmod by default to manage external dependencies.
3 | # Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel.
4 | #
5 | # For more details, please check https://github.com/bazelbuild/bazel/issues/18958
6 | ###############################################################################
7 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | ## Security
2 |
3 | Please report any security issue to [security@salesforce.com](mailto:security@salesforce.com)
4 | as soon as it is discovered. This library limits its runtime dependencies in
5 | order to reduce the total cost of ownership as much as can be, but all consumers
6 | should remain vigilant and have their security stakeholders review all third-party
7 | products (3PP) like this one and their dependencies.
8 |
--------------------------------------------------------------------------------
/WORKSPACE:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/salesforce-misc/ReVoman/8465cb048ddc3ef1404b8ef414b5a18528e5e8cc/WORKSPACE
--------------------------------------------------------------------------------
/build.gradle.kts:
--------------------------------------------------------------------------------
1 | /**
2 | * ************************************************************************************************
3 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier: Apache License
4 | * Version 2.0 For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * ************************************************************************************************
7 | */
8 | plugins {
9 | id("revoman.root-conventions")
10 | id("revoman.publishing-conventions")
11 | id("revoman.kt-conventions")
12 | alias(libs.plugins.moshix)
13 | alias(libs.plugins.node.gradle)
14 | alias(libs.plugins.kover)
15 | alias(libs.plugins.nexus.publish)
16 | alias(libs.plugins.gradle.taskinfo)
17 | }
18 |
19 | val mockitoAgent = configurations.create("mockitoAgent")
20 |
21 | dependencies {
22 | api(platform(libs.http4k.bom))
23 | api(libs.bundles.http4k)
24 | api(libs.moshix.adapters)
25 | api(libs.java.vavr)
26 | api(libs.kotlin.vavr)
27 | api(libs.arrow.core)
28 | api(libs.kotlinx.datetime)
29 | implementation(libs.bundles.kotlin.logging)
30 | implementation(libs.pprint)
31 | implementation(libs.graal.js)
32 | implementation(libs.kotlin.faker)
33 | implementation(libs.underscore)
34 | implementation(libs.okio.jvm)
35 | implementation(libs.spring.beans)
36 | kapt(libs.immutables.value)
37 | compileOnly(libs.immutables.builder)
38 | compileOnly(libs.immutables.value.annotations)
39 | compileOnly(libs.jetbrains.annotations)
40 | testImplementation(libs.truth)
41 | testImplementation(libs.json.assert)
42 | mockitoAgent(libs.mockito.core) { isTransitive = false }
43 | testImplementation(libs.mockk)
44 | }
45 |
46 | testing {
47 | suites {
48 | val test by getting(JvmTestSuite::class) { useJUnitJupiter(libs.versions.junit.get()) }
49 |
50 | register("integrationTest") {
51 | dependencies {
52 | implementation(project())
53 | implementation(libs.truth)
54 | implementation(libs.mockito.core)
55 | implementation(libs.spring.beans)
56 | implementation(libs.json.assert)
57 | implementation(libs.assertj.vavr)
58 | }
59 | }
60 | }
61 | }
62 |
63 | node { nodeProjectDir = file("${project.projectDir}/js") }
64 |
65 | tasks {
66 | check { dependsOn(npmInstall) }
67 | test { dependsOn(npmInstall) }
68 | }
69 |
70 | kover { reports { total { html { onCheck = true } } } }
71 |
72 | moshi { enableSealed = true }
73 |
74 | nexusPublishing { this.repositories { sonatype { stagingProfileId = STAGING_PROFILE_ID } } }
75 |
--------------------------------------------------------------------------------
/buildSrc/build.gradle.kts:
--------------------------------------------------------------------------------
1 | /**
2 | * ************************************************************************************************
3 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier: Apache License
4 | * Version 2.0 For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * ************************************************************************************************
7 | */
8 | plugins { `kotlin-dsl` }
9 |
10 | repositories {
11 | mavenCentral()
12 | gradlePluginPortal()
13 | maven("https://oss.sonatype.org/content/repositories/snapshots")
14 | }
15 |
16 | dependencies {
17 | implementation(libs.kotlin.gradle)
18 | implementation(libs.spotless.gradle)
19 | implementation(libs.detekt.gradle)
20 | implementation(libs.testLogger.gradle)
21 | }
22 |
--------------------------------------------------------------------------------
/buildSrc/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | /**
2 | * ************************************************************************************************
3 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier: Apache License
4 | * Version 2.0 For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * ************************************************************************************************
7 | */
8 | dependencyResolutionManagement {
9 | versionCatalogs { create("libs") { from(files("../libs.versions.toml")) } }
10 |
11 | pluginManagement {
12 | repositories {
13 | mavenCentral()
14 | gradlePluginPortal()
15 | google()
16 | maven("https://s01.oss.sonatype.org/content/repositories/snapshots")
17 | maven("https://oss.sonatype.org/content/repositories/snapshots")
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/buildSrc/src/main/kotlin/Config.kt:
--------------------------------------------------------------------------------
1 | /**
2 | * ************************************************************************************************
3 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier: Apache License
4 | * Version 2.0 For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * ************************************************************************************************
7 | */
8 | const val GROUP_ID = "com.salesforce.revoman"
9 | const val VERSION = "0.8.0"
10 | const val ARTIFACT_ID = "revoman"
11 | const val STAGING_PROFILE_ID = "1ea0a23e61ba7d"
12 |
--------------------------------------------------------------------------------
/buildSrc/src/main/kotlin/preDef.kt:
--------------------------------------------------------------------------------
1 | /**
2 | * ************************************************************************************************
3 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier: Apache License
4 | * Version 2.0 For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * ************************************************************************************************
7 | */
8 | import org.gradle.api.artifacts.ExternalModuleDependencyBundle
9 | import org.gradle.api.artifacts.VersionCatalog
10 | import org.gradle.api.artifacts.VersionConstraint
11 | import org.gradle.api.provider.Property
12 | import org.gradle.api.provider.Provider
13 | import org.gradle.plugin.use.PluginDependency
14 |
15 | val Provider.pluginId: String
16 | get() = get().pluginId
17 |
18 | infix fun Property.by(value: T) {
19 | set(value)
20 | }
21 |
22 | internal val VersionCatalog.jdk: VersionConstraint
23 | get() = getVersion("jdk")
24 |
25 | internal val VersionCatalog.kotestBundle: Provider
26 | get() = getBundle("kotest")
27 |
28 | private fun VersionCatalog.getLibrary(library: String) = findLibrary(library).get()
29 |
30 | private fun VersionCatalog.getBundle(bundle: String) = findBundle(bundle).get()
31 |
32 | private fun VersionCatalog.getPlugin(plugin: String) = findPlugin(plugin).get()
33 |
34 | private fun VersionCatalog.getVersion(plugin: String) = findVersion(plugin).get()
35 |
--------------------------------------------------------------------------------
/buildSrc/src/main/kotlin/revoman.kt-conventions.gradle.kts:
--------------------------------------------------------------------------------
1 | /**
2 | * ************************************************************************************************
3 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier: Apache License
4 | * Version 2.0 For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * ************************************************************************************************
7 | */
8 | plugins {
9 | kotlin("jvm")
10 | kotlin("kapt")
11 | }
12 |
13 | val libs: VersionCatalog = extensions.getByType().named("libs")
14 |
15 | dependencies { testImplementation(libs.kotestBundle) }
16 |
17 | kapt {
18 | useBuildCache = true
19 | }
20 |
21 | kotlin {
22 | jvmToolchain(libs.jdk.toString().toInt())
23 | compilerOptions {
24 | freeCompilerArgs.addAll("-Xjvm-default=all", "-Xcontext-receivers", "-Xconsistent-data-class-copy-visibility", "-Xmulti-dollar-interpolation")
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/buildSrc/src/main/kotlin/revoman.publishing-conventions.gradle.kts:
--------------------------------------------------------------------------------
1 | /**
2 | * ************************************************************************************************
3 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier: Apache License
4 | * Version 2.0 For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * ************************************************************************************************
7 | */
8 |
9 | plugins {
10 | `maven-publish`
11 | signing
12 | `java-library`
13 | }
14 |
15 | group = GROUP_ID
16 |
17 | version = VERSION
18 |
19 | description = "ReVoman - A template-driven API automation tool for JVM (Java/Kotlin)"
20 |
21 | repositories { mavenCentral() }
22 |
23 | java {
24 | withJavadocJar()
25 | withSourcesJar()
26 | }
27 |
28 | publishing {
29 | publications.create("revoman") {
30 | artifactId = ARTIFACT_ID
31 | from(components["java"])
32 | pom {
33 | name.set("revoman")
34 | description.set(project.description)
35 | url.set("https://github.com/salesforce-misc/ReVoman")
36 | inceptionYear.set("2023")
37 | licenses {
38 | license {
39 | name.set("The Apache License, Version 2.0")
40 | url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
41 | }
42 | }
43 | developers {
44 | developer {
45 | id.set("overfullstack")
46 | name.set("Gopal S Akshintala")
47 | email.set("gopalakshintala@gmail.com")
48 | }
49 | }
50 | scm {
51 | connection.set("scm:git:https://github.com/salesforce-misc/ReVoman")
52 | developerConnection.set("scm:git:git@github.com/salesforce-misc/ReVoman.git")
53 | url.set("https://github.com/salesforce-misc/ReVoman")
54 | }
55 | }
56 | }
57 | }
58 |
59 | signing { sign(publishing.publications["revoman"]) }
60 |
61 | tasks {
62 | javadoc {
63 | // TODO 22/05/21 gopala.akshintala: Turn this on after writing all javadocs
64 | isFailOnError = false
65 | options.encoding("UTF-8")
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/buildSrc/src/main/kotlin/revoman.root-conventions.gradle.kts:
--------------------------------------------------------------------------------
1 | /**
2 | * ************************************************************************************************
3 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier: Apache License
4 | * Version 2.0 For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * ************************************************************************************************
7 | */
8 | import com.adarshr.gradle.testlogger.theme.ThemeType.MOCHA
9 | import com.diffplug.spotless.LineEnding.PLATFORM_NATIVE
10 | import com.diffplug.spotless.extra.wtp.EclipseWtpFormatterStep.XML
11 | import io.gitlab.arturbosch.detekt.Detekt
12 |
13 | plugins {
14 | id("com.diffplug.spotless")
15 | id("io.gitlab.arturbosch.detekt")
16 | id("com.adarshr.test-logger")
17 | }
18 |
19 | version = VERSION
20 |
21 | group = GROUP_ID
22 |
23 | description = "ReVoman - A Template-driven API automation tool for JVM (Java/Kotlin)"
24 |
25 | repositories {
26 | mavenCentral()
27 | maven("https://oss.sonatype.org/content/repositories/snapshots")
28 | }
29 |
30 | spotless {
31 | lineEndings = PLATFORM_NATIVE
32 | kotlin {
33 | ktfmt().googleStyle()
34 | target("src/*/kotlin/**/*.kt", "src/*/java/**/*.kt")
35 | trimTrailingWhitespace()
36 | endWithNewline()
37 | targetExclude("build/**", ".gradle/**", "generated/**", "bin/**", "out/**", "tmp/**")
38 | }
39 | kotlinGradle {
40 | ktfmt().googleStyle()
41 | trimTrailingWhitespace()
42 | endWithNewline()
43 | targetExclude("build/**", ".gradle/**", "generated/**", "bin/**", "out/**", "tmp/**")
44 | }
45 | java {
46 | toggleOffOn()
47 | target("src/*/java/**/*.java")
48 | importOrder()
49 | removeUnusedImports()
50 | googleJavaFormat()
51 | trimTrailingWhitespace()
52 | leadingSpacesToTabs(2)
53 | endWithNewline()
54 | targetExclude("build/**", ".gradle/**", "generated/**", "bin/**", "out/**", "tmp/**")
55 | }
56 | format("documentation") {
57 | target("*.md", "*.adoc")
58 | trimTrailingWhitespace()
59 | leadingSpacesToTabs(2)
60 | endWithNewline()
61 | }
62 | }
63 |
64 | detekt {
65 | parallel = true
66 | buildUponDefaultConfig = true
67 | baseline = file("$rootDir/detekt/baseline.xml")
68 | config.setFrom(file("$rootDir/detekt/config.yml"))
69 | }
70 |
71 | testlogger.theme = MOCHA
72 |
73 | tasks.withType().configureEach { reports { xml.required.set(true) } }
74 |
--------------------------------------------------------------------------------
/detekt/baseline.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | TooManyFunctions:ResponseConfig.kt$ResponseConfig$Companion
5 | TooManyFunctions:PostmanEnvironment.kt$PostmanEnvironment<ValueT : Any?> : MutableMap
6 | TooManyFunctions:ExeUtils.kt$com.salesforce.revoman.internal.exe.ExeUtils.kt
7 | LongMethod:ReVoman.kt$ReVoman$private fun executeStepsSerially( pmStepsFlattened: List<Pair<Step, Item>>, kick: Kick, moshiReVoman: MoshiReVoman, ): List<StepReport>
8 | SpreadOperator:Step.kt$Step$(*FOLDER_DELIMITER.toCharArray())
9 | SpreadOperator:CaseInsensitiveEnumAdapter.kt$CaseInsensitiveEnumAdapter$(*nameStrings.toTypedArray())
10 | TooManyFunctions:JsonWriterUtils.kt$com.salesforce.revoman.input.json.JsonWriterUtils.kt
11 | TooManyFunctions:JsonReaderUtils.kt$com.salesforce.revoman.input.json.JsonReaderUtils.kt
12 | TooManyFunctions:KickDef.kt$KickDef
13 | MagicNumber:Constants.kt$400
14 | MagicNumber:Constants.kt$499
15 | MagicNumber:Constants.kt$200
16 | MagicNumber:Constants.kt$299
17 | FunctionNaming:RestfulAPIDevKtTest.kt$RestfulAPIDevKtTest$@Test fun `execute restful-api dev pm collection`()
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/detekt/config.yml:
--------------------------------------------------------------------------------
1 | build:
2 | maxIssues: 999
3 | comments:
4 | active: false
5 | style:
6 | MaxLineLength:
7 | active: false
8 |
--------------------------------------------------------------------------------
/docs/images/cognitive-complexity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/salesforce-misc/ReVoman/8465cb048ddc3ef1404b8ef414b5a18528e5e8cc/docs/images/cognitive-complexity.png
--------------------------------------------------------------------------------
/docs/images/failure-hierarchy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/salesforce-misc/ReVoman/8465cb048ddc3ef1404b8ef414b5a18528e5e8cc/docs/images/failure-hierarchy.png
--------------------------------------------------------------------------------
/docs/images/hybrid-tool.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/salesforce-misc/ReVoman/8465cb048ddc3ef1404b8ef414b5a18528e5e8cc/docs/images/hybrid-tool.png
--------------------------------------------------------------------------------
/docs/images/manual-to-automation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/salesforce-misc/ReVoman/8465cb048ddc3ef1404b8ef414b5a18528e5e8cc/docs/images/manual-to-automation.png
--------------------------------------------------------------------------------
/docs/images/mutable-env.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/salesforce-misc/ReVoman/8465cb048ddc3ef1404b8ef414b5a18528e5e8cc/docs/images/mutable-env.png
--------------------------------------------------------------------------------
/docs/images/node_modules.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/salesforce-misc/ReVoman/8465cb048ddc3ef1404b8ef414b5a18528e5e8cc/docs/images/node_modules.png
--------------------------------------------------------------------------------
/docs/images/postman-run.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/salesforce-misc/ReVoman/8465cb048ddc3ef1404b8ef414b5a18528e5e8cc/docs/images/postman-run.png
--------------------------------------------------------------------------------
/docs/images/pq-exe-logging.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/salesforce-misc/ReVoman/8465cb048ddc3ef1404b8ef414b5a18528e5e8cc/docs/images/pq-exe-logging.gif
--------------------------------------------------------------------------------
/docs/images/pq-revoman-test-time.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/salesforce-misc/ReVoman/8465cb048ddc3ef1404b8ef414b5a18528e5e8cc/docs/images/pq-revoman-test-time.png
--------------------------------------------------------------------------------
/docs/images/resfulapi-dev-pm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/salesforce-misc/ReVoman/8465cb048ddc3ef1404b8ef414b5a18528e5e8cc/docs/images/resfulapi-dev-pm.png
--------------------------------------------------------------------------------
/docs/images/revoman-demo-thumbnail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/salesforce-misc/ReVoman/8465cb048ddc3ef1404b8ef414b5a18528e5e8cc/docs/images/revoman-demo-thumbnail.png
--------------------------------------------------------------------------------
/docs/images/rundown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/salesforce-misc/ReVoman/8465cb048ddc3ef1404b8ef414b5a18528e5e8cc/docs/images/rundown.png
--------------------------------------------------------------------------------
/docs/images/step-procedure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/salesforce-misc/ReVoman/8465cb048ddc3ef1404b8ef414b5a18528e5e8cc/docs/images/step-procedure.png
--------------------------------------------------------------------------------
/docs/images/step-report.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/salesforce-misc/ReVoman/8465cb048ddc3ef1404b8ef414b5a18528e5e8cc/docs/images/step-report.png
--------------------------------------------------------------------------------
/docs/release-notes/revoman-2.0.adoc:
--------------------------------------------------------------------------------
1 | = Key Features
2 |
3 | * Core compatibility
4 | ** Persona-based user creation and test-utils to recalculate PSG
5 | ** Async operation Support
6 | * Pre- / Post-Hooks can be configured for each step, which can act as callbacks, especially useful for Async operations
7 | * Enhance Input config
8 | ** Add parameters like runOnlyStep, skipSteps, haltOnAnyErrorExceptSteps etc.
9 | * Enhance variable support
10 | ** Custom Dynamic variables for use cases like Parametric testing
11 | ** Add Recursive variable support both for Template and Environment
12 | ** Add more dynamic variables like $epoch, $randomFutureDate etc.
13 | * Enhance JS support for Test scripts.
14 | * Enhance error handling
15 | * Step name is represented through its full folder path
16 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | ####################################################################################################
2 | # Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier:
3 | # Apache License Version 2.0
4 | # For full license text, see the LICENSE file in the repo root or
5 | # http://www.apache.org/licenses/LICENSE-2.0
6 | ####################################################################################################
7 |
8 | org.gradle.parallel=true
9 | org.gradle.caching=true
10 | org.gradle.configuration-cache=true
11 | org.gradle.configuration-cache.parallel=true
12 | org.gradle.configuration-cache.problems=warn
13 | org.gradle.jvmargs=-XX:+UseParallelGC
14 |
15 | moshix.generateProguardRules=false
16 |
17 | kapt.classloaders.cache.size=1
18 | kapt.include.compile.classpath=false
19 | kapt.incremental.apt=false
20 | kapt.use.k2=true
21 |
22 | kotest.framework.classpath.scanning.autoscan.disable=true
23 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/salesforce-misc/ReVoman/8465cb048ddc3ef1404b8ef414b5a18528e5e8cc/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 | @rem SPDX-License-Identifier: Apache-2.0
17 | @rem
18 |
19 | @if "%DEBUG%"=="" @echo off
20 | @rem ##########################################################################
21 | @rem
22 | @rem Gradle startup script for Windows
23 | @rem
24 | @rem ##########################################################################
25 |
26 | @rem Set local scope for the variables with windows NT shell
27 | if "%OS%"=="Windows_NT" setlocal
28 |
29 | set DIRNAME=%~dp0
30 | if "%DIRNAME%"=="" set DIRNAME=.
31 | @rem This is normally unused
32 | set APP_BASE_NAME=%~n0
33 | set APP_HOME=%DIRNAME%
34 |
35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
37 |
38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
40 |
41 | @rem Find java.exe
42 | if defined JAVA_HOME goto findJavaFromJavaHome
43 |
44 | set JAVA_EXE=java.exe
45 | %JAVA_EXE% -version >NUL 2>&1
46 | if %ERRORLEVEL% equ 0 goto execute
47 |
48 | echo. 1>&2
49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50 | echo. 1>&2
51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52 | echo location of your Java installation. 1>&2
53 |
54 | goto fail
55 |
56 | :findJavaFromJavaHome
57 | set JAVA_HOME=%JAVA_HOME:"=%
58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
59 |
60 | if exist "%JAVA_EXE%" goto execute
61 |
62 | echo. 1>&2
63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64 | echo. 1>&2
65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66 | echo location of your Java installation. 1>&2
67 |
68 | goto fail
69 |
70 | :execute
71 | @rem Setup the command line
72 |
73 | set CLASSPATH=
74 |
75 |
76 | @rem Execute Gradle
77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
78 |
79 | :end
80 | @rem End local scope for the variables with windows NT shell
81 | if %ERRORLEVEL% equ 0 goto mainEnd
82 |
83 | :fail
84 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
85 | rem the _cmd.exe /c_ return code!
86 | set EXIT_CODE=%ERRORLEVEL%
87 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
88 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
89 | exit /b %EXIT_CODE%
90 |
91 | :mainEnd
92 | if "%OS%"=="Windows_NT" endlocal
93 |
94 | :omega
95 |
--------------------------------------------------------------------------------
/js/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "js",
3 | "lockfileVersion": 3,
4 | "requires": true,
5 | "packages": {
6 | "": {
7 | "dependencies": {
8 | "events": "^3.3.0",
9 | "lodash": "^4.17.21",
10 | "moment": "2.30.1",
11 | "stream": "^0.0.3",
12 | "timers": "^0.1.1",
13 | "xml2js": "^0.6.2"
14 | }
15 | },
16 | "node_modules/component-emitter": {
17 | "version": "2.0.0",
18 | "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-2.0.0.tgz",
19 | "integrity": "sha512-4m5s3Me2xxlVKG9PkZpQqHQR7bgpnN7joDMJ4yvVkVXngjoITG76IaZmzmywSeRTeTpc6N6r3H3+KyUurV8OYw==",
20 | "license": "MIT",
21 | "engines": {
22 | "node": ">=18"
23 | },
24 | "funding": {
25 | "url": "https://github.com/sponsors/sindresorhus"
26 | }
27 | },
28 | "node_modules/events": {
29 | "version": "3.3.0",
30 | "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",
31 | "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==",
32 | "license": "MIT",
33 | "engines": {
34 | "node": ">=0.8.x"
35 | }
36 | },
37 | "node_modules/lodash": {
38 | "version": "4.17.21",
39 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
40 | "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
41 | "license": "MIT"
42 | },
43 | "node_modules/moment": {
44 | "version": "2.30.1",
45 | "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz",
46 | "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==",
47 | "license": "MIT",
48 | "engines": {
49 | "node": "*"
50 | }
51 | },
52 | "node_modules/sax": {
53 | "version": "1.4.1",
54 | "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz",
55 | "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==",
56 | "license": "ISC"
57 | },
58 | "node_modules/stream": {
59 | "version": "0.0.3",
60 | "resolved": "https://registry.npmjs.org/stream/-/stream-0.0.3.tgz",
61 | "integrity": "sha512-aMsbn7VKrl4A2T7QAQQbzgN7NVc70vgF5INQrBXqn4dCXN1zy3L9HGgLO5s7PExmdrzTJ8uR/27aviW8or8/+A==",
62 | "license": "MIT",
63 | "dependencies": {
64 | "component-emitter": "^2.0.0"
65 | }
66 | },
67 | "node_modules/timers": {
68 | "version": "0.1.1",
69 | "resolved": "https://registry.npmjs.org/timers/-/timers-0.1.1.tgz",
70 | "integrity": "sha512-pkJC8uIP/gxDHxNQUBUbjHyl6oZfT+ofn7tbaHW+CFIUjI+Q2MBbHcx1JSBQfhDaTcO9bNg328q0i7Vk5PismQ==",
71 | "license": "MIT"
72 | },
73 | "node_modules/xml2js": {
74 | "version": "0.6.2",
75 | "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz",
76 | "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==",
77 | "license": "MIT",
78 | "dependencies": {
79 | "sax": ">=0.6.0",
80 | "xmlbuilder": "~11.0.0"
81 | },
82 | "engines": {
83 | "node": ">=4.0.0"
84 | }
85 | },
86 | "node_modules/xmlbuilder": {
87 | "version": "11.0.1",
88 | "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
89 | "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
90 | "license": "MIT",
91 | "engines": {
92 | "node": ">=4.0"
93 | }
94 | }
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/js/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "events": "^3.3.0",
4 | "lodash": "^4.17.21",
5 | "moment": "2.30.1",
6 | "stream": "^0.0.3",
7 | "timers": "^0.1.1",
8 | "xml2js": "^0.6.2"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/qodana.yaml:
--------------------------------------------------------------------------------
1 | #-------------------------------------------------------------------------------#
2 | # Qodana analysis is configured by qodana.yaml file #
3 | # https://www.jetbrains.com/help/qodana/qodana-yaml.html #
4 | #-------------------------------------------------------------------------------#
5 | version: "1.0"
6 |
7 | #Specify inspection profile for code analysis
8 | profile:
9 | name: qodana.recommended
10 |
11 | #Enable inspections
12 | #include:
13 | # - name:
14 |
15 | #Disable inspections
16 | exclude:
17 | - name: DataClassPrivateConstructor
18 | - name: UnusedSymbol
19 | # paths:
20 | # -
21 |
22 | projectJDK: '11' #(Applied in CI/CD pipeline)
23 |
24 | #Execute shell command before Qodana execution (Applied in CI/CD pipeline)
25 | #bootstrap: |+
26 | # update-alternatives --list java
27 | # java --version
28 | # ./gradlew kaptKotlin
29 |
30 | #Install IDE plugins before Qodana execution (Applied in CI/CD pipeline)
31 | #plugins:
32 | # - id: #(plugin id can be found at https://plugins.jetbrains.com)
33 |
34 | #Specify Qodana linter for analysis (Applied in CI/CD pipeline)
35 | linter: jetbrains/qodana-jvm:latest
36 |
37 |
--------------------------------------------------------------------------------
/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | "config:recommended"
4 | ],
5 | "automerge": true,
6 | "commitBodyTable": true,
7 | "packageRules": [
8 | {
9 | "matchUpdateTypes": [
10 | "major",
11 | "minor",
12 | "patch"
13 | ],
14 | "groupName": "all dependencies",
15 | "groupSlug": "all"
16 | },
17 | {
18 | "matchPackageNames": [
19 | "org.graalvm.sdk:graal-sdk",
20 | "org.graalvm.js:js",
21 | "org.http4k:http4k-bom",
22 | "org.http4k:http4k-core",
23 | "org.http4k:http4k-client-apache",
24 | "org.http4k:http4k-format-moshi"
25 | ],
26 | "enabled": false
27 | }
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | /**
2 | * ************************************************************************************************
3 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier: Apache License
4 | * Version 2.0 For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * ************************************************************************************************
7 | */
8 | plugins { id("com.gradle.develocity") version "4.0.2" }
9 |
10 | dependencyResolutionManagement {
11 | versionCatalogs { create("libs") { from(files("libs.versions.toml")) } }
12 | pluginManagement {
13 | repositories {
14 | mavenCentral()
15 | gradlePluginPortal()
16 | google()
17 | maven("https://s01.oss.sonatype.org/content/repositories/snapshots")
18 | maven("https://oss.sonatype.org/content/repositories/snapshots")
19 | }
20 | }
21 | }
22 |
23 | val isCI = !System.getenv("CI").isNullOrEmpty()
24 |
25 | develocity {
26 | buildScan {
27 | publishing.onlyIf {
28 | it.buildResult.failures.isNotEmpty() && !System.getenv("CI").isNullOrEmpty()
29 | }
30 | uploadInBackground.set(!isCI)
31 | termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use"
32 | termsOfUseAgree = "yes"
33 | }
34 | }
35 |
36 | rootProject.name = "revoman-root"
37 |
--------------------------------------------------------------------------------
/src/integrationTest/java/com/salesforce/revoman/integration/core/adapters/IDAdapter.java:
--------------------------------------------------------------------------------
1 | /***************************************************************************************************
2 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier:
3 | * Apache License Version 2.0
4 | * For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | **************************************************************************************************/
7 |
8 | package com.salesforce.revoman.integration.core.adapters;
9 |
10 | import com.salesforce.revoman.integration.core.pq.connect.response.ID;
11 | import com.squareup.moshi.FromJson;
12 | import com.squareup.moshi.ToJson;
13 |
14 | // * NOTE 10 Mar 2024 gopala.akshintala: Custom Type Adapter
15 | public class IDAdapter {
16 | public static final IDAdapter INSTANCE = new IDAdapter();
17 |
18 | @FromJson
19 | ID fromJson(String id) {
20 | return new ID(id);
21 | }
22 |
23 | @ToJson
24 | String toJson(ID id) {
25 | return id.id();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/integrationTest/java/com/salesforce/revoman/integration/core/bt2bs/MilestoneBillingE2ETest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2025 salesforce.com, inc.
3 | * All Rights Reserved
4 | * Company Confidential
5 | */
6 |
7 | package com.salesforce.revoman.integration.core.bt2bs;
8 |
9 | import static com.google.common.truth.Truth.assertThat;
10 | import static com.salesforce.revoman.integration.core.bt2bs.ReVomanConfigForBT2BS.MILESTONE_CONFIG;
11 | import static com.salesforce.revoman.integration.core.bt2bs.ReVomanConfigForBT2BS.MILESTONE_SETUP_CONFIG;
12 | import static com.salesforce.revoman.integration.core.bt2bs.ReVomanConfigForBT2BS.PERSONA_CREATION_AND_SETUP_CONFIG;
13 |
14 | import com.salesforce.revoman.ReVoman;
15 | import java.util.Map;
16 | import kotlin.collections.CollectionsKt;
17 | import org.junit.jupiter.api.Test;
18 |
19 | class MilestoneBillingE2ETest {
20 |
21 | @Test
22 | void testMilestoneBillingE2E() {
23 | final var mbRundown =
24 | ReVoman.revUp(
25 | (rundown, ignore) ->
26 | assertThat(rundown.firstUnIgnoredUnsuccessfulStepReport()).isNull(),
27 | PERSONA_CREATION_AND_SETUP_CONFIG,
28 | MILESTONE_SETUP_CONFIG,
29 | MILESTONE_CONFIG);
30 | assertThat(CollectionsKt.last(mbRundown).mutableEnv)
31 | .containsAtLeastEntriesIn(
32 | Map.of(
33 | "billingMilestonePlan1Status", "Completely Billed",
34 | "billingMilestonePlanItem1Status", "Invoiced",
35 | "billingSchedule1Status", "CompletelyBilled",
36 | "invoice1Status", "Posted",
37 | "invoice2Status", "Posted"));
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/integrationTest/java/com/salesforce/revoman/integration/core/bt2bs/ReVomanConfigForBT2BS.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2025 salesforce.com, inc.
3 | * All Rights Reserved
4 | * Company Confidential
5 | */
6 |
7 | package com.salesforce.revoman.integration.core.bt2bs;
8 |
9 | import static com.salesforce.revoman.input.config.HookConfig.post;
10 | import static com.salesforce.revoman.input.config.StepPick.PostTxnStepPick.afterStepContainingHeader;
11 | import static com.salesforce.revoman.input.config.StepPick.PostTxnStepPick.afterStepContainingURIPathOfAny;
12 | import static com.salesforce.revoman.integration.core.CoreUtils.ASSERT_COMPOSITE_GRAPH_RESPONSE_SUCCESS;
13 | import static com.salesforce.revoman.integration.core.CoreUtils.ASSERT_COMPOSITE_RESPONSE_SUCCESS;
14 | import static com.salesforce.revoman.integration.core.CoreUtils.unmarshallCompositeGraphResponse;
15 | import static com.salesforce.revoman.integration.core.CoreUtils.unmarshallCompositeResponse;
16 | import static com.salesforce.revoman.output.ExeType.HTTP_STATUS;
17 |
18 | import com.salesforce.revoman.input.config.HookConfig;
19 | import com.salesforce.revoman.input.config.Kick;
20 | import com.salesforce.revoman.integration.core.adapters.IDAdapter;
21 |
22 | public final class ReVomanConfigForBT2BS {
23 |
24 | private ReVomanConfigForBT2BS() {}
25 |
26 | static final String ENV_PATH = "pm-templates/core/milestone/env.postman_environment.json";
27 | static final String IGNORE_HTTP_STATUS_UNSUCCESSFUL = "ignoreHTTPStatusUnsuccessful";
28 | static final String NODE_MODULE_RELATIVE_PATH = "js";
29 |
30 | // ## User creation and Setup
31 | static final String COLLECTION_PATH = "pm-templates/core/milestone/";
32 | private static final String PERSONA_CREATION_AND_SETUP_COLLECTION_PATH =
33 | COLLECTION_PATH + "persona-creation-and-setup.postman_collection.json";
34 | static final Kick PERSONA_CREATION_AND_SETUP_CONFIG =
35 | Kick.configure()
36 | .templatePath(PERSONA_CREATION_AND_SETUP_COLLECTION_PATH)
37 | .environmentPath(ENV_PATH)
38 | .responseConfig(unmarshallCompositeGraphResponse(), unmarshallCompositeResponse())
39 | .hooks(ASSERT_COMPOSITE_GRAPH_RESPONSE_SUCCESS, ASSERT_COMPOSITE_RESPONSE_SUCCESS)
40 | .nodeModulesPath(NODE_MODULE_RELATIVE_PATH)
41 | .haltOnFailureOfTypeExcept(
42 | HTTP_STATUS, afterStepContainingHeader(IGNORE_HTTP_STATUS_UNSUCCESSFUL))
43 | .insecureHttp(true)
44 | .off();
45 |
46 | // ## Hooks
47 | static final String PST = "connect/rev/sales-transaction/actions/place";
48 | static final String STANDALONE_INVOICE_IA =
49 | "commerce/invoicing/invoices/collection/actions/generate";
50 | static final String ASSETIZE_IA = "actions/standard/createOrUpdateAssetFromOrder";
51 | static final String AMEND_API = "connect/revenue-management/assets/actions/amend";
52 | static final String CANCEL_API = "connect/revenue-management/assets/actions/cancel";
53 | public static final HookConfig MEMQ_AWAIT =
54 | post(
55 | afterStepContainingURIPathOfAny(
56 | PST, STANDALONE_INVOICE_IA, ASSETIZE_IA, AMEND_API, CANCEL_API),
57 | (ignore1, ignore2) -> Thread.sleep(5000));
58 |
59 | // ## Milestone Setup Config
60 | private static final String MB_SETUP_POSTMAN_COLLECTION_PATH =
61 | COLLECTION_PATH + "milestone-setup.postman_collection.json";
62 | static final Kick MILESTONE_SETUP_CONFIG =
63 | Kick.configure()
64 | .templatePath(MB_SETUP_POSTMAN_COLLECTION_PATH)
65 | .haltOnFailureOfTypeExcept(
66 | HTTP_STATUS, afterStepContainingHeader(IGNORE_HTTP_STATUS_UNSUCCESSFUL))
67 | .responseConfig(unmarshallCompositeGraphResponse(), unmarshallCompositeResponse())
68 | .hooks(ASSERT_COMPOSITE_GRAPH_RESPONSE_SUCCESS, ASSERT_COMPOSITE_RESPONSE_SUCCESS)
69 | .haltOnFailureOfTypeExcept(
70 | HTTP_STATUS, afterStepContainingHeader(IGNORE_HTTP_STATUS_UNSUCCESSFUL))
71 | .globalCustomTypeAdapter(IDAdapter.INSTANCE)
72 | .nodeModulesPath(NODE_MODULE_RELATIVE_PATH)
73 | .off();
74 |
75 | // ## Milestone Config
76 | private static final String MB_POSTMAN_COLLECTION_PATH =
77 | COLLECTION_PATH + "bmp-create-runtime.postman_collection.json";
78 | static final Kick MILESTONE_CONFIG =
79 | Kick.configure()
80 | .templatePath(MB_POSTMAN_COLLECTION_PATH)
81 | .responseConfig(unmarshallCompositeGraphResponse(), unmarshallCompositeResponse())
82 | .hooks(
83 | MEMQ_AWAIT,
84 | ASSERT_COMPOSITE_GRAPH_RESPONSE_SUCCESS,
85 | ASSERT_COMPOSITE_RESPONSE_SUCCESS)
86 | .haltOnFailureOfTypeExcept(
87 | HTTP_STATUS, afterStepContainingHeader(IGNORE_HTTP_STATUS_UNSUCCESSFUL))
88 | .globalCustomTypeAdapter(IDAdapter.INSTANCE)
89 | .nodeModulesPath(NODE_MODULE_RELATIVE_PATH)
90 | .off();
91 | }
92 |
--------------------------------------------------------------------------------
/src/integrationTest/java/com/salesforce/revoman/integration/core/pq/connect/request/ConnectInputRepresentationWithGraph.java:
--------------------------------------------------------------------------------
1 | /***************************************************************************************************
2 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier:
3 | * Apache License Version 2.0
4 | * For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | **************************************************************************************************/
7 |
8 | package com.salesforce.revoman.integration.core.pq.connect.request;
9 |
10 | public interface ConnectInputRepresentationWithGraph {
11 |
12 | void setGraph(ObjectGraphInputRepresentation graph);
13 |
14 | ObjectGraphInputRepresentation getGraph();
15 | }
16 |
--------------------------------------------------------------------------------
/src/integrationTest/java/com/salesforce/revoman/integration/core/pq/connect/request/ObjectGraphInputRepresentation.java:
--------------------------------------------------------------------------------
1 | /***************************************************************************************************
2 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier:
3 | * Apache License Version 2.0
4 | * For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | **************************************************************************************************/
7 |
8 | package com.salesforce.revoman.integration.core.pq.connect.request;
9 |
10 | public class ObjectGraphInputRepresentation {
11 |
12 | private String graphId;
13 |
14 | private ObjectWithReferenceInputRepresentationList records;
15 |
16 | private boolean isSetGraphId;
17 | private boolean isSetRecords;
18 |
19 | public String getGraphId() {
20 | return this.graphId;
21 | }
22 |
23 | public void setGraphId(String graphId) {
24 | this.graphId = graphId;
25 | this.isSetGraphId = true;
26 | }
27 |
28 | public ObjectWithReferenceInputRepresentationList getRecords() {
29 | return this.records;
30 | }
31 |
32 | public void setRecords(ObjectWithReferenceInputRepresentationList records) {
33 | this.records = records;
34 | this.isSetRecords = true;
35 | }
36 |
37 | public boolean _isSetGraphId() {
38 | return this.isSetGraphId;
39 | }
40 |
41 | public boolean _isSetRecords() {
42 | return this.isSetRecords;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/integrationTest/java/com/salesforce/revoman/integration/core/pq/connect/request/ObjectInputRepresentationMap.java:
--------------------------------------------------------------------------------
1 | /***************************************************************************************************
2 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier:
3 | * Apache License Version 2.0
4 | * For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | **************************************************************************************************/
7 |
8 | package com.salesforce.revoman.integration.core.pq.connect.request;
9 |
10 | import java.util.HashMap;
11 | import java.util.Map;
12 |
13 | public class ObjectInputRepresentationMap {
14 |
15 | private Map recordBody;
16 | private boolean isSetRecordBody;
17 |
18 | public ObjectInputRepresentationMap() {
19 | this.recordBody = new HashMap<>();
20 | }
21 |
22 | public Map getRecordBody() {
23 | return this.recordBody;
24 | }
25 |
26 | public void setRecordBody(Map recordBody) {
27 | this.recordBody = recordBody;
28 | this.isSetRecordBody = true;
29 | }
30 |
31 | public boolean _isSetRecordBody() {
32 | return this.isSetRecordBody;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/integrationTest/java/com/salesforce/revoman/integration/core/pq/connect/request/ObjectWithReferenceInputRepresentation.java:
--------------------------------------------------------------------------------
1 | /***************************************************************************************************
2 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier:
3 | * Apache License Version 2.0
4 | * For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | **************************************************************************************************/
7 |
8 | package com.salesforce.revoman.integration.core.pq.connect.request;
9 |
10 | public class ObjectWithReferenceInputRepresentation {
11 |
12 | private String referenceId;
13 | private ObjectInputRepresentationMap record;
14 |
15 | private boolean isSetReferenceId;
16 | private boolean isSetRecord;
17 |
18 | public ObjectInputRepresentationMap getRecord() {
19 | return this.record;
20 | }
21 |
22 | public void setRecord(ObjectInputRepresentationMap record) {
23 | this.record = record;
24 | this.isSetRecord = true;
25 | }
26 |
27 | public String getReferenceId() {
28 | return this.referenceId;
29 | }
30 |
31 | public void setReferenceId(String referenceId) {
32 | this.referenceId = referenceId;
33 | this.isSetReferenceId = true;
34 | }
35 |
36 | public boolean _isSetRecord() {
37 | return this.isSetRecord;
38 | }
39 |
40 | public boolean _isSetReferenceId() {
41 | return this.isSetReferenceId;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/integrationTest/java/com/salesforce/revoman/integration/core/pq/connect/request/ObjectWithReferenceInputRepresentationList.java:
--------------------------------------------------------------------------------
1 | /***************************************************************************************************
2 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier:
3 | * Apache License Version 2.0
4 | * For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | **************************************************************************************************/
7 |
8 | package com.salesforce.revoman.integration.core.pq.connect.request;
9 |
10 | import java.util.ArrayList;
11 | import java.util.List;
12 |
13 | public class ObjectWithReferenceInputRepresentationList {
14 |
15 | private List recordsList;
16 | private boolean isSetRecordsList;
17 |
18 | public ObjectWithReferenceInputRepresentationList() {
19 | super();
20 | this.recordsList = new ArrayList<>();
21 | }
22 |
23 | public List getRecordsList() {
24 | return this.recordsList;
25 | }
26 |
27 | public void setRecordsList(List recordsList) {
28 | this.recordsList = recordsList;
29 | this.isSetRecordsList = true;
30 | }
31 |
32 | public boolean _isSetRecordsList() {
33 | return this.isSetRecordsList;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/integrationTest/java/com/salesforce/revoman/integration/core/pq/connect/request/PlaceQuoteInputRepresentation.java:
--------------------------------------------------------------------------------
1 | /***************************************************************************************************
2 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier:
3 | * Apache License Version 2.0
4 | * For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | **************************************************************************************************/
7 |
8 | package com.salesforce.revoman.integration.core.pq.connect.request;
9 |
10 | public class PlaceQuoteInputRepresentation implements ConnectInputRepresentationWithGraph {
11 |
12 | private PricingPreferenceEnum pricingPref;
13 | private Boolean doAsync;
14 | private ObjectGraphInputRepresentation graph;
15 | private boolean isSetGraph;
16 |
17 | public Boolean getDoAsync() {
18 | return doAsync;
19 | }
20 |
21 | public ObjectGraphInputRepresentation getGraph() {
22 | return this.graph;
23 | }
24 |
25 | public void setGraph(ObjectGraphInputRepresentation graph) {
26 | this.graph = graph;
27 | this.isSetGraph = true;
28 | }
29 |
30 | public boolean _isSetGraph() {
31 | return this.isSetGraph;
32 | }
33 |
34 | private boolean isSetPricingPref;
35 |
36 | private boolean isSetDoAsync;
37 |
38 | public PricingPreferenceEnum getPricingPref() {
39 | return pricingPref;
40 | }
41 |
42 | public void setPricingPref(PricingPreferenceEnum pricingPref) {
43 | this.pricingPref = pricingPref;
44 | this.isSetPricingPref = true;
45 | }
46 |
47 | public void setDoAsync(Boolean doAsync) {
48 | this.doAsync = doAsync;
49 | this.isSetDoAsync = true;
50 | }
51 |
52 | public boolean _isSetPricingPref() {
53 | return this.isSetPricingPref;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/integrationTest/java/com/salesforce/revoman/integration/core/pq/connect/request/PricingPreferenceEnum.java:
--------------------------------------------------------------------------------
1 | /***************************************************************************************************
2 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier:
3 | * Apache License Version 2.0
4 | * For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | **************************************************************************************************/
7 |
8 | package com.salesforce.revoman.integration.core.pq.connect.request;
9 |
10 | public enum PricingPreferenceEnum {
11 | Force,
12 | Skip,
13 | System;
14 | }
15 |
--------------------------------------------------------------------------------
/src/integrationTest/java/com/salesforce/revoman/integration/core/pq/connect/response/ID.java:
--------------------------------------------------------------------------------
1 | /***************************************************************************************************
2 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier:
3 | * Apache License Version 2.0
4 | * For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | **************************************************************************************************/
7 |
8 | package com.salesforce.revoman.integration.core.pq.connect.response;
9 |
10 | public record ID(String id) {}
11 |
--------------------------------------------------------------------------------
/src/integrationTest/java/com/salesforce/revoman/integration/core/pq/connect/response/PlaceQuoteErrorResponseRepresentation.java:
--------------------------------------------------------------------------------
1 | /***************************************************************************************************
2 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier:
3 | * Apache License Version 2.0
4 | * For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | **************************************************************************************************/
7 |
8 | package com.salesforce.revoman.integration.core.pq.connect.response;
9 |
10 | public class PlaceQuoteErrorResponseRepresentation {
11 | private final String referenceId;
12 | private final String errorCode;
13 | private final String message;
14 |
15 | public PlaceQuoteErrorResponseRepresentation(
16 | final String referenceId, final String errorCode, final String message) {
17 | super();
18 | this.referenceId = referenceId;
19 | this.errorCode = errorCode;
20 | this.message = message;
21 | }
22 |
23 | public String getMessage() {
24 | return message;
25 | }
26 |
27 | public String getErrorCode() {
28 | return errorCode;
29 | }
30 |
31 | public String getReferenceId() {
32 | return referenceId;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/integrationTest/java/com/salesforce/revoman/integration/core/pq/connect/response/PlaceQuoteOutputRepresentation.java:
--------------------------------------------------------------------------------
1 | /***************************************************************************************************
2 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier:
3 | * Apache License Version 2.0
4 | * For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | **************************************************************************************************/
7 |
8 | package com.salesforce.revoman.integration.core.pq.connect.response;
9 |
10 | import java.util.List;
11 |
12 | public class PlaceQuoteOutputRepresentation {
13 | private final String requestIdentifier;
14 | private String statusURL;
15 | private final ID quoteId;
16 | private final Boolean success;
17 | private final List responseError;
18 |
19 | public PlaceQuoteOutputRepresentation(
20 | String requestIdentifier,
21 | String statusURL,
22 | ID quoteId,
23 | Boolean success,
24 | List responseError) {
25 | super();
26 | this.requestIdentifier = requestIdentifier;
27 | this.statusURL = statusURL;
28 | this.success = success;
29 | this.responseError = responseError;
30 | this.quoteId = quoteId;
31 | }
32 |
33 | public String getRequestIdentifier() {
34 | return this.requestIdentifier;
35 | }
36 |
37 | public String getStatusURL() {
38 | return this.statusURL;
39 | }
40 |
41 | public void setStatusURL(String statusURL) {
42 | this.statusURL = statusURL;
43 | }
44 |
45 | public Boolean getSuccess() {
46 | return this.success;
47 | }
48 |
49 | public List getResponseError() {
50 | return this.responseError;
51 | }
52 |
53 | public ID getQuoteId() {
54 | return quoteId;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/integrationTest/java/com/salesforce/revoman/integration/restfulapidev/RestfulAPIDevTest.java:
--------------------------------------------------------------------------------
1 | /***************************************************************************************************
2 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier:
3 | * Apache License Version 2.0
4 | * For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | **************************************************************************************************/
7 |
8 | package com.salesforce.revoman.integration.restfulapidev;
9 |
10 | import static com.google.common.truth.Truth.assertThat;
11 |
12 | import com.salesforce.revoman.ReVoman;
13 | import com.salesforce.revoman.input.config.Kick;
14 | import org.junit.jupiter.api.DisplayName;
15 | import org.junit.jupiter.api.Test;
16 |
17 | class RestfulAPIDevTest {
18 | private static final String PM_COLLECTION_PATH =
19 | "pm-templates/restfulapidev/restful-api.dev.postman_collection.json";
20 | private static final String PM_ENVIRONMENT_PATH =
21 | "pm-templates/restfulapidev/restful-api.dev.postman_environment.json";
22 |
23 | // tag::revoman-simple-demo[]
24 | @Test
25 | @DisplayName("restful-api.dev")
26 | void restfulApiDev() {
27 | final var rundown =
28 | ReVoman.revUp( // <1>
29 | Kick.configure()
30 | .templatePath(PM_COLLECTION_PATH) // <2>
31 | .environmentPath(PM_ENVIRONMENT_PATH) // <3>
32 | .nodeModulesPath("js")
33 | .off());
34 | assertThat(rundown.firstUnIgnoredUnsuccessfulStepReport()).isNull(); // <4>
35 | assertThat(rundown.stepReports).hasSize(4); // <5>
36 | }
37 | // end::revoman-simple-demo[]
38 | }
39 |
--------------------------------------------------------------------------------
/src/integrationTest/kotlin/com/salesforce/revoman/integration/apigee/ApigeeKtTest.kt:
--------------------------------------------------------------------------------
1 | /**
2 | * ************************************************************************************************
3 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier: Apache License
4 | * Version 2.0 For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * ************************************************************************************************
7 | */
8 | package com.salesforce.revoman.integration.apigee
9 |
10 | import com.google.common.truth.Truth.assertThat
11 | import com.salesforce.revoman.ReVoman
12 | import com.salesforce.revoman.input.config.Kick
13 | import org.junit.jupiter.api.Test
14 |
15 | class ApigeeKtTest {
16 | @Test
17 | fun `xml2js apigee`() {
18 | val rundown =
19 | ReVoman.revUp(Kick.configure().templatePath(PM_COLLECTION_PATH).nodeModulesPath("js").off())
20 | assertThat(rundown.stepReports).hasSize(1)
21 | assertThat(rundown.firstUnsuccessfulStepReport).isNull()
22 | assertThat(rundown.mutableEnv["city"]).isEqualTo("San Jose")
23 | }
24 |
25 | companion object {
26 | private const val PM_COLLECTION_PATH = "pm-templates/apigee/apigee.postman_collection.json"
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/integrationTest/kotlin/com/salesforce/revoman/integration/restfulapidev/RestfulAPIDevKtTest.kt:
--------------------------------------------------------------------------------
1 | /**
2 | * ************************************************************************************************
3 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier: Apache License
4 | * Version 2.0 For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * ************************************************************************************************
7 | */
8 | package com.salesforce.revoman.integration.restfulapidev
9 |
10 | import com.google.common.truth.Truth.assertThat
11 | import com.salesforce.revoman.ReVoman
12 | import com.salesforce.revoman.input.config.Kick
13 | import org.junit.jupiter.api.Test
14 |
15 | class RestfulAPIDevKtTest {
16 | @Test
17 | fun `execute restful-api dev pm collection`() {
18 | val rundown =
19 | ReVoman.revUp(
20 | // <1>
21 | Kick.configure()
22 | .templatePath(PM_COLLECTION_PATH) // <2>
23 | .environmentPath(PM_ENVIRONMENT_PATH) // <3>
24 | .nodeModulesPath("js")
25 | .off()
26 | )
27 | assertThat(rundown.firstUnsuccessfulStepReport).isNull()
28 | assertThat(rundown.stepReports).hasSize(4)
29 | }
30 |
31 | companion object {
32 | private const val PM_COLLECTION_PATH =
33 | "pm-templates/restfulapidev/restful-api.dev.postman_collection.json"
34 | private const val PM_ENVIRONMENT_PATH =
35 | "pm-templates/restfulapidev/restful-api.dev.postman_environment.json"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/integrationTest/resources/json/pq-payload.json:
--------------------------------------------------------------------------------
1 | {
2 | "pricingPref" : "System",
3 | "doAsync" : true,
4 | "graph" : {
5 | "graphId" : "pq-create-with-bundles",
6 | "records" : [
7 | {
8 | "referenceId" : "refQuote",
9 | "record" : {
10 | "attributes" : {
11 | "type" : "Quote",
12 | "method" : "POST"
13 | },
14 | "Name" : "Quote_{{$randomCompanyName}}",
15 | "OpportunityId" : "{{opportunityId}}"
16 | }
17 | },
18 | {
19 | "referenceId" : "refQuoteItem1",
20 | "record" : {
21 | "attributes" : {
22 | "type" : "QuoteLineItem",
23 | "method" : "POST"
24 | },
25 | "QuoteId" : "@{refQuote.id}",
26 | "PricebookEntryId" : "{{evergreenPriceBookEntryId}}",
27 | "Product2Id" : "{{evergreenProductId}}",
28 | "Quantity" : 2.0,
29 | "UnitPrice" : 25.0,
30 | "PeriodBoundary" : "Anniversary",
31 | "BillingFrequency" : "Monthly",
32 | "StartDate" : "{{$currentDate}}"
33 | }
34 | },
35 | {
36 | "referenceId" : "refQuoteItem2",
37 | "record" : {
38 | "attributes" : {
39 | "type" : "QuoteLineItem",
40 | "method" : "POST"
41 | },
42 | "QuoteId" : "@{refQuote.id}",
43 | "PricebookEntryId" : "{{termedPriceBookEntryId}}",
44 | "Product2Id" : "{{termedProductId}}",
45 | "Quantity" : 2.0,
46 | "UnitPrice" : 25.0,
47 | "EndDate" : "{{$randomFutureDate}}",
48 | "PeriodBoundary" : "DayOfPeriod",
49 | "PeriodBoundaryDay" : 4,
50 | "BillingFrequency" : "Monthly",
51 | "StartDate" : "{{$currentDate}}"
52 | }
53 | },
54 | {
55 | "referenceId" : "refQuoteItem3",
56 | "record" : {
57 | "attributes" : {
58 | "type" : "QuoteLineItem",
59 | "method" : "POST"
60 | },
61 | "QuoteId" : "@{refQuote.id}",
62 | "PricebookEntryId" : "{{oneTimePriceBookEntryId}}",
63 | "Product2Id" : "{{oneTimeProductId}}",
64 | "Quantity" : 2.0,
65 | "UnitPrice" : 25.0,
66 | "StartDate" : "{{$currentDate}}",
67 | "BillingFrequency" : null,
68 | "PeriodBoundary" : null
69 | }
70 | },
71 | {
72 | "referenceId" : "refQuoteItem4",
73 | "record" : {
74 | "attributes" : {
75 | "type" : "QuoteLineItem",
76 | "method" : "POST"
77 | },
78 | "QuoteId" : "@{refQuote.id}",
79 | "PricebookEntryId" : "{{oneTimePriceBookEntryId}}",
80 | "Product2Id" : "{{oneTimeProductId}}",
81 | "Quantity" : 2.0,
82 | "UnitPrice" : 25.0,
83 | "StartDate" : "{{$currentDate}}"
84 | }
85 | },
86 | {
87 | "referenceId" : "refQLR1",
88 | "record" : {
89 | "attributes" : {
90 | "type" : "QuoteLineRelationship",
91 | "method" : "POST"
92 | },
93 | "MainQuoteLineId" : "@{refQuoteItem1.id}",
94 | "AssociatedQuoteLineId" : "@{refQuoteItem4.id}",
95 | "ProductRelationshipTypeId" : "{{productRelationshipTypeId}}",
96 | "AssociatedQuoteLinePricing" : "IncludedInBundlePrice"
97 | }
98 | }
99 | ]
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/src/integrationTest/resources/json/pq-response.json:
--------------------------------------------------------------------------------
1 | {
2 | "quoteId": "0Q0xx0000004E2mCAE",
3 | "requestIdentifier": "95Txx0000004E60",
4 | "responseError": [],
5 | "statusURL": "/services/data/v58.0/sobjects/RevenueAsyncOperation/95Txx0000004E60EAE",
6 | "success": true
7 | }
--------------------------------------------------------------------------------
/src/integrationTest/resources/json/pricing-pref.json:
--------------------------------------------------------------------------------
1 | {
2 | "pricingPref" : "SYSTEM"
3 | }
4 |
--------------------------------------------------------------------------------
/src/integrationTest/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/integrationTest/resources/pm-templates/apigee/apigee.postman_collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "info": {
3 | "_postman_id": "00262e9b-48de-4d72-bea9-5db5c77029cb",
4 | "name": "Apigee",
5 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
6 | "_exporter_id": "23827434"
7 | },
8 | "item": [
9 | {
10 | "name": "Apigee",
11 | "event": [
12 | {
13 | "listen": "prerequest",
14 | "script": {
15 | "exec": [
16 | ""
17 | ],
18 | "type": "text/javascript",
19 | "packages": {}
20 | }
21 | },
22 | {
23 | "listen": "test",
24 | "script": {
25 | "exec": [
26 | "var xml2js = require('xml2js')",
27 | "xml2js.parseString(pm.response.text(), { explicitArray: false }, (_, jsonResponse) => {",
28 | " let result = jsonResponse.root.city",
29 | " pm.environment.set(\"city\", result)",
30 | "})"
31 | ],
32 | "type": "text/javascript",
33 | "packages": {}
34 | }
35 | }
36 | ],
37 | "request": {
38 | "method": "GET",
39 | "header": [],
40 | "url": {
41 | "raw": "https://mocktarget.apigee.net/xml",
42 | "protocol": "https",
43 | "host": [
44 | "mocktarget",
45 | "apigee",
46 | "net"
47 | ],
48 | "path": [
49 | "xml"
50 | ]
51 | }
52 | },
53 | "response": []
54 | }
55 | ]
56 | }
--------------------------------------------------------------------------------
/src/integrationTest/resources/pm-templates/core/milestone/env.postman_environment.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "eca3a642-ef81-42ae-9e29-e9e5065c2390",
3 | "name": "bt2bs",
4 | "values": [
5 | {
6 | "key" : "baseUrl",
7 | "value" : "https://dlt000005y8w62ai.test1.my.pc-rnd.salesforce.com",
8 | "type" : "default",
9 | "enabled" : true
10 | },
11 | {
12 | "key" : "username",
13 | "value" : "asisrenewal@salesforce.com",
14 | "type" : "default",
15 | "enabled" : true
16 | },
17 | {
18 | "key" : "password",
19 | "value" : "test1234",
20 | "type" : "default",
21 | "enabled" : true
22 | },
23 | {
24 | "key": "commonUserPassword",
25 | "value": "test1234",
26 | "type": "default",
27 | "enabled": true
28 | },
29 | {
30 | "key": "$unitPrice",
31 | "value": "63.00",
32 | "type": "default",
33 | "enabled": true
34 | },
35 | {
36 | "key": "secretToken-admin",
37 | "value": "",
38 | "type": "default",
39 | "enabled": true
40 | },
41 | {
42 | "key": "secretToken",
43 | "value": "",
44 | "type": "default",
45 | "enabled": true
46 | },
47 | {
48 | "key": "secretToken-billingAdmin",
49 | "value": "",
50 | "type": "default",
51 | "enabled": true
52 | },
53 | {
54 | "key": "secretToken-taxAdmin",
55 | "value": "",
56 | "type": "default",
57 | "enabled": true
58 | },
59 | {
60 | "key": "secretToken-productAndPricingAdmin",
61 | "value": "",
62 | "type": "default",
63 | "enabled": true
64 | },
65 | {
66 | "key": "secretToken-salesRep",
67 | "value": "",
68 | "type": "default",
69 | "enabled": true
70 | }
71 | ],
72 | "_postman_variable_scope": "environment",
73 | "_postman_exported_at": "2022-07-28T10:35:45.674Z",
74 | "_postman_exported_using": "Postman/9.20.0-canary"
75 | }
76 |
--------------------------------------------------------------------------------
/src/integrationTest/resources/pm-templates/core/pq/pq-env.postman_environment.json:
--------------------------------------------------------------------------------
1 | {
2 | "id" : "eca3a642-ef81-42ae-9e29-e9e5065c2390",
3 | "name" : "pq",
4 | "values" : [
5 | {
6 | "key" : "baseUrl",
7 | "value" : "https://gopalaaksh-wsl3:6101",
8 | "type" : "default",
9 | "enabled" : true
10 | },
11 | {
12 | "key" : "username",
13 | "value" : "linux-sm@252.org",
14 | "type" : "default",
15 | "enabled" : true
16 | },
17 | {
18 | "key" : "password",
19 | "value" : "123456",
20 | "type" : "default",
21 | "enabled" : true
22 | },
23 | {
24 | "key" : "commonUserPassword",
25 | "value" : "test1234",
26 | "type" : "default",
27 | "enabled" : true
28 | },
29 | {
30 | "key" : "secretToken-admin",
31 | "value" : "",
32 | "type" : "default",
33 | "enabled" : true
34 | },
35 | {
36 | "key" : "secretToken-billingAdmin",
37 | "value" : "",
38 | "type" : "default",
39 | "enabled" : true
40 | },
41 | {
42 | "key" : "secretToken-taxAdmin",
43 | "value" : "",
44 | "type" : "default",
45 | "enabled" : true
46 | },
47 | {
48 | "key" : "secretToken-productAndPricingAdmin",
49 | "value" : "",
50 | "type" : "default",
51 | "enabled" : true
52 | },
53 | {
54 | "key" : "secretToken-salesRep",
55 | "value" : "",
56 | "type" : "default",
57 | "enabled" : true
58 | }
59 | ],
60 | "_postman_variable_scope" : "environment",
61 | "_postman_exported_at" : "2022-07-28T10:35:45.674Z",
62 | "_postman_exported_using" : "Postman/9.20.0-canary"
63 | }
64 |
--------------------------------------------------------------------------------
/src/integrationTest/resources/pm-templates/pokemon/pokemon.postman_environment.json:
--------------------------------------------------------------------------------
1 | {
2 | "id" : "535cddb4-a44b-4237-bf59-f27c334158af",
3 | "name" : "Pokemon",
4 | "values" : [
5 | {
6 | "key" : "baseUrl",
7 | "value" : "https://pokeapi.co/api/v2",
8 | "type" : "default",
9 | "enabled" : true
10 | }
11 | ],
12 | "_postman_variable_scope" : "environment",
13 | "_postman_exported_at" : "2022-03-31T10:46:04.026Z",
14 | "_postman_exported_using" : "Postman/9.12.2-canary"
15 | }
16 |
--------------------------------------------------------------------------------
/src/integrationTest/resources/pm-templates/restfulapidev/restful-api.dev.postman_collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "info": {
3 | "_postman_id": "8e2843e3-f3e9-4c55-a49d-89429fd02a83",
4 | "name": "restful-api.dev",
5 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
6 | "_exporter_id": "23827434"
7 | },
8 | "item": [
9 | {
10 | "name": "all-objects",
11 | "event": [
12 | {
13 | "listen": "prerequest",
14 | "script": {
15 | "exec": [
16 | ""
17 | ],
18 | "type": "text/javascript"
19 | }
20 | }
21 | ],
22 | "request": {
23 | "method": "GET",
24 | "header": [],
25 | "url": {
26 | "raw": "https://{{uri}}/objects",
27 | "protocol": "https",
28 | "host": [
29 | "{{uri}}"
30 | ],
31 | "path": [
32 | "objects"
33 | ]
34 | }
35 | },
36 | "response": []
37 | },
38 | {
39 | "name": "add-object",
40 | "event": [
41 | {
42 | "listen": "test",
43 | "script": {
44 | "exec": [
45 | "var responseJson = pm.response.json();",
46 | "pm.environment.set(\"objId\", responseJson.id);",
47 | "pm.environment.set(\"data\", responseJson.data)",
48 | "pm.environment.set(\"productName\", responseJson.name)"
49 | ],
50 | "type": "text/javascript",
51 | "packages": {}
52 | }
53 | },
54 | {
55 | "listen": "prerequest",
56 | "script": {
57 | "exec": [
58 | "var moment = require('moment')",
59 | "var _ = require('lodash')",
60 | "",
61 | "pm.environment.set(\"$currentYear\", moment().year())",
62 | "pm.environment.set(\"$randomPrice\", _.random(1, 1000))"
63 | ],
64 | "type": "text/javascript",
65 | "packages": {}
66 | }
67 | }
68 | ],
69 | "request": {
70 | "method": "POST",
71 | "header": [],
72 | "body": {
73 | "mode": "raw",
74 | "raw": "{\n \"name\": \"{{$randomProduct}}\", // Dynamic variable\n \"data\": {\n \"year\": {{$currentYear}}, // Variable set via Pre-req\n \"price\": {{$randomPrice}}, // Variable set via Pre-req\n \"CPU model\": null\n }\n}",
75 | "options": {
76 | "raw": {
77 | "language": "json"
78 | }
79 | }
80 | },
81 | "url": {
82 | "raw": "https://{{uri}}/objects",
83 | "protocol": "https",
84 | "host": [
85 | "{{uri}}"
86 | ],
87 | "path": [
88 | "objects"
89 | ]
90 | }
91 | },
92 | "response": []
93 | },
94 | {
95 | "name": "update-object",
96 | "event": [
97 | {
98 | "listen": "test",
99 | "script": {
100 | "exec": [
101 | "var responseJson = pm.response.json();",
102 | "pm.environment.set(\"objId\", responseJson.id);",
103 | "pm.environment.set(\"data\", responseJson.data)"
104 | ],
105 | "type": "text/javascript",
106 | "packages": {}
107 | }
108 | },
109 | {
110 | "listen": "prerequest",
111 | "script": {
112 | "exec": [
113 | "var moment = require('moment')",
114 | "var _ = require('lodash')",
115 | "",
116 | "pm.environment.set(\"$currentYear\", moment().year())",
117 | "pm.environment.set(\"$randomPrice\", _.random(1, 1000))"
118 | ],
119 | "type": "text/javascript",
120 | "packages": {}
121 | }
122 | }
123 | ],
124 | "request": {
125 | "method": "PATCH",
126 | "header": [],
127 | "body": {
128 | "mode": "raw",
129 | "raw": "{\n \"name\": \"updated - {{productName}}\" // Update Name\n}",
130 | "options": {
131 | "raw": {
132 | "language": "json"
133 | }
134 | }
135 | },
136 | "url": {
137 | "raw": "https://{{uri}}/objects/{{objId}}",
138 | "protocol": "https",
139 | "host": [
140 | "{{uri}}"
141 | ],
142 | "path": [
143 | "objects",
144 | "{{objId}}"
145 | ]
146 | }
147 | },
148 | "response": []
149 | },
150 | {
151 | "name": "get-object-by-id",
152 | "event": [
153 | {
154 | "listen": "prerequest",
155 | "script": {
156 | "exec": [
157 | "console.log(pm.environment.get(\"data\"))"
158 | ],
159 | "type": "text/javascript",
160 | "packages": {}
161 | }
162 | }
163 | ],
164 | "request": {
165 | "method": "GET",
166 | "header": [],
167 | "url": {
168 | "raw": "https://{{uri}}/objects/{{objId}}",
169 | "protocol": "https",
170 | "host": [
171 | "{{uri}}"
172 | ],
173 | "path": [
174 | "objects",
175 | "{{objId}}"
176 | ]
177 | }
178 | },
179 | "response": []
180 | }
181 | ]
182 | }
--------------------------------------------------------------------------------
/src/integrationTest/resources/pm-templates/restfulapidev/restful-api.dev.postman_environment.json:
--------------------------------------------------------------------------------
1 | {
2 | "id" : "cf14fd0d-74be-4069-b526-0c89d19c18bc",
3 | "name" : "restful-api.dev",
4 | "values" : [
5 | {
6 | "key" : "uri",
7 | "value" : "api.restful-api.dev",
8 | "type" : "default",
9 | "enabled" : true
10 | }
11 | ],
12 | "_postman_variable_scope" : "environment",
13 | "_postman_exported_at" : "2024-01-19T12:59:06.198Z",
14 | "_postman_exported_using" : "Postman/10.19.15-canary01"
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/kotlin/com/salesforce/revoman/input/FileUtils.kt:
--------------------------------------------------------------------------------
1 | /**
2 | * ************************************************************************************************
3 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier: Apache License
4 | * Version 2.0 For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * ************************************************************************************************
7 | */
8 | @file:JvmName("FileUtils")
9 |
10 | package com.salesforce.revoman.input
11 |
12 | import java.io.File
13 | import java.io.InputStream
14 | import okio.BufferedSource
15 | import okio.FileSystem.Companion.RESOURCES
16 | import okio.FileSystem.Companion.SYSTEM
17 | import okio.Path.Companion.toPath
18 | import okio.buffer
19 | import okio.source
20 |
21 | fun bufferFile(filePath: String): BufferedSource =
22 | filePath.toPath().let { (if (it.isAbsolute) SYSTEM else RESOURCES).source(it).buffer() }
23 |
24 | fun readFileToString(filePath: String): String = bufferFile(filePath).readUtf8()
25 |
26 | fun bufferInputStream(inputStream: InputStream): BufferedSource = inputStream.source().buffer()
27 |
28 | fun readInputStreamToString(inputStream: InputStream): String =
29 | bufferInputStream(inputStream).readUtf8()
30 |
31 | fun bufferFile(file: File): BufferedSource = file.source().buffer()
32 |
33 | fun readFileToString(file: File): String = bufferFile(file).readUtf8()
34 |
35 | fun writeToFile(filePath: String, content: String) =
36 | SYSTEM.write(filePath.toPath()) { writeUtf8(content) }
37 |
--------------------------------------------------------------------------------
/src/main/kotlin/com/salesforce/revoman/input/PostExeHook.kt:
--------------------------------------------------------------------------------
1 | /**
2 | * ************************************************************************************************
3 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier: Apache License
4 | * Version 2.0 For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * ************************************************************************************************
7 | */
8 | package com.salesforce.revoman.input
9 |
10 | import com.salesforce.revoman.output.Rundown
11 |
12 | fun interface PostExeHook {
13 | @Throws(Throwable::class) fun accept(currentRundown: Rundown, rundowns: List)
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/kotlin/com/salesforce/revoman/input/config/HookConfig.kt:
--------------------------------------------------------------------------------
1 | /**
2 | * ************************************************************************************************
3 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier: Apache License
4 | * Version 2.0 For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * ************************************************************************************************
7 | */
8 | package com.salesforce.revoman.input.config
9 |
10 | import com.salesforce.revoman.input.config.HookConfig.StepHook.PostStepHook
11 | import com.salesforce.revoman.input.config.HookConfig.StepHook.PreStepHook
12 | import com.salesforce.revoman.input.config.StepPick.PostTxnStepPick
13 | import com.salesforce.revoman.input.config.StepPick.PreTxnStepPick
14 | import com.salesforce.revoman.output.Rundown
15 | import com.salesforce.revoman.output.report.Step
16 | import com.salesforce.revoman.output.report.StepReport
17 | import com.salesforce.revoman.output.report.TxnInfo
18 | import org.http4k.core.Request
19 |
20 | @ExposedCopyVisibility
21 | data class HookConfig private constructor(val pick: StepPick, val stepHook: StepHook) {
22 | sealed interface StepHook {
23 | fun interface PreStepHook : StepHook {
24 | @Throws(Throwable::class)
25 | fun accept(currentStep: Step, requestInfo: TxnInfo, rundown: Rundown)
26 | }
27 |
28 | fun interface PostStepHook : StepHook {
29 | @Throws(Throwable::class) fun accept(currentStepReport: StepReport, rundown: Rundown)
30 | }
31 | }
32 |
33 | companion object {
34 | @JvmStatic fun pre(pick: PreTxnStepPick, hook: PreStepHook): HookConfig = HookConfig(pick, hook)
35 |
36 | @JvmStatic
37 | fun post(pick: PostTxnStepPick, hook: PostStepHook): HookConfig = HookConfig(pick, hook)
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/kotlin/com/salesforce/revoman/input/config/KickDef.kt:
--------------------------------------------------------------------------------
1 | /**
2 | * ************************************************************************************************
3 | * Copyright (c) 2023, Salesforce, Inc. All rights reserved. SPDX-License-Identifier: Apache License
4 | * Version 2.0 For full license text, see the LICENSE file in the repo root or
5 | * http://www.apache.org/licenses/LICENSE-2.0
6 | * ************************************************************************************************
7 | */
8 | package com.salesforce.revoman.input.config
9 |
10 | import com.salesforce.revoman.input.config.StepPick.ExeStepPick
11 | import com.salesforce.revoman.input.config.StepPick.PostTxnStepPick
12 | import com.salesforce.revoman.input.config.StepPick.PreTxnStepPick
13 | import com.salesforce.revoman.output.ExeType
14 | import com.salesforce.revoman.output.Rundown
15 | import com.salesforce.revoman.output.report.StepReport
16 | import com.squareup.moshi.JsonAdapter
17 | import com.squareup.moshi.JsonAdapter.Factory
18 | import io.vavr.control.Either
19 | import java.io.InputStream
20 | import java.lang.reflect.Type
21 | import java.util.Collections.disjoint
22 | import org.immutables.value.Value
23 | import org.immutables.value.Value.Style.ImplementationVisibility.PUBLIC
24 |
25 | @Config
26 | @Value.Immutable
27 | internal interface KickDef {
28 | // * NOTE 29/10/23 gopala.akshintala: `List` coz it allows adding a template twice,
29 | // as there can be use-cases to execute the same template twice
30 | fun templatePaths(): List
31 |
32 | fun templateInputStreams(): List
33 |
34 | fun environmentPaths(): Set
35 |
36 | fun environmentInputStreams(): List
37 |
38 | fun dynamicEnvironments(): List