Skip to content

Commit 0167ceb

Browse files
committed
Release 0.34.0
- Change in step delimiter to |||> - DiMorphicAdapter - CompositeGraphResponse adapter using DiMorphicAdapter - Extend PQE2EWithSMTest to use CompositeGraphResponse Signed-off-by: Gopal S Akshintala <[email protected]>
1 parent 7829dfd commit 0167ceb

File tree

20 files changed

+5987
-5251
lines changed

20 files changed

+5987
-5251
lines changed

.idea/kotlinc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.adoc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,11 @@ final var pqRundown =
229229
beforeAllStepsWithURIPathEndingWith(PQ_URI_PATH),
230230
PlaceQuoteInputRepresentation.class,
231231
adapter(PlaceQuoteInputRepresentation.class)))
232-
.hooks( // <8>
232+
.responseConfig( // <8>
233+
unmarshallResponse(
234+
afterAllStepsWithURIPathEndingWith(PQ_URI_PATH),
235+
PlaceQuoteOutputRepresentation.class))
236+
.hooks( // <9>
233237
pre(
234238
beforeAllStepsWithURIPathEndingWith(PQ_URI_PATH),
235239
(step, requestInfo, rundown) -> {
@@ -243,7 +247,7 @@ final var pqRundown =
243247
post(
244248
afterAllStepsWithURIPathEndingWith(PQ_URI_PATH),
245249
(stepReport, ignore) -> {
246-
validatePQResponse(stepReport); // <9>
250+
validatePQResponse(stepReport); // <10>
247251
LOGGER.info(
248252
"Waiting in PostHook of the Step: {}, for the Quote's Asynchronous processing to finish",
249253
stepReport.step.displayName);
@@ -254,10 +258,6 @@ final var pqRundown =
254258
post(
255259
afterStepName("query-quote-and-related-records"),
256260
(ignore, rundown) -> assertAfterPQCreate(rundown.mutableEnv)))
257-
.responseConfig( // <10>
258-
unmarshallResponse(
259-
afterAllStepsWithURIPathEndingWith(PQ_URI_PATH),
260-
PlaceQuoteOutputRepresentation.class))
261261
.customAdaptersForMarshalling(new IDAdapter()) // <11>
262262
.insecureHttp(true) // <12>
263263
.off()); // Kick-off
@@ -276,9 +276,9 @@ assertThat(pqRundown.mutableEnv)
276276
<5> <<#_custom-dynamic-variables, Custom dynamic variables>>
277277
<6> <<#_execution_control>>
278278
<7> <<#_type_safety_with_flexible_json_pojo_marshallingserialization_and_unmarshallingdeserialization, Request Config>>
279-
<8> <<#_pre_and_post_hooks>>
280-
<9> <<#_response_validations>>
281-
<10> <<#_type_safety_with_flexible_json_pojo_marshallingserialization_and_unmarshallingdeserialization, Response Config>>
279+
<8> <<#_type_safety_with_flexible_json_pojo_marshallingserialization_and_unmarshallingdeserialization, Response Config>>
280+
<9> <<#_pre_and_post_hooks>>
281+
<10> <<#_response_validations>>
282282
<11> <<#_type_safety_with_flexible_json_pojo_marshallingserialization_and_unmarshallingdeserialization, Custom Adapters>>
283283
<12> Ignore Java cert issues when firing HTTP calls
284284
<13> More assertions on top of <<#_rundown>>
@@ -298,9 +298,9 @@ include::{testdir}/com/salesforce/revoman/integration/core/pq/PQE2EWithSMTest.ja
298298
<5> <<#_custom-dynamic-variables, Custom dynamic variables>>
299299
<6> <<#_execution_control>>
300300
<7> <<#_type_safety_with_flexible_json_pojo_marshallingserialization_and_unmarshallingdeserialization, Request Config>>
301-
<8> <<#_pre_and_post_hooks>>
302-
<9> <<#_response_validations>>
303-
<10> <<#_type_safety_with_flexible_json_pojo_marshallingserialization_and_unmarshallingdeserialization, Response Config>>
301+
<8> <<#_type_safety_with_flexible_json_pojo_marshallingserialization_and_unmarshallingdeserialization, Response Config>>
302+
<9> <<#_pre_and_post_hooks>>
303+
<10> <<#_response_validations>>
304304
<11> <<#_type_safety_with_flexible_json_pojo_marshallingserialization_and_unmarshallingdeserialization, Custom Adapters>>
305305
<12> Ignore Java cert issues when firing HTTP calls
306306
<13> More assertions on top of <<#_rundown>>

buildSrc/src/main/kotlin/Config.kt

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

docs/revoman.exe.log

Lines changed: 1558 additions & 1316 deletions
Large diffs are not rendered by default.

src/integrationTest/java/com/salesforce/revoman/integration/core/pq/PQE2EWithSMTest.java

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import com.salesforce.revoman.ReVoman;
2323
import com.salesforce.revoman.input.config.Kick;
24+
import com.salesforce.revoman.input.json.adapters.CompositeGraphResponse;
2425
import com.salesforce.revoman.integration.core.pq.connect.request.PlaceQuoteInputRepresentation;
2526
import com.salesforce.revoman.integration.core.pq.connect.response.ID;
2627
import com.salesforce.revoman.integration.core.pq.connect.response.PlaceQuoteOutputRepresentation;
@@ -46,9 +47,9 @@ class PQE2EWithSMTest {
4647
private static final Logger LOGGER = LoggerFactory.getLogger(PQE2EWithSMTest.class);
4748
private static final List<String> PQ_TEMPLATE_PATHS =
4849
List.of(
49-
"pm-templates/pq/user-creation-and-setup-pq.postman_collection.json",
50+
"pm-templates/pq/[sm] user-creation-with-ps-and-setup-pq.postman_collection.json",
5051
"pm-templates/pq/pre-salesRep.postman_collection.json",
51-
"pm-templates/pq/pq-sm.postman_collection.json");
52+
"pm-templates/pq/[sm] pq.postman_collection.json");
5253
private static final String PQ_ENV_PATH = "pm-templates/pq/pq-env.postman_environment.json";
5354
private static final String PQ_URI_PATH = "commerce/quotes/actions/place";
5455
private static final String COMPOSITE_GRAPH_URI_PATH = "composite/graph";
@@ -71,13 +72,22 @@ void revUpPQ() {
7172
.customDynamicVariable( // <5>
7273
"$quantity", ignore -> String.valueOf(Random.Default.nextInt(10) + 1))
7374
.haltOnFailureOfTypeExcept(
74-
HTTP_STATUS, afterAllStepsContainingHeader("ignoreForFailure")) // <6>
75+
HTTP_STATUS,
76+
afterAllStepsContainingHeader("ignoreHTTPStatusUnsuccessful")) // <6>
7577
.requestConfig( // <7>
7678
unmarshallRequest(
7779
beforeAllStepsWithURIPathEndingWith(PQ_URI_PATH),
7880
PlaceQuoteInputRepresentation.class,
7981
adapter(PlaceQuoteInputRepresentation.class)))
80-
.hooks( // <8>
82+
.responseConfig( // <8>
83+
unmarshallResponse(
84+
afterAllStepsWithURIPathEndingWith(PQ_URI_PATH),
85+
PlaceQuoteOutputRepresentation.class),
86+
unmarshallResponse(
87+
afterAllStepsWithURIPathEndingWith(COMPOSITE_GRAPH_URI_PATH),
88+
CompositeGraphResponse.class,
89+
CompositeGraphResponse.ADAPTER))
90+
.hooks( // <9>
8191
pre(
8292
beforeAllStepsWithURIPathEndingWith(PQ_URI_PATH),
8393
(step, requestInfo, rundown) -> {
@@ -91,21 +101,20 @@ HTTP_STATUS, afterAllStepsContainingHeader("ignoreForFailure")) // <6>
91101
post(
92102
afterAllStepsWithURIPathEndingWith(PQ_URI_PATH),
93103
(stepReport, ignore) -> {
94-
validatePQResponse(stepReport); // <9>
104+
validatePQResponse(stepReport); // <10>
95105
LOGGER.info(
96106
"Waiting in PostHook of the Step: {}, for the Quote's Asynchronous processing to finish",
97107
stepReport.step.displayName);
98108
// ! CAUTION 10/09/23 gopala.akshintala: This can be flaky until
99109
// polling is implemented
100110
Thread.sleep(5000);
101111
}),
112+
post(
113+
afterAllStepsWithURIPathEndingWith(COMPOSITE_GRAPH_URI_PATH),
114+
(stepReport, ignore) -> validateCompositeGraphResponse(stepReport)),
102115
post(
103116
afterStepName("query-quote-and-related-records"),
104117
(ignore, rundown) -> assertAfterPQCreate(rundown.mutableEnv)))
105-
.responseConfig( // <10>
106-
unmarshallResponse(
107-
afterAllStepsWithURIPathEndingWith(PQ_URI_PATH),
108-
PlaceQuoteOutputRepresentation.class))
109118
.customAdaptersForMarshalling(new IDAdapter()) // <11>
110119
.insecureHttp(true) // <12>
111120
.off()); // Kick-off
@@ -125,6 +134,12 @@ private static void validatePQResponse(StepReport stepReport) {
125134
assertThat(successRespProp).isEqualTo(!stepReport.step.isInFolder(SYNC_ERROR_FOLDER_NAME));
126135
}
127136

137+
private static void validateCompositeGraphResponse(StepReport stepReport) {
138+
final var graphResponse =
139+
stepReport.responseInfo.get().<CompositeGraphResponse>getTypedTxnObj().getGraphs().get(0);
140+
assertThat(graphResponse.isSuccessful()).isTrue();
141+
}
142+
128143
private static void assertAfterPQCreate(PostmanEnvironment<Object> env) {
129144
// Quote: LineItemCount, quoteCalculationStatus
130145
assertThat(env).containsEntry("lineItemCount", 10);
@@ -154,6 +169,7 @@ private enum PricingPref {
154169
}
155170
}
156171

172+
// * NOTE 10 Mar 2024 gopala.akshintala: Custom Type Adapter
157173
static class IDAdapter {
158174
@FromJson
159175
ID fromJson(String id) {

0 commit comments

Comments
 (0)