Skip to content

Commit 4aa8e0e

Browse files
committed
- Support for Comments in Body
- Misc fixes Signed-off-by: Gopal S Akshintala <[email protected]>
1 parent 6ea82bc commit 4aa8e0e

File tree

27 files changed

+433
-223
lines changed

27 files changed

+433
-223
lines changed

detekt/baseline.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
<ID>TooManyFunctions:JsonWriterUtils.kt$com.salesforce.revoman.input.json.JsonWriterUtils.kt</ID>
1111
<ID>TooManyFunctions:JsonReaderUtils.kt$com.salesforce.revoman.input.json.JsonReaderUtils.kt</ID>
1212
<ID>TooManyFunctions:KickDef.kt$KickDef</ID>
13+
<ID>MagicNumber:Constants.kt$400</ID>
14+
<ID>MagicNumber:Constants.kt$499</ID>
15+
<ID>MagicNumber:Constants.kt$200</ID>
16+
<ID>MagicNumber:Constants.kt$299</ID>
1317
</ManuallySuppressedIssues>
1418
<CurrentIssues/>
1519
</SmellBaseline>

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ kapt.classloaders.cache.size=1
1818
kapt.include.compile.classpath=false
1919
kapt.incremental.apt=false
2020
kapt.use.k2=true
21+
22+
kotest.framework.classpath.scanning.autoscan.disable=true

src/integrationTest/java/com/salesforce/revoman/integration/core/bt2bs/ReVomanConfigForBT2BS.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ HTTP_STATUS, afterStepContainingHeader(IGNORE_HTTP_STATUS_UNSUCCESSFUL))
6464
HTTP_STATUS, afterStepContainingHeader(IGNORE_HTTP_STATUS_UNSUCCESSFUL))
6565
.responseConfig(unmarshallCompositeGraphResponse())
6666
.hook(ASSERT_COMPOSITE_GRAPH_RESPONSE_SUCCESS)
67+
.haltOnFailureOfTypeExcept(
68+
HTTP_STATUS, afterStepContainingHeader(IGNORE_HTTP_STATUS_UNSUCCESSFUL))
69+
.globalCustomTypeAdapter(IDAdapter.INSTANCE)
6770
.nodeModulesRelativePath(NODE_MODULE_RELATIVE_PATH)
68-
.insecureHttp(true)
6971
.off();
7072

7173
// ## Milestone Config
@@ -76,8 +78,9 @@ HTTP_STATUS, afterStepContainingHeader(IGNORE_HTTP_STATUS_UNSUCCESSFUL))
7678
.templatePath(MB_POSTMAN_COLLECTION_PATH)
7779
.responseConfig(unmarshallCompositeGraphResponse())
7880
.hooks(MEMQ_AWAIT, ASSERT_COMPOSITE_GRAPH_RESPONSE_SUCCESS)
81+
.haltOnFailureOfTypeExcept(
82+
HTTP_STATUS, afterStepContainingHeader(IGNORE_HTTP_STATUS_UNSUCCESSFUL))
7983
.globalCustomTypeAdapter(IDAdapter.INSTANCE)
8084
.nodeModulesRelativePath(NODE_MODULE_RELATIVE_PATH)
81-
.insecureHttp(true)
8285
.off();
8386
}

src/integrationTest/java/com/salesforce/revoman/integration/pokemon/PokemonTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void accept(@NotNull StepReport stepReport, @NotNull Rundown rundown) {
8383
}
8484
});
8585
//noinspection Convert2Lambda
86-
final var preHook =
86+
final var preStepHook =
8787
Mockito.spy(
8888
new PreStepHook() {
8989
@Override
@@ -95,7 +95,7 @@ public void accept(
9595
}
9696
});
9797
//noinspection Convert2Lambda
98-
final var postHook =
98+
final var postStepHook =
9999
Mockito.spy(
100100
new PostStepHook() {
101101
@Override
@@ -133,8 +133,8 @@ public void accept(@NotNull StepReport stepReport, @NotNull Rundown rundown) {
133133
.environmentPath(PM_ENVIRONMENT_PATH)
134134
.responseConfig(unmarshallResponse(afterStepName("all-pokemon"), AllPokemon.class))
135135
.hooks(
136-
pre(beforeStepName("all-pokemon"), preHook),
137-
post(afterStepName("all-pokemon"), postHook),
136+
pre(beforeStepName("all-pokemon"), preStepHook),
137+
post(afterStepName("all-pokemon"), postStepHook),
138138
post(afterStepContainingURIPathOfAny("pokemon-color"), postHookAfterURIPath),
139139
pre(beforeStepContainingHeader("preLog"), preLogHook),
140140
post(afterStepContainingHeader("postLog"), postLogHook))
@@ -156,8 +156,8 @@ public void accept(@NotNull StepReport stepReport, @NotNull Rundown rundown) {
156156
"gender", "female",
157157
"ability", "stench",
158158
"nature", "hardy"));
159-
Mockito.verify(preHook, times(1)).accept(any(), any(), any());
160-
Mockito.verify(postHook, times(1)).accept(any(), any());
159+
Mockito.verify(preStepHook, times(1)).accept(any(), any(), any());
160+
Mockito.verify(postStepHook, times(1)).accept(any(), any());
161161
Mockito.verify(postHookAfterURIPath, times(1)).accept(any(), any());
162162
Mockito.verify(preLogHook, times(1)).accept(any(), any(), any());
163163
Mockito.verify(postLogHook, times(1)).accept(any(), any());

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

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

src/integrationTest/resources/pm-templates/core/milestone/milestone-setup.postman_collection.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
"header": [],
122122
"body": {
123123
"mode": "raw",
124-
"raw": "{\n \"graphs\": [\n {\n \"graphId\": \"1\",\n \"compositeRequest\": [\n {\n \"method\": \"POST\",\n \"url\": \"{{versionPath}}/sobjects/BillingPolicy\",\n \"referenceId\": \"billingPolicy\",\n \"body\": {\n \"Name\": \"ReVoman Billing Policy\",\n \"Status\": \"Draft\",\n \"BillingTreatmentSelection\": \"Default\",\n \"Description\": \"ReVoman Billing Policy\"\n }\n },\n {\n \"method\": \"POST\",\n \"url\": \"{{versionPath}}/sobjects/BillingTreatment\",\n \"referenceId\": \"billingTreatment\",\n \"body\": {\n \"Name\": \"ReVoman Milestone Billing Treatment\",\n \"BillingPolicyId\": \"@{billingPolicy.id}\",\n \"Description\": \"Test Billing Treatment\",\n \"Status\": \"Draft\",\n \"ExcludeFromBilling\": \"No\",\n \"IsMilestoneBilling\": true\n }\n },\n {\n \"method\": \"POST\",\n \"url\": \"{{versionPath}}/sobjects/BillingTreatmentItem\",\n \"referenceId\": \"bti1\",\n \"body\": {\n \"Name\": \"ReVoman Milestone Billing Treatment Item 1\",\n \"Status\": \"Active\",\n \"Sequencing\": \"None\",\n \"ProcessingOrder\": 0,\n \"BillingTreatmentId\": \"@{billingTreatment.id}\",\n \"Description\": \"Test Billing Treatment Item\",\n \"type\": \"Percentage\",\n \"BillingType\": \"None\",\n \"Percentage\": 30,\n \"Controller\": \"None\",\n \"Handling0Amount\": \"None\",\n \"MilestoneType\": \"Date\",\n \"MilestoneStartDate\": \"OrderProductActivation\",\n \"MilestoneStartDateOffset\": 1,\n \"MilestoneStartDateOffsetUnit\": \"Months\"\n }\n },\n {\n \"method\": \"POST\",\n \"url\": \"{{versionPath}}/sobjects/BillingTreatmentItem\",\n \"referenceId\": \"bti2\",\n \"body\": {\n \"Name\": \"ReVoman Milestone Billing Treatment Item 2\",\n \"Status\": \"Active\",\n \"Sequencing\": \"None\",\n \"ProcessingOrder\": 0,\n \"BillingTreatmentId\": \"@{billingTreatment.id}\",\n \"Description\": \"Test Billing Treatment Item\",\n \"type\": \"Percentage\",\n \"BillingType\": \"None\",\n \"Percentage\": 30,\n \"Controller\": \"None\",\n \"Handling0Amount\": \"None\",\n \"MilestoneType\": \"Date\",\n \"MilestoneStartDate\": \"OrderProductActivation\",\n \"MilestoneStartDateOffset\": 2,\n \"MilestoneStartDateOffsetUnit\": \"Months\"\n }\n },\n {\n \"method\": \"POST\",\n \"url\": \"{{versionPath}}/sobjects/BillingTreatmentItem\",\n \"referenceId\": \"bti3\",\n \"body\": {\n \"Name\": \"ReVoman Milestone Billing Treatment Item 3\",\n \"Status\": \"Active\",\n \"Sequencing\": \"None\",\n \"ProcessingOrder\": 0,\n \"BillingTreatmentId\": \"@{billingTreatment.id}\",\n \"Description\": \"Test Billing Treatment Item\",\n \"type\": \"Percentage\",\n \"BillingType\": \"None\",\n \"Percentage\": 30,\n \"Controller\": \"None\",\n \"Handling0Amount\": \"None\",\n \"MilestoneType\": \"Date\",\n \"MilestoneStartDate\": \"OrderProductActivation\",\n \"MilestoneStartDateOffset\": 3,\n \"MilestoneStartDateOffsetUnit\": \"Months\"\n }\n }\n ]\n }\n ]\n}",
124+
"raw": "{\n \"graphs\": [\n {\n \"graphId\": \"1\",\n \"compositeRequest\": [ // BTIs: 30, 30, 30\n {\n \"method\": \"POST\",\n \"url\": \"{{versionPath}}/sobjects/BillingPolicy\",\n \"referenceId\": \"billingPolicy\",\n \"body\": {\n \"Name\": \"ReVoman Billing Policy\",\n \"Status\": \"Draft\",\n \"BillingTreatmentSelection\": \"Default\",\n \"Description\": \"ReVoman Billing Policy\"\n }\n },\n {\n \"method\": \"POST\",\n \"url\": \"{{versionPath}}/sobjects/BillingTreatment\",\n \"referenceId\": \"billingTreatment\",\n \"body\": {\n \"Name\": \"ReVoman Milestone Billing Treatment\",\n \"BillingPolicyId\": \"@{billingPolicy.id}\",\n \"Description\": \"Test Billing Treatment\",\n \"Status\": \"Draft\",\n \"ExcludeFromBilling\": \"No\",\n \"IsMilestoneBilling\": true\n }\n },\n {\n \"method\": \"POST\",\n \"url\": \"{{versionPath}}/sobjects/BillingTreatmentItem\",\n \"referenceId\": \"bti1\",\n \"body\": {\n \"Name\": \"ReVoman Milestone Billing Treatment Item 1\",\n \"Status\": \"Active\",\n \"Sequencing\": \"None\",\n \"ProcessingOrder\": 0,\n \"BillingTreatmentId\": \"@{billingTreatment.id}\",\n \"Description\": \"Test Billing Treatment Item\",\n \"type\": \"Percentage\",\n \"BillingType\": \"None\",\n \"Percentage\": 30,\n \"Controller\": \"None\",\n \"Handling0Amount\": \"None\",\n \"MilestoneType\": \"Date\",\n \"MilestoneStartDate\": \"OrderProductActivation\",\n \"MilestoneStartDateOffset\": 1,\n \"MilestoneStartDateOffsetUnit\": \"Months\"\n }\n },\n {\n \"method\": \"POST\",\n \"url\": \"{{versionPath}}/sobjects/BillingTreatmentItem\",\n \"referenceId\": \"bti2\",\n \"body\": {\n \"Name\": \"ReVoman Milestone Billing Treatment Item 2\",\n \"Status\": \"Active\",\n \"Sequencing\": \"None\",\n \"ProcessingOrder\": 0,\n \"BillingTreatmentId\": \"@{billingTreatment.id}\",\n \"Description\": \"Test Billing Treatment Item\",\n \"type\": \"Percentage\",\n \"BillingType\": \"None\",\n \"Percentage\": 30,\n \"Controller\": \"None\",\n \"Handling0Amount\": \"None\",\n \"MilestoneType\": \"Date\",\n \"MilestoneStartDate\": \"OrderProductActivation\",\n \"MilestoneStartDateOffset\": 2,\n \"MilestoneStartDateOffsetUnit\": \"Months\"\n }\n },\n {\n \"method\": \"POST\",\n \"url\": \"{{versionPath}}/sobjects/BillingTreatmentItem\",\n \"referenceId\": \"bti3\",\n \"body\": {\n \"Name\": \"ReVoman Milestone Billing Treatment Item 3\",\n \"Status\": \"Active\",\n \"Sequencing\": \"None\",\n \"ProcessingOrder\": 0,\n \"BillingTreatmentId\": \"@{billingTreatment.id}\",\n \"Description\": \"Test Billing Treatment Item\",\n \"type\": \"Percentage\",\n \"BillingType\": \"None\",\n \"Percentage\": 30,\n \"Controller\": \"None\",\n \"Handling0Amount\": \"None\",\n \"MilestoneType\": \"Date\",\n \"MilestoneStartDate\": \"OrderProductActivation\",\n \"MilestoneStartDateOffset\": 3,\n \"MilestoneStartDateOffsetUnit\": \"Months\"\n }\n }\n ]\n }\n ]\n}",
125125
"options": {
126126
"raw": {
127127
"language": "json"
@@ -357,7 +357,7 @@
357357
"header": [],
358358
"body": {
359359
"mode": "raw",
360-
"raw": "{\n \"Name\": \"ReVoman OneTime\",\n \"ProductCode\": \"ReVoman OneTime\",\n \"IsActive\": true,\n \"Type\": \"Bundle\",\n \"ConfigureDuringSale\": \"Allowed\",\n \"BillingPolicyId\": \"{{billingPolicyId}}\",\n \"TaxPolicyId\": \"{{taxPolicyId}}\"\n}",
360+
"raw": "{\n \"Name\": \"ReVoman OneTime\",\n \"ProductCode\": \"ReVoman OneTime\",\n \"IsActive\": true,\n \"Type\": \"Bundle\",\n \"ConfigureDuringSale\": \"Allowed\",\n \"BillingPolicyId\": \"{{billingPolicyId}}\",\n \"TaxPolicyId\": \"{{taxPolicyId}}\"\n}",
361361
"options": {
362362
"raw": {
363363
"language": "json"
@@ -414,7 +414,7 @@
414414
],
415415
"body": {
416416
"mode": "raw",
417-
"raw": "{\n \"SellingModelType\": \"OneTime\",\n \"Name\": \"OneTime PSM\",\n \"Status\": \"Active\"\n}",
417+
"raw": "{\n \"SellingModelType\": \"OneTime\",\n \"Name\": \"ReVoman OneTime PSM\",\n \"Status\": \"Active\"\n}",
418418
"options": {
419419
"raw": {
420420
"language": "json"
@@ -493,7 +493,8 @@
493493
"exec": [
494494
""
495495
],
496-
"type": "text/javascript"
496+
"type": "text/javascript",
497+
"packages": {}
497498
}
498499
},
499500
{
@@ -503,7 +504,8 @@
503504
"var jsonData = pm.response.json();",
504505
"pm.environment.set(\"oneTimeSellingModelOptionId\", jsonData.id);"
505506
],
506-
"type": "text/javascript"
507+
"type": "text/javascript",
508+
"packages": {}
507509
}
508510
}
509511
],
@@ -512,7 +514,7 @@
512514
"header": [],
513515
"body": {
514516
"mode": "raw",
515-
"raw": "{\n \"ProductSellingModelId\": \"{{oneTimeProductSellingModelId}}\",\n \"Product2Id\": \"{{oneTimeProductId}}\"\n}\n\n",
517+
"raw": "{\n \"ProductSellingModelId\": \"{{oneTimeProductSellingModelId}}\",\n \"Product2Id\": \"{{oneTimeProductId}}\"\n}",
516518
"options": {
517519
"raw": {
518520
"language": "json"
@@ -564,7 +566,7 @@
564566
"header": [],
565567
"body": {
566568
"mode": "raw",
567-
"raw": "{\n \"ProductSellingModelId\": \"{{oneTimeProductSellingModelId}}\",\n \"Product2Id\": \"{{oneTimeProductId}}\",\n \"IsActive\": true,\n \"Pricebook2Id\": \"{{standardPricebookId}}\",\n \"UnitPrice\": \"{{$unitPrice}}\"\n}",
569+
"raw": "{\n \"ProductSellingModelId\": \"{{oneTimeProductSellingModelId}}\",\n \"Product2Id\": \"{{oneTimeProductId}}\",\n \"IsActive\": true,\n \"Pricebook2Id\": \"{{standardPricebookId}}\",\n \"UnitPrice\": \"{{$unitPrice}}\"\n}",
568570
"options": {
569571
"raw": {
570572
"language": "json"

0 commit comments

Comments
 (0)