public void test_summary_position() { StandardId id = StandardId.of("X", "Y"); SecurityPosition position = SecurityPosition.builder() .securityId(SecurityId.of("A", "B")) .longQuantity(123) .info(PositionInfo.of(id)) .build(); String description = "desc"; PortfolioItemSummary expected = PortfolioItemSummary.of( id, PortfolioItemType.POSITION, ProductType.SECURITY, ImmutableSet.of(GBP), description); assertEquals(SummarizerUtils.summary(position, ProductType.SECURITY, description, GBP), expected); }
.build()) .securityId(EtdIdUtils.futureId(ExchangeIds.ECAG, FGBL, YearMonth.of(2017, 6), EtdVariant.ofMonthly())) .longQuantity(15d) .shortQuantity(2d) .build(); .securityId(EtdIdUtils.futureId( ExchangeIds.ECAG, FGBL, YearMonth.of(2017, 6), EtdVariant.ofFlexFuture(13, EtdSettlementType.CASH))) .longQuantity(0d) .shortQuantity(13d) .build(); .build()) .securityId(EtdIdUtils.futureId(ExchangeIds.ECAG, FGBL, YearMonth.of(2017, 6), EtdVariant.ofWeekly(2))) .longQuantity(0d) .shortQuantity(20d) .build(); .build()) .securityId(EtdIdUtils.futureId(ExchangeIds.ECAG, FGBL, YearMonth.of(2017, 6), EtdVariant.ofDaily(3))) .longQuantity(30d) .shortQuantity(0d) .build(); .securityId(EtdIdUtils.optionId( ExchangeIds.ECAG, OGBL, YearMonth.of(2017, 6), EtdVariant.ofMonthly(), 0, PutCall.PUT, 3d, YearMonth.of(2017, 9))) .longQuantity(15d) .shortQuantity(2d) .build();
static SecurityPosition sut2() { return SecurityPosition.builder() .info(PositionInfo.empty()) .securityId(SECURITY_ID2) .longQuantity(LONG_QUANTITY2) .shortQuantity(SHORT_QUANTITY2) .build(); }
static SecurityPosition sut() { return SecurityPosition.builder() .info(POSITION_INFO) .securityId(SECURITY_ID) .longQuantity(LONG_QUANTITY) .shortQuantity(SHORT_QUANTITY) .build(); }