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); }