Skip to content

Commit b5906e8

Browse files
committed
SpotlessApply
Signed-off-by: Gopal S Akshintala <[email protected]>
1 parent aff0ebc commit b5906e8

25 files changed

+1056
-1060
lines changed

CODE_OF_CONDUCT.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ include:
4444
Examples of unacceptable behavior by participants include:
4545

4646
* The use of sexualized language or imagery and unwelcome sexual attention or
47-
advances
47+
advances
4848
* Personal attacks, insulting/derogatory comments, or trolling
4949
* Public or private harassment
5050
* Publishing, or threatening to publish, others' private information—such as
51-
a physical or electronic address—without explicit permission
51+
a physical or electronic address—without explicit permission
5252
* Other conduct which could reasonably be considered inappropriate in a
53-
professional setting
53+
professional setting
5454
* Advocating for or encouraging any of the above behaviors
5555

5656
## Our Responsibilities

README.adoc

Lines changed: 98 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ Maven
4949
[source,xml,subs=attributes+]
5050
----
5151
<dependency>
52-
<groupId>com.salesforce.revoman</groupId>
53-
<artifactId>revoman</artifactId>
54-
<version>{revoman-version}</version>
52+
<groupId>com.salesforce.revoman</groupId>
53+
<artifactId>revoman</artifactId>
54+
<version>{revoman-version}</version>
5555
</dependency>
5656
----
5757
[.lead]
@@ -130,10 +130,10 @@ supplying your Postman templates and environments, and all your customizations t
130130
[source,java,indent=0,options="nowrap"]
131131
----
132132
final var rundown =
133-
ReVoman.revUp(
134-
Kick.configure()
135-
...
136-
.off())
133+
ReVoman.revUp(
134+
Kick.configure()
135+
...
136+
.off())
137137
----
138138

139139
=== A Simple Example
@@ -156,13 +156,13 @@ ifdef::env-github[]
156156
@Test
157157
@DisplayName("restful-api.dev")
158158
void restfulApiDev() {
159-
final var rundown =
160-
ReVoman.revUp( // <1>
161-
Kick.configure()
162-
.templatePath(PM_COLLECTION_PATH) // <2>
163-
.environmentPath(PM_ENVIRONMENT_PATH) // <3>
164-
.off());
165-
assertThat(rundown.stepReports).hasSize(3); // <4>
159+
final var rundown =
160+
ReVoman.revUp( // <1>
161+
Kick.configure()
162+
.templatePath(PM_COLLECTION_PATH) // <2>
163+
.environmentPath(PM_ENVIRONMENT_PATH) // <3>
164+
.off());
165+
assertThat(rundown.stepReports).hasSize(3); // <4>
166166
}
167167
----
168168
<1> `revUp` is the method to call passing a configuration, built as below
@@ -194,16 +194,16 @@ such that you can seamlessly run more assertions on top of the run.
194194
[source,kotlin,indent=0,options="nowrap"]
195195
----
196196
Rundown(
197-
val stepReports: List<StepReport>,
198-
val mutableEnv: PostmanEnvironment<Any?>)
197+
val stepReports: List<StepReport>,
198+
val mutableEnv: PostmanEnvironment<Any?>)
199199
200200
StepReport(
201-
step: Step,
202-
requestInfo: Either<RequestFailure, TxnInfo<Request>>? = null, // <1>
203-
preStepHookFailure: PreStepHookFailure? = null,
204-
responseInfo: Either<ResponseFailure, TxnInfo<Response>>? = null,
205-
postStepHookFailure: PostStepHookFailure? = null,
206-
envSnapshot: PostmanEnvironment<Any?> // <2>
201+
step: Step,
202+
requestInfo: Either<RequestFailure, TxnInfo<Request>>? = null, // <1>
203+
preStepHookFailure: PreStepHookFailure? = null,
204+
responseInfo: Either<ResponseFailure, TxnInfo<Response>>? = null,
205+
postStepHookFailure: PostStepHookFailure? = null,
206+
envSnapshot: PostmanEnvironment<Any?> // <2>
207207
)
208208
----
209209
<1> https://docs.vavr.io/#_either[`Either` type from the VAVR] library represents either of the two states, error or success
@@ -226,74 +226,74 @@ ifdef::env-github[]
226226
.link:{integrationtestdir}/com/salesforce/revoman/integration/core/pq/PQE2EWithSMTest.java[PQE2EWithSMTest.java, tag=pq-e2e-with-revoman-config-demo]
227227
----
228228
final var pqRundown =
229-
ReVoman.revUp( // <1>
230-
Kick.configure()
231-
.templatePaths(PQ_TEMPLATE_PATHS) // <2>
232-
.environmentPath(PQ_ENV_PATH) // <3>
233-
.dynamicEnvironment( // <4>
234-
Map.of(
235-
"$quoteFieldsToQuery", "LineItemCount, CalculationStatus",
236-
"$qliFieldsToQuery", "Id, Product2Id",
237-
"$qlrFieldsToQuery", "Id, QuoteId, MainQuoteLineId, AssociatedQuoteLineId"))
238-
.customDynamicVariableGenerator( // <5>
239-
"$unitPrice",
240-
(ignore1, ignore2, ignore3) -> String.valueOf(Random.Default.nextInt(999) + 1))
241-
.nodeModulesRelativePath("js") // <6>
242-
.haltOnFailureOfTypeExcept(
243-
HTTP_STATUS,
244-
afterAllStepsContainingHeader("ignoreHTTPStatusUnsuccessful")) // <7>
245-
.requestConfig( // <8>
246-
unmarshallRequest(
247-
beforeStepContainingURIPathOfAny(PQ_URI_PATH),
248-
PlaceQuoteInputRepresentation.class,
249-
adapter(PlaceQuoteInputRepresentation.class)))
250-
.responseConfig( // <9>
251-
unmarshallResponse(
252-
afterStepContainingURIPathOfAny(PQ_URI_PATH),
253-
PlaceQuoteOutputRepresentation.class),
254-
unmarshallResponse(
255-
afterStepContainingURIPathOfAny(COMPOSITE_GRAPH_URI_PATH),
256-
CompositeGraphResponse.class,
257-
CompositeGraphResponse.ADAPTER))
258-
.hooks( // <10>
259-
pre(
260-
beforeStepContainingURIPathOfAny(PQ_URI_PATH),
261-
(step, requestInfo, rundown) -> {
262-
if (requestInfo.containsHeader(IS_SYNC_HEADER)) {
263-
LOGGER.info("This is a Sync step: {}", step);
264-
}
265-
}),
266-
post(
267-
afterStepContainingURIPathOfAny(PQ_URI_PATH),
268-
(stepReport, ignore) -> {
269-
validatePQResponse(stepReport); // <11>
270-
final var isSyncStep =
271-
stepReport.responseInfo.get().containsHeader(IS_SYNC_HEADER);
272-
if (!isSyncStep) {
273-
LOGGER.info(
274-
"Waiting in PostHook of the Async Step: {}, for the Quote's Asynchronous processing to finish",
275-
stepReport.step);
276-
// ! CAUTION 10/09/23 gopala.akshintala: This can be flaky until
277-
// polling is implemented
278-
Thread.sleep(5000);
279-
}
280-
}),
281-
post(
282-
afterStepContainingURIPathOfAny(COMPOSITE_GRAPH_URI_PATH),
283-
(stepReport, ignore) -> validateCompositeGraphResponse(stepReport)),
284-
post(
285-
afterStepName("query-quote-and-related-records"),
286-
(ignore, rundown) -> assertAfterPQCreate(rundown.mutableEnv)))
287-
.globalCustomTypeAdapter(new IDAdapter()) // <12>
288-
.insecureHttp(true) // <13>
289-
.off()); // Kick-off
229+
ReVoman.revUp( // <1>
230+
Kick.configure()
231+
.templatePaths(PQ_TEMPLATE_PATHS) // <2>
232+
.environmentPath(PQ_ENV_PATH) // <3>
233+
.dynamicEnvironment( // <4>
234+
Map.of(
235+
"$quoteFieldsToQuery", "LineItemCount, CalculationStatus",
236+
"$qliFieldsToQuery", "Id, Product2Id",
237+
"$qlrFieldsToQuery", "Id, QuoteId, MainQuoteLineId, AssociatedQuoteLineId"))
238+
.customDynamicVariableGenerator( // <5>
239+
"$unitPrice",
240+
(ignore1, ignore2, ignore3) -> String.valueOf(Random.Default.nextInt(999) + 1))
241+
.nodeModulesRelativePath("js") // <6>
242+
.haltOnFailureOfTypeExcept(
243+
HTTP_STATUS,
244+
afterAllStepsContainingHeader("ignoreHTTPStatusUnsuccessful")) // <7>
245+
.requestConfig( // <8>
246+
unmarshallRequest(
247+
beforeStepContainingURIPathOfAny(PQ_URI_PATH),
248+
PlaceQuoteInputRepresentation.class,
249+
adapter(PlaceQuoteInputRepresentation.class)))
250+
.responseConfig( // <9>
251+
unmarshallResponse(
252+
afterStepContainingURIPathOfAny(PQ_URI_PATH),
253+
PlaceQuoteOutputRepresentation.class),
254+
unmarshallResponse(
255+
afterStepContainingURIPathOfAny(COMPOSITE_GRAPH_URI_PATH),
256+
CompositeGraphResponse.class,
257+
CompositeGraphResponse.ADAPTER))
258+
.hooks( // <10>
259+
pre(
260+
beforeStepContainingURIPathOfAny(PQ_URI_PATH),
261+
(step, requestInfo, rundown) -> {
262+
if (requestInfo.containsHeader(IS_SYNC_HEADER)) {
263+
LOGGER.info("This is a Sync step: {}", step);
264+
}
265+
}),
266+
post(
267+
afterStepContainingURIPathOfAny(PQ_URI_PATH),
268+
(stepReport, ignore) -> {
269+
validatePQResponse(stepReport); // <11>
270+
final var isSyncStep =
271+
stepReport.responseInfo.get().containsHeader(IS_SYNC_HEADER);
272+
if (!isSyncStep) {
273+
LOGGER.info(
274+
"Waiting in PostHook of the Async Step: {}, for the Quote's Asynchronous processing to finish",
275+
stepReport.step);
276+
// ! CAUTION 10/09/23 gopala.akshintala: This can be flaky until
277+
// polling is implemented
278+
Thread.sleep(5000);
279+
}
280+
}),
281+
post(
282+
afterStepContainingURIPathOfAny(COMPOSITE_GRAPH_URI_PATH),
283+
(stepReport, ignore) -> validateCompositeGraphResponse(stepReport)),
284+
post(
285+
afterStepName("query-quote-and-related-records"),
286+
(ignore, rundown) -> assertAfterPQCreate(rundown.mutableEnv)))
287+
.globalCustomTypeAdapter(new IDAdapter()) // <12>
288+
.insecureHttp(true) // <13>
289+
.off()); // Kick-off
290290
assertThat(pqRundown.firstUnIgnoredUnsuccessfulStepReport()).isNull(); // <14>
291291
assertThat(pqRundown.mutableEnv)
292-
.containsAtLeastEntriesIn(
293-
Map.of(
294-
"quoteCalculationStatusForSkipPricing", PricingPref.Skip.completeStatus,
295-
"quoteCalculationStatus", PricingPref.System.completeStatus,
296-
"quoteCalculationStatusAfterAllUpdates", PricingPref.System.completeStatus));
292+
.containsAtLeastEntriesIn(
293+
Map.of(
294+
"quoteCalculationStatusForSkipPricing", PricingPref.Skip.completeStatus,
295+
"quoteCalculationStatus", PricingPref.System.completeStatus,
296+
"quoteCalculationStatusAfterAllUpdates", PricingPref.System.completeStatus));
297297
----
298298
<1> `revUp()` is the method to call passing a configuration, built as below
299299
<2> Supply the path (relative to resources) to the Template Collection JSON file/files
@@ -417,16 +417,16 @@ You can pass a `PreTxnStepPick/PostTxnStepPick` which is a `Predicate` used to q
417417
[source,java,indent=0,options="nowrap"]
418418
----
419419
.hooks(
420-
pre(
421-
PreTxnStepPick,
422-
(currentStepName, requestInfo, rundown) -> {
423-
//...callback-code...
424-
}),
425-
post(
426-
PostTxnStepPick,
427-
(currentStepName, rundown) -> {
428-
//...callback-code...
429-
})
420+
pre(
421+
PreTxnStepPick,
422+
(currentStepName, requestInfo, rundown) -> {
423+
//...callback-code...
424+
}),
425+
post(
426+
PostTxnStepPick,
427+
(currentStepName, rundown) -> {
428+
//...callback-code...
429+
})
430430
)
431431
----
432432

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ tasks {
6262
test { dependsOn(npmInstall) }
6363
}
6464

65-
// kover { reports { total { html { onCheck = true } } } }
65+
kover { reports { total { html { onCheck = true } } } }
6666

6767
moshi { enableSealed = true }
6868

libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ gradle-taskinfo = "2.2.0"
3131
# Common dependencies
3232

3333
junit = "5.11.4"
34-
kover = "0.9.0"
34+
kover = "0.9.1"
3535
detekt = "1.23.7"
3636
spotless = "7.0.1"
3737
apache-log4j = "2.24.0"

0 commit comments

Comments
 (0)