public virtual void test_toBuilder() { SecurityInfo test = SecurityInfo.builder().addAttribute(AttributeType.NAME, "name").id(ID).priceInfo(PRICE_INFO).build().toBuilder().id(ID2).build(); assertEquals(test.Id, ID2); assertEquals(test.getAttribute(AttributeType.NAME), "name"); }
public virtual void test_of_withAdditionalInfo() { SecurityInfo test = SecurityInfo.of(ID, PRICE_INFO).withAttribute(AttributeType.NAME, "B").withAttribute(AttributeType.NAME, "A"); // overwrites "B" assertEquals(test.Id, ID); assertEquals(test.PriceInfo, PRICE_INFO); assertEquals(test.Attributes, INFO_MAP); assertEquals(test.getAttribute(AttributeType.NAME), "A"); assertEquals(test.findAttribute(AttributeType.NAME), ("A")); }
public virtual void test_builder() { SecurityInfo test = SecurityInfo.builder().id(ID).priceInfo(PRICE_INFO).addAttribute(AttributeType.NAME, "B").addAttribute(AttributeType.NAME, "A").build(); assertEquals(test.Id, ID); assertEquals(test.PriceInfo, PRICE_INFO); assertEquals(test.Attributes, INFO_MAP); assertEquals(test.getAttribute(AttributeType.NAME), "A"); assertEquals(test.findAttribute(AttributeType.NAME), ("A")); }
public virtual void test_of_priceInfo() { SecurityInfo test = SecurityInfo.of(ID, PRICE_INFO); assertEquals(test.Id, ID); assertEquals(test.PriceInfo, PRICE_INFO); assertEquals(test.Attributes, ImmutableMap.of()); assertThrowsIllegalArg(() => test.getAttribute(AttributeType.NAME)); assertEquals(test.findAttribute(AttributeType.NAME), null); }