Coupon { public void apply() { verifyCouponIsAvailable(); this.used = true; } @Builder  Coupon(double amount, LocalDate expirationDate); boolean isExpiration(); void apply();  }
@Test(expected = IllegalStateException.class) public void 쿠폰할인적용시_이미사용했을경우() { final double amount = 10D; final Coupon coupon = buildCoupon(amount, 10); coupon.apply(); coupon.apply(); }
@Test(expected = IllegalStateException.class) public void 쿠폰할인적용시_쿠폰기간만료했을경우() { final double amount = 10D; final Coupon coupon = buildCoupon(amount, -10); coupon.apply(); }