@Test
public void testCreate() throws StripeException {
final List<String> attributes = new ArrayList<>();
attributes.add("attr1");
attributes.add("attr2");
final Map<String, Object> packageDimensions = new HashMap<>();
packageDimensions.put("height", 2.234);
packageDimensions.put("length", 5.10);
packageDimensions.put("width", 6.50);
packageDimensions.put("weight", 10);
final Map<String, Object> params = new HashMap<>();
params.put("active", true);
params.put("name", "Test Name");
params.put("description", "This is a description");
params.put("caption", "This is a caption");
params.put("attributes", attributes);
params.put("url", "http://example.com");
params.put("shippable", true);
params.put("package_dimensions", packageDimensions);
params.put("type", "good");
final Product product = Product.create(params);
assertNotNull(product);
verifyRequest(
ApiResource.RequestMethod.POST,
"/v1/products",
params
);
}