Skip to content

Commit

Permalink
Adds fix for request options (#131)
Browse files Browse the repository at this point in the history
* Adds fix for request options

* Updates maven release
  • Loading branch information
ryankazokas authored Oct 18, 2024
1 parent d3a2039 commit d73fa68
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.channelape</groupId>
<artifactId>shopify-sdk</artifactId>
<version>2.9.2</version>
<version>2.9.3</version>

<name>Shopify SDK</name>
<description>Java SDK for Shopify REST API.</description>
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/com/shopify/model/ShopifyMerchandRequest.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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";
Expand Down Expand Up @@ -41,7 +42,7 @@ public String toString() {

private String message;
@XmlElement(name = "request_options")
private String requestOptions;
private Map<String, String> requestOptions;
private String kind;

public String getMessage() {
Expand All @@ -52,11 +53,11 @@ public void setMessage(String message) {
this.message = message;
}

public String getRequestOptions() {
public Map<String, String> getRequestOptions() {
return requestOptions;
}

public void setRequestOptions(String requestOptions) {
public void setRequestOptions(Map<String, String> requestOptions) {
this.requestOptions = requestOptions;
}

Expand Down
9 changes: 9 additions & 0 deletions src/test/java/com/shopify/ShopifySdkDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -735,6 +736,14 @@ public void givenSomeValuesWhenUpdatingACustomerThenExpectValuesToBeUpdatedOnCus
assertEquals("RyanTest", updatedCustomer.getFirstName());
}

@Test
public void givenSomeValueWhenRetrievingFulfillmentOrderThenExpectCorrectResponse() {
List<ShopifyFulfillmentOrder> fulfillmentOrdersFromOrder = shopifySdk
.getFulfillmentOrdersFromOrder("6263341285548");
assertEquals(1, fulfillmentOrdersFromOrder.size());

}

@Test
public void givenSomeErrorOccurrsWhenCreatingFulfillmentThenExpectCorrectErrors() {
try {
Expand Down

0 comments on commit d73fa68

Please sign in to comment.