Examples of ProductItem


Examples of org.jclouds.softlayer.domain.ProductItem

       assertEquals(capacity().apply(item), 2.0f);
   }

   @Test
   public void testCapacityMissing() {
       ProductItem item = ProductItem.builder().id(1).build();
       assertNull(capacity().apply(item));
   }
View Full Code Here

Examples of org.jclouds.softlayer.domain.ProductItem

       assertEquals(description().apply(item),"an item");
   }

   @Test
   public void testDescriptionMissing() {
       ProductItem item = ProductItem.builder().id(1).build();
       assertNull(description().apply(item));
   }
View Full Code Here

Examples of org.jclouds.softlayer.domain.ProductItem

   }

   @Test
   public void testPriceMultiplePrices() {
       ImmutableSet<ProductItemPrice> prices = ImmutableSet.of(price, ProductItemPrice.builder().id(2).build());
       ProductItem item2 = ProductItem.builder().prices(prices).build();
       assertEquals(price().apply(item2),price);
   }
View Full Code Here

Examples of org.jclouds.softlayer.domain.ProductItem

       assertEquals(price().apply(item2),price);
   }

   @Test(expectedExceptions = NoSuchElementException.class)
   public void testPriceMissing() {
      ProductItem noPriceItem = ProductItem.builder().id(1).build();
      price().apply(noPriceItem);
   }
View Full Code Here

Examples of org.jclouds.softlayer.domain.ProductItem

   public void testItemCallGetsCategory() {
      ProductItemPrice price = ProductItemPrice.builder().id(1)
                                                         .categories(category)
                                                         .item(item)
                                                         .build();
      ProductItem newItem = item().apply(price);
      assertEquals(newItem.getCategories(), ImmutableSet.of(category));
   }
View Full Code Here

Examples of org.jclouds.softlayer.domain.ProductItem

   }

   @Test
   public void testItemCallNoCategoryOnPrice() {

      ProductItem item1 = item.toBuilder().categories(ImmutableSet.of(category)).build();

      ProductItemPrice price = ProductItemPrice.builder().id(1)
                                                         .item(item1)
                                                         .build();
      ProductItem newItem = item().apply(price);
      assertEquals(newItem.getCategories(), ImmutableSet.of(category));
   }
View Full Code Here

Examples of org.jclouds.softlayer.domain.ProductItem

      ProductItemCategory category2 = ProductItemCategory.builder()
            .id(12)
            .categoryCode("new category")
            .build();

      ProductItem item1 = item.toBuilder().categories(ImmutableSet.of(category2)).build();

      ProductItemPrice price = ProductItemPrice.builder().id(1)
                                                         .categories(category)
                                                         .item(item1)
                                                         .build();
      ProductItem newItem = item().apply(price);
      assertEquals(newItem.getCategories(), ImmutableSet.of(category2));
   }
View Full Code Here

Examples of org.jclouds.softlayer.domain.ProductItem

   }

   @Test
   public void testHardwareId() {
      ProductItem item1 = ProductItem.builder().prices(ProductItemPrice.builder().id(123).build()).build();
      ProductItem item2 = ProductItem.builder().prices(ProductItemPrice.builder().id(456).build()).build();
      ProductItem item3 = ProductItem.builder().prices(ProductItemPrice.builder().id(789).build()).build();

      String id = hardwareId().apply(ImmutableList.of(item1, item2, item3));
      assertEquals("123,456,789", id);
   }
View Full Code Here

Examples of org.jclouds.softlayer.domain.ProductItem

     assertEquals(100F, volumes.get(0).getSize());
   }

   @Test
   public void testHardwareWithTwoDisks() {
      ProductItem localVolumeItem = ProductItem.builder().id(4).description("25 GB").capacity(25F).prices(
            ProductItemPrice.builder().id(987).build()).categories(
            ProductItemCategory.builder().categoryCode("guest_disk1").build()).build();

      Hardware hardware = toHardware.apply(ImmutableSet.of(cpuItem, ramItem, volumeItem,localVolumeItem));
View Full Code Here

Examples of org.jclouds.softlayer.domain.ProductItem

   @Test
   public void testCategoryCodePresentTwoCategories() {
      ProductItemCategory osCategory = ProductItemCategory.builder().id(2).categoryCode("os").build();

      ProductItem item = ProductItem.builder().categories(ImmutableSet.of(ramCategory, osCategory)).build();

      assert ProductItemPredicates.categoryCode("ram").apply(item);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.