From d73fa68de1580b128c0932d2e873d92b556801f3 Mon Sep 17 00:00:00 2001 From: Ryan Kazokas Date: Fri, 18 Oct 2024 12:29:25 -0400 Subject: [PATCH] Adds fix for request options (#131) * Adds fix for request options * Updates maven release --- pom.xml | 2 +- .../com/shopify/model/ShopifyMerchandRequest.java | 11 ++++++----- src/test/java/com/shopify/ShopifySdkDriver.java | 9 +++++++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 4363d975..43288ae7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.channelape shopify-sdk - 2.9.2 + 2.9.3 Shopify SDK Java SDK for Shopify REST API. diff --git a/src/main/java/com/shopify/model/ShopifyMerchandRequest.java b/src/main/java/com/shopify/model/ShopifyMerchandRequest.java index 4b8c27ac..4ecac218 100644 --- a/src/main/java/com/shopify/model/ShopifyMerchandRequest.java +++ b/src/main/java/com/shopify/model/ShopifyMerchandRequest.java @@ -1,5 +1,7 @@ package com.shopify.model; +import java.util.Map; + import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; @@ -10,8 +12,7 @@ public class ShopifyMerchandRequest { public enum Kind { - FULFILLMENT_REQUEST("fulfillment_request"), - CANCELLATION_REQUEST("cancellation_request"), + FULFILLMENT_REQUEST("fulfillment_request"), CANCELLATION_REQUEST("cancellation_request"), LEGACY_FULFILL_REQUEST("legacy_fulfill_request"); static final String NO_MATCHING_ENUMS_ERROR_MESSAGE = "No matching enum found for status: %s"; @@ -41,7 +42,7 @@ public String toString() { private String message; @XmlElement(name = "request_options") - private String requestOptions; + private Map requestOptions; private String kind; public String getMessage() { @@ -52,11 +53,11 @@ public void setMessage(String message) { this.message = message; } - public String getRequestOptions() { + public Map getRequestOptions() { return requestOptions; } - public void setRequestOptions(String requestOptions) { + public void setRequestOptions(Map requestOptions) { this.requestOptions = requestOptions; } diff --git a/src/test/java/com/shopify/ShopifySdkDriver.java b/src/test/java/com/shopify/ShopifySdkDriver.java index ce15d3d3..a4c13415 100644 --- a/src/test/java/com/shopify/ShopifySdkDriver.java +++ b/src/test/java/com/shopify/ShopifySdkDriver.java @@ -38,6 +38,7 @@ import com.shopify.model.ShopifyCustomerUpdateRequest; import com.shopify.model.ShopifyFulfillment; import com.shopify.model.ShopifyFulfillmentCreationRequest; +import com.shopify.model.ShopifyFulfillmentOrder; import com.shopify.model.ShopifyFulfillmentUpdateRequest; import com.shopify.model.ShopifyGetCustomersRequest; import com.shopify.model.ShopifyGiftCard; @@ -735,6 +736,14 @@ public void givenSomeValuesWhenUpdatingACustomerThenExpectValuesToBeUpdatedOnCus assertEquals("RyanTest", updatedCustomer.getFirstName()); } + @Test + public void givenSomeValueWhenRetrievingFulfillmentOrderThenExpectCorrectResponse() { + List fulfillmentOrdersFromOrder = shopifySdk + .getFulfillmentOrdersFromOrder("6263341285548"); + assertEquals(1, fulfillmentOrdersFromOrder.size()); + + } + @Test public void givenSomeErrorOccurrsWhenCreatingFulfillmentThenExpectCorrectErrors() { try {