assertThat(typeIdToCalculationPriceSetItemMap.get(39L).getTotalPrice(), equalTo(new BigDecimal("500005.00")));
}
@Test
public void testProcess_Capital_Obelisk() {
CalculationDto calculation = new CalculationDto();
calculation.setBlueprintTypeName("Obelisk Blueprint");
calculation.setMaterialLevel(1);
calculation.setProductivityLevel(1);
CalculationItemDto capitalPropulsionEngineCalculationItem = new CalculationItemDto();
capitalPropulsionEngineCalculationItem.setPathExpression(PathExpression.parsePath("/20187:1:1/21009"));
capitalPropulsionEngineCalculationItem.setPerfectQuantity(15L);
capitalPropulsionEngineCalculationItem.setItemTypeID(21009L);
capitalPropulsionEngineCalculationItem.setPrice(new BigDecimal("4000000.00"));
capitalPropulsionEngineCalculationItem.setDamagePerJob(BigDecimal.ONE);
capitalPropulsionEngineCalculationItem.setWasteFactor(10);
CalculationItemDto capitalArmorPlateCalculationItem = new CalculationItemDto();
capitalArmorPlateCalculationItem.setPathExpression(PathExpression.parsePath("/20187:1:1/21017"));
capitalArmorPlateCalculationItem.setPerfectQuantity(14L);
capitalArmorPlateCalculationItem.setItemTypeID(21017L);
capitalArmorPlateCalculationItem.setPrice(new BigDecimal("4200000.00"));
capitalArmorPlateCalculationItem.setDamagePerJob(BigDecimal.ONE);
capitalArmorPlateCalculationItem.setWasteFactor(10);
CalculationItemDto capitalCargoBayCalculationItem = new CalculationItemDto();
capitalCargoBayCalculationItem.setPathExpression(PathExpression.parsePath("/20187:1:1/21027"));
capitalCargoBayCalculationItem.setPerfectQuantity(80L);
capitalCargoBayCalculationItem.setItemTypeID(21027L);
capitalCargoBayCalculationItem.setPrice(new BigDecimal("3500000.00"));
capitalCargoBayCalculationItem.setDamagePerJob(BigDecimal.ONE);
capitalCargoBayCalculationItem.setWasteFactor(10);
CalculationItemDto capitalCargoBayTritaniumCalculationItem = new CalculationItemDto();
capitalCargoBayTritaniumCalculationItem.setPathExpression(PathExpression.parsePath("/20187/21027:10:10/34"));
capitalCargoBayTritaniumCalculationItem.setPerfectQuantity(787412L);
capitalCargoBayTritaniumCalculationItem.setItemTypeID(34L);
capitalCargoBayTritaniumCalculationItem.setPrice(new BigDecimal("2.20"));
capitalCargoBayTritaniumCalculationItem.setDamagePerJob(BigDecimal.ONE);
capitalCargoBayTritaniumCalculationItem.setWasteFactor(10);
CalculationItemDto capitalCargoBayPyeriteCalculationItem = new CalculationItemDto();
capitalCargoBayPyeriteCalculationItem.setPathExpression(PathExpression.parsePath("/20187/21027:10:10/35"));
capitalCargoBayPyeriteCalculationItem.setPerfectQuantity(64939L);
capitalCargoBayPyeriteCalculationItem.setItemTypeID(35L);
capitalCargoBayPyeriteCalculationItem.setPrice(new BigDecimal("3.00"));
capitalCargoBayPyeriteCalculationItem.setDamagePerJob(BigDecimal.ONE);
capitalCargoBayPyeriteCalculationItem.setWasteFactor(10);
CalculationItemDto capitalCargoBayMexallonCalculationItem = new CalculationItemDto();
capitalCargoBayMexallonCalculationItem.setPathExpression(PathExpression.parsePath("/20187/21027:10:10/36"));
capitalCargoBayMexallonCalculationItem.setPerfectQuantity(22154L);
capitalCargoBayMexallonCalculationItem.setItemTypeID(36L);
capitalCargoBayMexallonCalculationItem.setPrice(new BigDecimal("26.85"));
capitalCargoBayMexallonCalculationItem.setDamagePerJob(BigDecimal.ONE);
capitalCargoBayMexallonCalculationItem.setWasteFactor(10);
CalculationItemDto capitalCargoBayIsogenCalculationItem = new CalculationItemDto();
capitalCargoBayIsogenCalculationItem.setPathExpression(PathExpression.parsePath("/20187/21027:10:10/37"));
capitalCargoBayIsogenCalculationItem.setPerfectQuantity(3154L);
capitalCargoBayIsogenCalculationItem.setItemTypeID(37L);
capitalCargoBayIsogenCalculationItem.setPrice(new BigDecimal("51.00"));
capitalCargoBayIsogenCalculationItem.setDamagePerJob(BigDecimal.ONE);
capitalCargoBayIsogenCalculationItem.setWasteFactor(10);
CalculationItemDto capitalCargoBayNocxiumCalculationItem = new CalculationItemDto();
capitalCargoBayNocxiumCalculationItem.setPathExpression(PathExpression.parsePath("/20187/21027:10:10/38"));
capitalCargoBayNocxiumCalculationItem.setPerfectQuantity(898L);
capitalCargoBayNocxiumCalculationItem.setItemTypeID(38L);
capitalCargoBayNocxiumCalculationItem.setPrice(new BigDecimal("80.00"));
capitalCargoBayNocxiumCalculationItem.setDamagePerJob(BigDecimal.ONE);
capitalCargoBayNocxiumCalculationItem.setWasteFactor(10);
CalculationItemDto capitalCargoBayZydrineCalculationItem = new CalculationItemDto();
capitalCargoBayZydrineCalculationItem.setPathExpression(PathExpression.parsePath("/20187/21027:10:10/39"));
capitalCargoBayZydrineCalculationItem.setPerfectQuantity(129L);
capitalCargoBayZydrineCalculationItem.setItemTypeID(39L);
capitalCargoBayZydrineCalculationItem.setPrice(new BigDecimal("1000.01"));
capitalCargoBayZydrineCalculationItem.setDamagePerJob(BigDecimal.ONE);
capitalCargoBayZydrineCalculationItem.setWasteFactor(10);
CalculationItemDto capitalCargoBayMegacyteCalculationItem = new CalculationItemDto();
capitalCargoBayMegacyteCalculationItem.setPathExpression(PathExpression.parsePath("/20187/21027:10:10/40"));
capitalCargoBayMegacyteCalculationItem.setPerfectQuantity(29L);
capitalCargoBayMegacyteCalculationItem.setItemTypeID(40L);
capitalCargoBayMegacyteCalculationItem.setPrice(new BigDecimal("1800.00"));
capitalCargoBayMegacyteCalculationItem.setDamagePerJob(BigDecimal.ONE);
capitalCargoBayMegacyteCalculationItem.setWasteFactor(10);
CalculationItemDto capitalConstructionPartsCalculationItem = new CalculationItemDto();
capitalConstructionPartsCalculationItem.setPathExpression(PathExpression.parsePath("/20187:1:1/21037"));
capitalConstructionPartsCalculationItem.setPerfectQuantity(50L);
capitalConstructionPartsCalculationItem.setItemTypeID(21037L);
capitalConstructionPartsCalculationItem.setPrice(new BigDecimal("4000000.00"));
capitalConstructionPartsCalculationItem.setDamagePerJob(BigDecimal.ONE);
capitalConstructionPartsCalculationItem.setWasteFactor(10);
CalculationItemDto capitalConstructionPartsTritaniumCalculationItem = new CalculationItemDto();
capitalConstructionPartsTritaniumCalculationItem.setPathExpression(PathExpression.parsePath("/20187/21037:15:15/34"));
capitalConstructionPartsTritaniumCalculationItem.setPerfectQuantity(349387L);
capitalConstructionPartsTritaniumCalculationItem.setItemTypeID(34L);
capitalConstructionPartsTritaniumCalculationItem.setPrice(new BigDecimal("2.20"));
capitalConstructionPartsTritaniumCalculationItem.setDamagePerJob(BigDecimal.ONE);
capitalConstructionPartsTritaniumCalculationItem.setWasteFactor(10);
CalculationItemDto capitalConstructionPartsPyeriteCalculationItem = new CalculationItemDto();
capitalConstructionPartsPyeriteCalculationItem.setPathExpression(PathExpression.parsePath("/20187/21037:15:15/35"));
capitalConstructionPartsPyeriteCalculationItem.setPerfectQuantity(84399L);
capitalConstructionPartsPyeriteCalculationItem.setItemTypeID(35L);
capitalConstructionPartsPyeriteCalculationItem.setPrice(new BigDecimal("3.00"));
capitalConstructionPartsPyeriteCalculationItem.setDamagePerJob(BigDecimal.ONE);
capitalConstructionPartsPyeriteCalculationItem.setWasteFactor(10);
CalculationItemDto capitalConstructionPartsMexallonCalculationItem = new CalculationItemDto();
capitalConstructionPartsMexallonCalculationItem.setPathExpression(PathExpression.parsePath("/20187/21037:15:15/36"));
capitalConstructionPartsMexallonCalculationItem.setPerfectQuantity(33959L);
capitalConstructionPartsMexallonCalculationItem.setItemTypeID(36L);
capitalConstructionPartsMexallonCalculationItem.setPrice(new BigDecimal("26.85"));
capitalConstructionPartsMexallonCalculationItem.setDamagePerJob(BigDecimal.ONE);
capitalConstructionPartsMexallonCalculationItem.setWasteFactor(10);
CalculationItemDto capitalConstructionPartsIsogenCalculationItem = new CalculationItemDto();
capitalConstructionPartsIsogenCalculationItem.setPathExpression(PathExpression.parsePath("/20187/21037:15:15/37"));
capitalConstructionPartsIsogenCalculationItem.setPerfectQuantity(4549L);
capitalConstructionPartsIsogenCalculationItem.setItemTypeID(37L);
capitalConstructionPartsIsogenCalculationItem.setPrice(new BigDecimal("51.00"));
capitalConstructionPartsIsogenCalculationItem.setDamagePerJob(BigDecimal.ONE);
capitalConstructionPartsIsogenCalculationItem.setWasteFactor(10);
CalculationItemDto capitalConstructionPartsNocxiumCalculationItem = new CalculationItemDto();
capitalConstructionPartsNocxiumCalculationItem.setPathExpression(PathExpression.parsePath("/20187/21037:15:15/38"));
capitalConstructionPartsNocxiumCalculationItem.setPerfectQuantity(1377L);
capitalConstructionPartsNocxiumCalculationItem.setItemTypeID(38L);
capitalConstructionPartsNocxiumCalculationItem.setPrice(new BigDecimal("80.00"));
capitalConstructionPartsNocxiumCalculationItem.setDamagePerJob(BigDecimal.ONE);
capitalConstructionPartsNocxiumCalculationItem.setWasteFactor(10);
CalculationItemDto capitalConstructionPartsZydrineCalculationItem = new CalculationItemDto();
capitalConstructionPartsZydrineCalculationItem.setPathExpression(PathExpression.parsePath("/20187/21037:15:15/39"));
capitalConstructionPartsZydrineCalculationItem.setPerfectQuantity(242L);
capitalConstructionPartsZydrineCalculationItem.setItemTypeID(39L);
capitalConstructionPartsZydrineCalculationItem.setPrice(new BigDecimal("1000.01"));
capitalConstructionPartsZydrineCalculationItem.setDamagePerJob(BigDecimal.ONE);
capitalConstructionPartsZydrineCalculationItem.setWasteFactor(10);
CalculationItemDto capitalConstructionPartsMegacyteCalculationItem = new CalculationItemDto();
capitalConstructionPartsMegacyteCalculationItem.setPathExpression(PathExpression.parsePath("/20187/21037:15:15/40"));
capitalConstructionPartsMegacyteCalculationItem.setPerfectQuantity(95L);
capitalConstructionPartsMegacyteCalculationItem.setItemTypeID(40L);
capitalConstructionPartsMegacyteCalculationItem.setPrice(new BigDecimal("1800.00"));
capitalConstructionPartsMegacyteCalculationItem.setDamagePerJob(BigDecimal.ONE);
capitalConstructionPartsMegacyteCalculationItem.setWasteFactor(10);
List<CalculationItemDto> items = new ArrayList<CalculationItemDto>();
items.add(capitalPropulsionEngineCalculationItem);
items.add(capitalArmorPlateCalculationItem);
items.add(capitalCargoBayCalculationItem);
items.add(capitalConstructionPartsCalculationItem);
items.add(capitalCargoBayTritaniumCalculationItem);
items.add(capitalCargoBayPyeriteCalculationItem);
items.add(capitalCargoBayMexallonCalculationItem);
items.add(capitalCargoBayIsogenCalculationItem);
items.add(capitalCargoBayNocxiumCalculationItem);
items.add(capitalCargoBayZydrineCalculationItem);
items.add(capitalCargoBayMegacyteCalculationItem);
items.add(capitalConstructionPartsTritaniumCalculationItem);
items.add(capitalConstructionPartsPyeriteCalculationItem);
items.add(capitalConstructionPartsMexallonCalculationItem);
items.add(capitalConstructionPartsIsogenCalculationItem);
items.add(capitalConstructionPartsNocxiumCalculationItem);
items.add(capitalConstructionPartsZydrineCalculationItem);
items.add(capitalConstructionPartsMegacyteCalculationItem);
calculation.setItems(items);
CalculationTree calculationTree = new CalculationTree();
calculationTree.build(calculation);
PricingProcessorResult pricingProcessorResult = pricingProcessor.process(1L, calculationTree, new HashMap<Long, CalculationPriceSetItemDto>());
Map<Long, CalculationPriceSetItemDto> typeIdToCalculationPriceSetItemMap = pricingProcessorResult.getTypeIdToCalculationPriceSetItemMap();