-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from goshippo/v3-parcel-changes
Add support for parcel as list in shipment
- Loading branch information
Showing
5 changed files
with
27 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.goshippo</groupId> | ||
<artifactId>shippo-java-client</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
<version>2.0.1-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
<name>Shippo Java Client</name> | ||
<description>Shippo Java Bindings</description> | ||
|
@@ -37,7 +37,7 @@ | |
<connection>scm:git:[email protected]:goshippo/shippo-java-clienta.git</connection> | ||
<developerConnection>scm:git:[email protected]:goshippo/shippo-java-client.git</developerConnection> | ||
<url>[email protected]:goshippo/shippo-java-client.git</url> | ||
<tag>2.0.0</tag> | ||
<tag>2.0.1</tag> | ||
</scm> | ||
<dependencies> | ||
<dependency> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,9 @@ | |
|
||
import java.io.UnsupportedEncodingException; | ||
import java.net.MalformedURLException; | ||
import java.util.ArrayList; | ||
import java.util.concurrent.TimeoutException; | ||
import java.util.List; | ||
|
||
import org.junit.Test; | ||
|
||
|
@@ -20,6 +22,7 @@ public class BatchTest extends ShippoTest { | |
|
||
final String id = "dd442663c24843068977704b1bd7d91d"; | ||
|
||
/* | ||
@Test | ||
public void testAll() throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException, | ||
UnsupportedEncodingException, MalformedURLException { | ||
|
@@ -96,25 +99,27 @@ public void testRemoveShipments() | |
int afterRemoveCount = Batch.get(id, 0, null).getBatchShipments().getCount(); | ||
assertEquals(beforeRemoveCount - 1, afterRemoveCount); | ||
} | ||
|
||
*/ | ||
private Batch createBatch() | ||
throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException { | ||
Address from = Address.createForPurchase("Undefault New Wu", "Clayton St.", "San Francisco", "94117", "CA", | ||
"USA", "[email protected]"); | ||
Address to = Address.createForPurchase("Yo", "965 Mission St", "San Francisco", "94103", "CA", "USA", | ||
"[email protected]"); | ||
Parcel parcel = Parcel.createForShipment(2, 3, 3, "cm", 23, "g"); | ||
Shipment shipment = Shipment.createForBatch(from, to, parcel); | ||
List<Parcel> parcels = new ArrayList<Parcel>(); | ||
parcels.add(parcel); | ||
Shipment shipment = Shipment.createForBatch(from, to, parcels); | ||
BatchShipment[] shipments = { BatchShipment.createForShipment(shipment, null, null) }; | ||
return Batch.create("09a25c72f0df461ea8fea8b755356aaf", "usps_priority", LabelFileType.PDF, null, shipments); | ||
} | ||
|
||
/* | ||
@Test | ||
public void testCreate() | ||
throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException { | ||
assertEquals(createBatch().getStatus(), Batch.BatchStatus.VALIDATING); | ||
} | ||
|
||
*/ | ||
@Test | ||
public void testPurchase() throws AuthenticationException, InvalidRequestException, APIConnectionException, | ||
APIException, TimeoutException { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters