File tree Expand file tree Collapse file tree 6 files changed +38
-5
lines changed
integrationTest/java/com/salesforce/revoman/integration/core/pq
main/kotlin/com/salesforce/revoman/input/json/adapters
test/java/com/salesforce/revoman/input/json Expand file tree Collapse file tree 6 files changed +38
-5
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ endif::[]
1818:pmtemplates: src/integrationTest/resources/pm-templates
1919:imagesdir: docs/images
2020:prewrap!:
21- :revoman-version: 0.41.1
21+ :revoman-version: 0.41.2
2222
2323'''
2424
Original file line number Diff line number Diff line change 66 * ************************************************************************************************
77 */
88const val GROUP_ID = " com.salesforce.revoman"
9- const val VERSION = " 0.41.1 "
9+ const val VERSION = " 0.41.2 "
1010const val ARTIFACT_ID = " revoman"
1111const val STAGING_PROFILE_ID = " 1ea0a23e61ba7d"
Original file line number Diff line number Diff line change @@ -136,8 +136,9 @@ void revUpPQ() {
136136 }
137137
138138 private static void validatePQResponse (StepReport stepReport ) {
139- final var successRespProp =
140- stepReport .responseInfo .get ().<PlaceQuoteOutputRepresentation >getTypedTxnObj ().getSuccess ();
139+ final var pqInputRep =
140+ stepReport .responseInfo .get ().<PlaceQuoteOutputRepresentation >getTypedTxnObj ();
141+ final var successRespProp = pqInputRep .getSuccess ();
141142 final var isStepExpectedToFail = stepReport .step .isInFolder (SYNC_ERROR_FOLDER_NAME );
142143 assertThat (successRespProp ).isEqualTo (!isStepExpectedToFail );
143144 }
Original file line number Diff line number Diff line change 11package com.salesforce.revoman.input.json.adapters
22
33import com.salesforce.revoman.input.json.adapters.CompositeGraphResponse.Graph.ErrorGraph
4+ import com.salesforce.revoman.input.json.adapters.CompositeGraphResponse.Graph.ErrorGraph.GraphErrorResponse.CompositeErrorResponse
5+ import com.salesforce.revoman.input.json.adapters.CompositeGraphResponse.Graph.ErrorGraph.GraphErrorResponse.CompositeErrorResponse.Body
46import com.salesforce.revoman.input.json.adapters.CompositeGraphResponse.Graph.SuccessGraph
57import com.salesforce.revoman.input.json.factories.DiMorphicAdapter
68import com.squareup.moshi.Json
79import com.squareup.moshi.JsonClass
810
11+ private const val PROCESSING_HALTED = " PROCESSING_HALTED"
12+
913@JsonClass(generateAdapter = true )
1014data class CompositeGraphResponse (val graphs : List <Graph >) {
1115 sealed interface Graph {
@@ -42,6 +46,16 @@ data class CompositeGraphResponse(val graphs: List<Graph>) {
4246 val graphResponse : GraphErrorResponse ,
4347 override val isSuccessful : Boolean
4448 ) : Graph {
49+ @Json(ignore = true )
50+ @JvmField
51+ val errorMessages: List <CompositeErrorResponse > =
52+ graphResponse.compositeResponse.filter {
53+ it.body.firstOrNull()?.errorCode != PROCESSING_HALTED
54+ }
55+ @Json(ignore = true )
56+ @JvmField
57+ val firstErrorMessageBody: Body ? = errorMessages.firstOrNull()?.body?.firstOrNull()
58+
4559 @JsonClass(generateAdapter = true )
4660 data class GraphErrorResponse (val compositeResponse : List <CompositeErrorResponse >) {
4761 @JsonClass(generateAdapter = true )
Original file line number Diff line number Diff line change @@ -63,7 +63,10 @@ void compositeGraphErrorResponseMarshallUnmarshall() throws JSONException {
6363 CompositeGraphResponse .class ,
6464 graphErrorResponseJsonStr ,
6565 List .of (CompositeGraphResponse .ADAPTER ));
66- assertThat (errorGraphResponse .getGraphs ().get (0 )).isInstanceOf (ErrorGraph .class );
66+ final var errorGraph = errorGraphResponse .getGraphs ().get (0 );
67+ assertThat (errorGraph ).isInstanceOf (ErrorGraph .class );
68+ assertThat (((ErrorGraph ) errorGraph ).firstErrorMessageBody .getErrorCode ())
69+ .isEqualTo ("DUPLICATE_VALUE" );
6770 final var errorGraphResponseUnmarshalled =
6871 JsonPojoUtils .pojoToJson (
6972 CompositeGraphResponse .class ,
You can’t perform that action at this time.
0 commit comments