@Test
public void test_refundPoint() {

    BigDecimal refund = BigDecimal.valueOf(100L).setScale(DecimalUtils.SCALE_2);
    BigDecimal cost = BigDecimal.valueOf(50L).setScale(DecimalUtils.SCALE_2);
    rec.setAvailable(BigDecimal.valueOf(150L).setScale(DecimalUtils.SCALE_2))
            .setRefund(DecimalUtils.ZERO)
            .setRefundCost(DecimalUtils.ZERO)
            .setFrozen(DecimalUtils.ZERO);
    PointRecPo result = this.calculator.refundPoint(rec, refund, cost);
    log.info("result = {}", result);
    Assertions.assertEquals(rec.getId(), result.getId());
    Assertions.assertEquals(BigDecimal.valueOf(50L).setScale(DecimalUtils.SCALE_2), // 150 - 100
            rec.getAvailable());
    Assertions.assertEquals(BigDecimal.valueOf(50L).setScale(DecimalUtils.SCALE_2), // 150 - 100
            result.getAvailable());
    Assertions.assertEquals(BigDecimal.valueOf(100L).setScale(DecimalUtils.SCALE_2), rec.getRefund());
    Assertions.assertEquals(BigDecimal.valueOf(100L).setScale(DecimalUtils.SCALE_2), result.getRefund());
    Assertions.assertEquals(BigDecimal.valueOf(50L).setScale(DecimalUtils.SCALE_2), rec.getRefundCost());
    Assertions.assertEquals(BigDecimal.valueOf(50L).setScale(DecimalUtils.SCALE_2), result.getRefundCost());
    Assertions.assertTrue(rec.getEnable());
    Assertions.assertTrue(result.getEnable());
    rec.setAvailable(BigDecimal.valueOf(100L))
            .setRefund(DecimalUtils.ZERO)
            .setRefundCost(DecimalUtils.ZERO);
    result = this.calculator.refundPoint(rec, refund, cost);
    log.info("result = {}", result);
    Assertions.assertEquals(rec.getId(), result.getId());
    Assertions.assertEquals(DecimalUtils.ZERO, // 150 - 100
            rec.getAvailable());
    Assertions.assertEquals(DecimalUtils.ZERO, // 150 - 100
            result.getAvailable());
    Assertions.assertEquals(BigDecimal.valueOf(100L).setScale(DecimalUtils.SCALE_2), rec.getRefund());
    Assertions.assertEquals(BigDecimal.valueOf(100L).setScale(DecimalUtils.SCALE_2), result.getRefund());
    Assertions.assertEquals(BigDecimal.valueOf(50L).setScale(DecimalUtils.SCALE_2), rec.getRefundCost());
    Assertions.assertEquals(BigDecimal.valueOf(50L).setScale(DecimalUtils.SCALE_2), result.getRefundCost());
    Assertions.assertFalse(rec.getEnable());
    Assertions.assertFalse(result.getEnable());
}