src/test/java/com/squareup/connect/api/CatalogApiTest.java
@Test
    public void batchRetrieveCatalogObjectsTest() throws ApiException {
        String coffeeId = idMap.get("#Coffee");
        String salesTaxId = idMap.get("#SalesTax");
        String beveragesId = idMap.get("#Beverages");
        String milksId = idMap.get("#Milks");

        BatchRetrieveCatalogObjectsRequest body = new BatchRetrieveCatalogObjectsRequest()
            .addObjectIdsItem(coffeeId)
            .addObjectIdsItem(salesTaxId);
        BatchRetrieveCatalogObjectsResponse response = api.batchRetrieveCatalogObjects(body);

        assertEquals(2, response.getObjects().size());

        CatalogObject actualCoffee = response.getObjects().get(0);
        assertEquals("ITEM", actualCoffee.getType());
        assertEquals(coffeeId, actualCoffee.getId());
        assertFalse(actualCoffee.getUpdatedAt().isEmpty());
        assertTrue(actualCoffee.getVersion() != 0);
        assertFalse(actualCoffee.getIsDeleted());
        assertTrue(actualCoffee.getCatalogV1Ids().isEmpty());
        assertTrue(actualCoffee.getPresentAtAllLocations());
        assertTrue(actualCoffee.getPresentAtLocationIds().isEmpty());
        assertTrue(actualCoffee.getAbsentAtLocationIds().isEmpty());

        assertEquals("Coffee", actualCoffee.getItemData().getName());
        assertEquals("Hot bean juice", actualCoffee.getItemData().getDescription());
        assertEquals("Co", actualCoffee.getItemData().getAbbreviation());
        assertNull(actualCoffee.getItemData().getLabelColor());
        assertNull(actualCoffee.getItemData().getAvailableOnline());
        assertNull(actualCoffee.getItemData().getAvailableForPickup());
        assertNull(actualCoffee.getItemData().getAvailableElectronically());
        assertEquals(beveragesId, actualCoffee.getItemData().getCategoryId());
        assertEquals(1, actualCoffee.getItemData().getTaxIds().size());
        assertEquals(salesTaxId, actualCoffee.getItemData().getTaxIds().get(0));
        assertEquals(1, actualCoffee.getItemData().getModifierListInfo().size());
        assertEquals(milksId, actualCoffee.getItemData().getModifierListInfo().get(0).getModifierListId());
        assertEquals(0, actualCoffee.getItemData().getModifierListInfo().get(0).getModifierOverrides().size());
        assertNull(actualCoffee.getItemData().getModifierListInfo().get(0).getMinSelectedModifiers());
        assertNull(actualCoffee.getItemData().getModifierListInfo().get(0).getMaxSelectedModifiers());
        assertNull(actualCoffee.getItemData().getModifierListInfo().get(0).getEnabled());

        assertEquals(2, actualCoffee.getItemData().getVariations().size());
        assertEquals("Small", actualCoffee.getItemData().getVariations().get(0).getItemVariationData().getName());
        assertEquals("FIXED_PRICING", actualCoffee.getItemData().getVariations().get(0).getItemVariationData().getPricingType());
        assertEquals(Long.valueOf(195), actualCoffee.getItemData().getVariations().get(0).getItemVariationData().getPriceMoney().getAmount());
        assertEquals("USD", actualCoffee.getItemData().getVariations().get(0).getItemVariationData().getPriceMoney().getCurrency());

        assertEquals("Large", actualCoffee.getItemData().getVariations().get(1).getItemVariationData().getName());
        assertEquals("FIXED_PRICING", actualCoffee.getItemData().getVariations().get(1).getItemVariationData().getPricingType());
        assertEquals(Long.valueOf(250), actualCoffee.getItemData().getVariations().get(1).getItemVariationData().getPriceMoney().getAmount());
        assertEquals("USD", actualCoffee.getItemData().getVariations().get(1).getItemVariationData().getPriceMoney().getCurrency());

        assertNull(actualCoffee.getCategoryData());
        assertNull(actualCoffee.getItemVariationData());
        assertNull(actualCoffee.getTaxData());
        assertNull(actualCoffee.getDiscountData());
        assertNull(actualCoffee.getModifierListData());
        assertNull(actualCoffee.getModifierData());

        CatalogObject actualSalesTax = response.getObjects().get(1);
        assertEquals("TAX", actualSalesTax.getType());
        assertEquals(salesTaxId, actualSalesTax.getId());
        assertEquals("Sales Tax", actualSalesTax.getTaxData().getName());
    }
/**
     * BatchRetrieveCatalogObjects
     * <p>
     * Returns a set of objects based on the provided ID. [CatalogItem](#type-catalogitem)s returned in the set include all of the child information including: all [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it.
     *
     * @throws ApiException if the Api call fails
     */
BatchRetrieveCatalogObjects

Returns a set of objects based on the provided ID. [CatalogItem](#type-catalogitem)s returned in the set include all of the child information including: all [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it.

@throws ApiException if the Api call fails
BatchRetrieveCatalogObjects Returns a set of objects based on the provided ID . [ CatalogItem ] ( #type - catalogitem ) s returned in the set include all of the child information including : all [ CatalogItemVariation ] ( #type - catalogitemvariation ) objects references to its [ CatalogModifierList ] ( #type - catalogmodifierlist ) objects and the ids of any [ CatalogTax ] ( #type - catalogtax ) objects that apply to it . @throws ApiException if the Api call fails
@Test
    public void batchRetrieveCatalogObjectsTest() throws ApiException {
        String coffeeId = idMap.get("#Coffee");
        String salesTaxId = idMap.get("#SalesTax");
        String beveragesId = idMap.get("#Beverages");
        String milksId = idMap.get("#Milks");
        BatchRetrieveCatalogObjectsRequest body = new BatchRetrieveCatalogObjectsRequest()
            .addObjectIdsItem(coffeeId)
            .addObjectIdsItem(salesTaxId);
        BatchRetrieveCatalogObjectsResponse response = api.batchRetrieveCatalogObjects(body);
        assertEquals(2, response.getObjects().size());
        CatalogObject actualCoffee = response.getObjects().get(0);
        assertEquals("ITEM", actualCoffee.getType());
        assertEquals(coffeeId, actualCoffee.getId());
        assertFalse(actualCoffee.getUpdatedAt().isEmpty());
        assertTrue(actualCoffee.getVersion() != 0);
        assertFalse(actualCoffee.getIsDeleted());
        assertTrue(actualCoffee.getCatalogV1Ids().isEmpty());
        assertTrue(actualCoffee.getPresentAtAllLocations());
        assertTrue(actualCoffee.getPresentAtLocationIds().isEmpty());
        assertTrue(actualCoffee.getAbsentAtLocationIds().isEmpty());
        assertEquals("Coffee", actualCoffee.getItemData().getName());
        assertEquals("Hot bean juice", actualCoffee.getItemData().getDescription());
        assertEquals("Co", actualCoffee.getItemData().getAbbreviation());
        assertNull(actualCoffee.getItemData().getLabelColor());
        assertNull(actualCoffee.getItemData().getAvailableOnline());
        assertNull(actualCoffee.getItemData().getAvailableForPickup());
        assertNull(actualCoffee.getItemData().getAvailableElectronically());
        assertEquals(beveragesId, actualCoffee.getItemData().getCategoryId());
        assertEquals(1, actualCoffee.getItemData().getTaxIds().size());
        assertEquals(salesTaxId, actualCoffee.getItemData().getTaxIds().get(0));
        assertEquals(1, actualCoffee.getItemData().getModifierListInfo().size());
        assertEquals(milksId, actualCoffee.getItemData().getModifierListInfo().get(0).getModifierListId());
        assertEquals(0, actualCoffee.getItemData().getModifierListInfo().get(0).getModifierOverrides().size());
        assertNull(actualCoffee.getItemData().getModifierListInfo().get(0).getMinSelectedModifiers());
        assertNull(actualCoffee.getItemData().getModifierListInfo().get(0).getMaxSelectedModifiers());
        assertNull(actualCoffee.getItemData().getModifierListInfo().get(0).getEnabled());
        assertEquals(2, actualCoffee.getItemData().getVariations().size());
        assertEquals("Small", actualCoffee.getItemData().getVariations().get(0).getItemVariationData().getName());
        assertEquals("FIXED_PRICING", actualCoffee.getItemData().getVariations().get(0).getItemVariationData().getPricingType());
        assertEquals(Long.valueOf(195), actualCoffee.getItemData().getVariations().get(0).getItemVariationData().getPriceMoney().getAmount());
        assertEquals("USD", actualCoffee.getItemData().getVariations().get(0).getItemVariationData().getPriceMoney().getCurrency());
        assertEquals("Large", actualCoffee.getItemData().getVariations().get(1).getItemVariationData().getName());
        assertEquals("FIXED_PRICING", actualCoffee.getItemData().getVariations().get(1).getItemVariationData().getPricingType());
        assertEquals(Long.valueOf(250), actualCoffee.getItemData().getVariations().get(1).getItemVariationData().getPriceMoney().getAmount());
        assertEquals("USD", actualCoffee.getItemData().getVariations().get(1).getItemVariationData().getPriceMoney().getCurrency());
        assertNull(actualCoffee.getCategoryData());
        assertNull(actualCoffee.getItemVariationData());
        assertNull(actualCoffee.getTaxData());
        assertNull(actualCoffee.getDiscountData());
        assertNull(actualCoffee.getModifierListData());
        assertNull(actualCoffee.getModifierData());
        CatalogObject actualSalesTax = response.getObjects().get(1);
        assertEquals("TAX", actualSalesTax.getType());
        assertEquals(salesTaxId, actualSalesTax.getId());
        assertEquals("Sales Tax", actualSalesTax.getTaxData().getName());
    }
@ Test public void batchRetrieveCatalogObjectsTest ( ) throws ApiException { String coffeeId = idMap . get ( "#Coffee" ) ; String salesTaxId = idMap . get ( "#SalesTax" ) ; String beveragesId = idMap . get ( "#Beverages" ) ; String milksId = idMap . get ( "#Milks" ) ; BatchRetrieveCatalogObjectsRequest body = new BatchRetrieveCatalogObjectsRequest ( ) . addObjectIdsItem ( coffeeId ) . addObjectIdsItem ( salesTaxId ) ; BatchRetrieveCatalogObjectsResponse response = api . batchRetrieveCatalogObjects ( body ) ; assertEquals ( 2 , response . getObjects ( ) . size ( ) ) ; CatalogObject actualCoffee = response . getObjects ( ) . get ( 0 ) ; assertEquals ( "ITEM" , actualCoffee . getType ( ) ) ; assertEquals ( coffeeId , actualCoffee . getId ( ) ) ; assertFalse ( actualCoffee . getUpdatedAt ( ) . isEmpty ( ) ) ; assertTrue ( actualCoffee . getVersion ( ) != 0 ) ; assertFalse ( actualCoffee . getIsDeleted ( ) ) ; assertTrue ( actualCoffee . getCatalogV1Ids ( ) . isEmpty ( ) ) ; assertTrue ( actualCoffee . getPresentAtAllLocations ( ) ) ; assertTrue ( actualCoffee . getPresentAtLocationIds ( ) . isEmpty ( ) ) ; assertTrue ( actualCoffee . getAbsentAtLocationIds ( ) . isEmpty ( ) ) ; assertEquals ( "Coffee" , actualCoffee . getItemData ( ) . getName ( ) ) ; assertEquals ( "Hot bean juice" , actualCoffee . getItemData ( ) . getDescription ( ) ) ; assertEquals ( "Co" , actualCoffee . getItemData ( ) . getAbbreviation ( ) ) ; assertNull ( actualCoffee . getItemData ( ) . getLabelColor ( ) ) ; assertNull ( actualCoffee . getItemData ( ) . getAvailableOnline ( ) ) ; assertNull ( actualCoffee . getItemData ( ) . getAvailableForPickup ( ) ) ; assertNull ( actualCoffee . getItemData ( ) . getAvailableElectronically ( ) ) ; assertEquals ( beveragesId , actualCoffee . getItemData ( ) . getCategoryId ( ) ) ; assertEquals ( 1 , actualCoffee . getItemData ( ) . getTaxIds ( ) . size ( ) ) ; assertEquals ( salesTaxId , actualCoffee . getItemData ( ) . getTaxIds ( ) . get ( 0 ) ) ; assertEquals ( 1 , actualCoffee . getItemData ( ) . getModifierListInfo ( ) . size ( ) ) ; assertEquals ( milksId , actualCoffee . getItemData ( ) . getModifierListInfo ( ) . get ( 0 ) . getModifierListId ( ) ) ; assertEquals ( 0 , actualCoffee . getItemData ( ) . getModifierListInfo ( ) . get ( 0 ) . getModifierOverrides ( ) . size ( ) ) ; assertNull ( actualCoffee . getItemData ( ) . getModifierListInfo ( ) . get ( 0 ) . getMinSelectedModifiers ( ) ) ; assertNull ( actualCoffee . getItemData ( ) . getModifierListInfo ( ) . get ( 0 ) . getMaxSelectedModifiers ( ) ) ; assertNull ( actualCoffee . getItemData ( ) . getModifierListInfo ( ) . get ( 0 ) . getEnabled ( ) ) ; assertEquals ( 2 , actualCoffee . getItemData ( ) . getVariations ( ) . size ( ) ) ; assertEquals ( "Small" , actualCoffee . getItemData ( ) . getVariations ( ) . get ( 0 ) . getItemVariationData ( ) . getName ( ) ) ; assertEquals ( "FIXED_PRICING" , actualCoffee . getItemData ( ) . getVariations ( ) . get ( 0 ) . getItemVariationData ( ) . getPricingType ( ) ) ; assertEquals ( Long . valueOf ( 195 ) , actualCoffee . getItemData ( ) . getVariations ( ) . get ( 0 ) . getItemVariationData ( ) . getPriceMoney ( ) . getAmount ( ) ) ; assertEquals ( "USD" , actualCoffee . getItemData ( ) . getVariations ( ) . get ( 0 ) . getItemVariationData ( ) . getPriceMoney ( ) . getCurrency ( ) ) ; assertEquals ( "Large" , actualCoffee . getItemData ( ) . getVariations ( ) . get ( 1 ) . getItemVariationData ( ) . getName ( ) ) ; assertEquals ( "FIXED_PRICING" , actualCoffee . getItemData ( ) . getVariations ( ) . get ( 1 ) . getItemVariationData ( ) . getPricingType ( ) ) ; assertEquals ( Long . valueOf ( 250 ) , actualCoffee . getItemData ( ) . getVariations ( ) . get ( 1 ) . getItemVariationData ( ) . getPriceMoney ( ) . getAmount ( ) ) ; assertEquals ( "USD" , actualCoffee . getItemData ( ) . getVariations ( ) . get ( 1 ) . getItemVariationData ( ) . getPriceMoney ( ) . getCurrency ( ) ) ; assertNull ( actualCoffee . getCategoryData ( ) ) ; assertNull ( actualCoffee . getItemVariationData ( ) ) ; assertNull ( actualCoffee . getTaxData ( ) ) ; assertNull ( actualCoffee . getDiscountData ( ) ) ; assertNull ( actualCoffee . getModifierListData ( ) ) ; assertNull ( actualCoffee . getModifierData ( ) ) ; CatalogObject actualSalesTax = response . getObjects ( ) . get ( 1 ) ; assertEquals ( "TAX" , actualSalesTax . getType ( ) ) ; assertEquals ( salesTaxId , actualSalesTax . getId ( ) ) ; assertEquals ( "Sales Tax" , actualSalesTax . getTaxData ( ) . getName ( ) ) ; }
BatchRetrieveCatalogObjects
 <p>
 Returns a set of objects based on the provided ID.
BatchRetrieveCatalogObjects <p > Returns a set of objects based on the provided ID .