liujie
2026-09-11 4f6f15b818704079ff2e4e4719b798f48d68a335
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.tourguide.modules.domain;
 
import com.tourguide.modules.operation.domain.ServiceType;
import com.tourguide.modules.order.domain.OrderStatus;
import com.tourguide.modules.order.domain.PaymentStatus;
import com.tourguide.modules.order.domain.RefundStatus;
import org.junit.jupiter.api.Test;
 
import static org.assertj.core.api.Assertions.assertThat;
 
class DomainEnumTest {
    @Test
    void shouldExposeCanonicalServiceTypeCodes() {
        assertThat(ServiceType.values()).extracting(ServiceType::getCode)
                .containsExactly("GROUP_QUICK", "GROUP_PREMIUM", "PRIVATE_QUICK", "PRIVATE_PREMIUM");
    }
 
    @Test
    void shouldKeepOrderPaymentAndRefundStatesSeparated() {
        assertThat(OrderStatus.isRefundable(OrderStatus.PENDING_ACCEPT.getCode())).isTrue();
        assertThat(OrderStatus.isRefundable(OrderStatus.PENDING_PAYMENT.getCode())).isFalse();
        assertThat(PaymentStatus.PAID.getCode()).isEqualTo("PAID");
        assertThat(RefundStatus.REFUNDING.getCode()).isEqualTo("REFUNDING");
    }
}