SkuPriceEntity implements org.yes.cart.domain.entity.SkuPrice, java.io.Serializable { @Override public Pair<BigDecimal, BigDecimal> getSalePriceForCalculation() { if (salePrice == null) { return new Pair<>(regularPrice, null); } else if (MoneyUtils.isFirstBiggerThanOrEqualToSecond(salePrice, regularPrice)) { return new Pair<>(salePrice, null); } return new Pair<>(regularPrice, salePrice); } SkuPriceEntity(); @Override String getSkuCode(); @Override void setSkuCode(final String skuCode); @Override Shop getShop(); @Override void setShop(final Shop shop); @Override String getCurrency(); @Override void setCurrency(final String currency); @Override BigDecimal getQuantity(); @Override void setQuantity(final BigDecimal quantity); @Override boolean isPriceUponRequest(); @Override void setPriceUponRequest(final boolean priceUponRequest); @Override boolean isPriceOnOffer(); @Override void setPriceOnOffer(final boolean priceOnOffer); @Override BigDecimal getRegularPrice(); @Override void setRegularPrice(final BigDecimal regularPrice); @Override BigDecimal getSalePrice(); @Override Pair<BigDecimal, BigDecimal> getSalePriceForCalculation(); @Override void setSalePrice(final BigDecimal salePrice); @Override BigDecimal getMinimalPrice(); @Override void setMinimalPrice(final BigDecimal minimalPrice); @Override LocalDateTime getSalefrom(); @Override void setSalefrom(final LocalDateTime salefrom); @Override LocalDateTime getSaleto(); @Override void setSaleto(final LocalDateTime saleto); @Override boolean isAvailable(final LocalDateTime now); @Override Instant getCreatedTimestamp(); @Override void setCreatedTimestamp(final Instant createdTimestamp); @Override Instant getUpdatedTimestamp(); @Override void setUpdatedTimestamp(final Instant updatedTimestamp); @Override String getCreatedBy(); @Override void setCreatedBy(final String createdBy); @Override String getUpdatedBy(); @Override void setUpdatedBy(final String updatedBy); @Override String getGuid(); @Override void setGuid(final String guid); @Override String getTag(); @Override void setTag(final String tag); @Override String getPricingPolicy(); @Override void setPricingPolicy(final String pricingPolicy); @Override String getSupplier(); @Override void setSupplier(final String supplier); @Override String getRef(); @Override void setRef(final String ref); @Override boolean isAutoGenerated(); @Override void setAutoGenerated(final boolean autoGenerated); @Override long getSkuPriceId(); @Override long getId(); @Override void setSkuPriceId(final long skuPriceId); @Override long getVersion(); void setVersion(final long version);  }
@Test public void testGetSalePriceForCalculationDefaultNotSellable() throws Exception { final SkuPrice skuPrice = new SkuPriceEntity(); final Pair<BigDecimal, BigDecimal> listAndSale = skuPrice.getSalePriceForCalculation(); assertNotNull(listAndSale); assertNull(listAndSale.getFirst()); assertNull(listAndSale.getSecond()); }