---
# System prepended metadata

title: CCTS 系統案例與報告入口

---

###### tags: TCSE2022, 碩論

# CCTS 系統案例與報告入口

[TOC]
## CCTS Document 測試案例
### PDVPS_saga_fail_CCTS-T-01
:::spoiler 點我開啟原始碼

```yaml=
CCTSVersion: "0.12"
title: PDVPS saga fail CASE- stateName is null - CCTS-T-01
startAt: Create top-up event
states:
  - stateName: Create top-up event
    comment: initial state
    end: False
    nextState:
#      error
      stateName:
      testCaseId: t-orc-payment-01
      provider: orchestrator
      consumer: paymentService
  - stateName: Payment process
    comment: make payment
    end: False
    options:
      - stateName: Prepare update point
        testCaseId: t-payment-orc-01
        provider: paymentService
        consumer: orchestrator
      - stateName: Payment Fail
        testCaseId: t-payment-orc-02
        provider: paymentService
        consumer: orchestrator
  - stateName: Payment Fail
    comment: do payment fail compensation
    end: False
    nextState:
      stateName: Payment reversed
      testCaseId: t-orc-payment-02
      provider: orchestrator
      consumer: paymentService
  - stateName: Payment reversed
    comment: reverse Payment
    end: False
    nextState:
      stateName: Top-up cancel
      testCaseId: t-payment-orc-03
      provider: paymentService
      consumer: orchestrator
  - stateName: Prepare update point
    comment: orchestrator received response from payment and ready to send update point request to Point service
    end: False
    nextState:
      stateName: Update point
      testCaseId: t-orc-point-01
      provider: orchestrator
      consumer: pointService
  - stateName: Update point
    comment: do update point
    end: False
    options:
      - stateName: Prepare log
        testCaseId: t-point-orc-01
        provider: pointService
        consumer: orchestrator
      - stateName: Update point Fail
        testCaseId: t-point-orc-02
        provider: pointService
        consumer: orchestrator
  - stateName: Update point Fail
    comment: to revert points
    end: False
    nextState:
      stateName: Revert point
      testCaseId: t-orc-point-02
      provider: orchestrator
      consumer: pointService
  - stateName: Revert point
    comment: revert points
    end: False
    nextState:
      stateName: Prepare reverse payment
      testCaseId: t-point-orc-03
      provider: pointService
      consumer: orchestrator
  - stateName: Prepare reverse payment
    comment: orchestrator received response that point finished compensation , ready to do payment compensation
    end: False
    nextState:
      stateName: Payment reversed
      testCaseId: t-orc-payment-03
      provider: orchestrator
      consumer: paymentService
  - stateName: Prepare log
    comment: orchestrator ready to send Log request
    end: False
    nextState:
      stateName: Log
      testCaseId: t-orc-logging-01
      provider: orchestrator
      consumer: loggingService
  - stateName: Log
    comment: logging
    end: False
    nextState:
      stateName: Approved top-up
      testCaseId: t-logging-orc-01
      provider: loggingService
      consumer: orchestrator
  - stateName: Approved top-up
    comment: finish saga process
    end: True
  - stateName: Top-up cancel
    comment: finish compensation process and finish saga
    end: True

```
:::


### PDVPS_saga_fail_CCTS-T-02

:::spoiler 點我開啟原始碼
```yaml=


CCTSVersion: "0.12"
title: PDVPS saga fail case - path not connected (service name error) - CCTS-T-02
startAt: Create top-up event
states:
  - stateName: Create top-up event
    comment: initial state
    end: False
    nextState:
      stateName: Payment process
      testCaseId: t-orc-payment-01
      provider: orchestrator
      consumer: paymentService
  - stateName: Payment process
    comment: make payment
    end: False
    options:
      - stateName: Prepare update point
        testCaseId: t-payment-orc-01
        provider: paymentService
        consumer: orchestrator
      - stateName: Payment Fail
        testCaseId: t-payment-orc-02
        provider: paymentService
        consumer: orchestrator
  - stateName: Payment Fail
    comment: do payment fail compensation
    end: False
    nextState:
      stateName: Payment reversed
      testCaseId: t-orc-payment-02
#      error
      provider: Orchestrator
      consumer: paymentService
  - stateName: Payment reversed
    comment: reverse Payment
    end: False
    nextState:
      stateName: Top-up cancel
      testCaseId: t-payment-orc-03
      provider: paymentService
      consumer: orchestrator
  - stateName: Prepare update point
    comment: orchestrator received response from payment and ready to send update point request to Point service
    end: False
    nextState:
      stateName: Update point
      testCaseId: t-orc-point-01
      provider: orchestrator
      consumer: pointService
  - stateName: Update point
    comment: do update point
    end: False
    options:
      - stateName: Prepare log
        testCaseId: t-point-orc-01
        provider: pointService
        consumer: orchestrator
      - stateName: Update point Fail
        testCaseId: t-point-orc-02
        provider: pointService
        consumer: orchestrator
  - stateName: Update point Fail
    comment: to revert points
    end: False
    nextState:
      stateName: Revert point
      testCaseId: t-orc-point-02
      provider: orchestrator
      consumer: pointService
  - stateName: Revert point
    comment: revert points
    end: False
    nextState:
      stateName: Prepare reverse payment
      testCaseId: t-point-orc-03
      provider: pointService
      consumer: orchestrator
  - stateName: Prepare reverse payment
    comment: orchestrator received response that point finished compensation , ready to do payment compensation
    end: False
    nextState:
      stateName: Payment reversed
      testCaseId: t-orc-payment-03
      provider: orchestrator
      consumer: paymentService
  - stateName: Prepare log
    comment: orchestrator ready to send Log request
    end: False
    nextState:
      stateName: Log
      testCaseId: t-orc-logging-01
      provider: orchestrator
      consumer: loggingService
  - stateName: Log
    comment: logging
    end: False
    nextState:
      stateName: Approved top-up
      testCaseId: t-logging-orc-01
      provider: loggingService
      consumer: orchestrator
  - stateName: Approved top-up
    comment: finish saga process
    end: True
  - stateName: Top-up cancel
    comment: finish compensation process and finish saga
    end: True

```

:::


### PDVPS_saga_fail_CCTS-T-03
::: spoiler 點我開啟原始碼
```yaml=
CCTSVersion: "0.12"
title: PDVPS saga fail CASE - Contract test case not exist - CCTS-T-03
startAt: Top-up Event initialized
states:
  - stateName: Top-up Event initialized
    comment: initial state
    end: False
    nextState:
      stateName: payment
#      error
      testCaseId: not exist
      provider: orchestrator
      consumer: paymentService
  - stateName: payment
    comment: make payment
    end: False
    options:
      - stateName: Payment processed
        testCaseId: t-payment-orc-01
        provider: paymentService
        consumer: orchestrator
      - stateName: Payment failed
        testCaseId: t-payment-orc-02
        provider: paymentService
        consumer: orchestrator
  - stateName: Payment failed
    comment: do payment fail compensation
    end: False
    nextState:
      stateName: Payment reversed
      testCaseId: t-orc-payment-02
      provider: orchestrator
      consumer: paymentService
  - stateName: Payment reversed
    comment: reverse Payment
    end: False
    nextState:
      stateName: Top-up canceled
      testCaseId: t-payment-orc-03
      provider: paymentService
      consumer: orchestrator
  - stateName: Payment processed
    comment: orchestrator received response from payment and ready to send update point request to Point service
    end: False
    nextState:
      stateName: point-update
      testCaseId: t-orc-point-01
      provider: orchestrator
      consumer: pointService
  - stateName: point-update
    comment: do update point
    end: False
    options:
      - stateName: Point updated
        testCaseId: t-point-orc-01
        provider: pointService
        consumer: orchestrator
      - stateName: Point-update failed
        testCaseId: t-point-orc-02
        provider: pointService
        consumer: orchestrator
  - stateName: Point-update failed
    comment: to revert points
    end: False
    nextState:
      stateName: Point-update reverted
      testCaseId: t-orc-point-02
      provider: orchestrator
      consumer: pointService
  - stateName: Point-update reverted
    comment: revert points
    end: False
    nextState:
      stateName: Point-update done
      testCaseId: t-point-orc-03
      provider: pointService
      consumer: orchestrator
  - stateName: Point-update done
    comment: orchestrator received response that point finished compensation , ready to do payment compensation
    end: False
    nextState:
      stateName: Payment reversed
      testCaseId: t-orc-payment-03
      provider: orchestrator
      consumer: paymentService
  - stateName: Point updated
    comment: orchestrator ready to send Log request
    end: False
    nextState:
      stateName: Logged
      testCaseId: t-orc-logging-01
      provider: orchestrator
      consumer: loggingService
  - stateName: Logged
    comment: logging
    end: False
    nextState:
      stateName: Approved top-up
      testCaseId: t-logging-orc-01
      provider: loggingService
      consumer: orchestrator
  - stateName: Approved top-up
    comment: finish saga process
    end: True
  - stateName: Top-up canceled
    comment: finish compensation process and finish saga
    end: True

```
:::
### PDVPS_saga_fail_CCTS-T-04
:::spoiler 點我開啟原始碼
```yaml=
CCTSVersion: "0.12"
title: PDVPS saga fail CASE - Service Contract test not pass - CCTS-T-04
startAt: Top-up Event initialized
states:
  - stateName: Top-up Event initialized
    comment: initial state
    end: False
    nextState:
      stateName: payment
      testCaseId: t-orc-payment-01
#      error
      provider: orphanService
      consumer: paymentService
  - stateName: payment
    comment: make payment
    end: False
    options:
      - stateName: Payment processed
        testCaseId: t-payment-orc-01
        provider: paymentService
        consumer: orchestrator
      - stateName: Payment failed
        testCaseId: t-payment-orc-02
        provider: paymentService
        consumer: orchestrator
  - stateName: Payment failed
    comment: do payment fail compensation
    end: False
    nextState:
      stateName: Payment reversed
      testCaseId: t-orc-payment-02
      provider: orchestrator
      consumer: paymentService
  - stateName: Payment reversed
    comment: reverse Payment
    end: False
    nextState:
      stateName: Top-up canceled
      testCaseId: t-payment-orc-03
      provider: paymentService
      consumer: orchestrator
  - stateName: Payment processed
    comment: orchestrator received response from payment and ready to send update point request to Point service
    end: False
    nextState:
      stateName: point-update
      testCaseId: t-orc-point-01
      provider: orchestrator
      consumer: pointService
  - stateName: point-update
    comment: do update point
    end: False
    options:
      - stateName: Point updated
        testCaseId: t-point-orc-01
        provider: pointService
        consumer: orchestrator
      - stateName: Point-update failed
        testCaseId: t-point-orc-02
        provider: pointService
        consumer: orchestrator
  - stateName: Point-update failed
    comment: to revert points
    end: False
    nextState:
      stateName: Point-update reverted
      testCaseId: t-orc-point-02
      provider: orchestrator
      consumer: pointService
  - stateName: Point-update reverted
    comment: revert points
    end: False
    nextState:
      stateName: Point-update done
      testCaseId: t-point-orc-03
      provider: pointService
      consumer: orchestrator
  - stateName: Point-update done
    comment: orchestrator received response that point finished compensation , ready to do payment compensation
    end: False
    nextState:
      stateName: Payment reversed
      testCaseId: t-orc-payment-03
      provider: orchestrator
      consumer: paymentService
  - stateName: Point updated
    comment: orchestrator ready to send Log request
    end: False
    nextState:
      stateName: Logged
      testCaseId: t-orc-logging-01
      provider: orchestrator
      consumer: loggingService
  - stateName: Logged
    comment: logging
    end: False
    nextState:
      stateName: Approved top-up
      testCaseId: t-logging-orc-01
      provider: loggingService
      consumer: orchestrator
  - stateName: Approved top-up
    comment: finish saga process
    end: True
  - stateName: Top-up canceled
    comment: finish compensation process and finish saga
    end: True

```
:::


### PDVPS_saga_fail_CCTS-T-05
::: spoiler 點我開啟原始碼
```yaml=

CCTSVersion: "0.12"
title: PDVPS saga fail CASE - Eventlog not found  - CCTS-T-05
startAt: Top-up Event initialized
states:
  - stateName: Top-up Event initialized
    comment: initial state
    end: False
    nextState:
      stateName: payment
      testCaseId: t-orc-payment-01
      provider: orchestrator
      consumer: paymentService
  - stateName: payment
    comment: make payment
    end: False
    options:
      - stateName: Payment processed
        testCaseId: t-payment-orc-01
        provider: paymentService
        consumer: orchestrator
      - stateName: Payment failed
        testCaseId: t-payment-orc-02
        provider: paymentService
        consumer: orchestrator
  - stateName: Payment failed
    comment: do payment fail compensation
    end: False
    nextState:
      stateName: Payment reversed
      testCaseId: t-orc-payment-02
      provider: orchestrator
      consumer: paymentService
  - stateName: Payment reversed
    comment: reverse Payment
    end: False
    nextState:
      stateName: Top-up canceled
      testCaseId: t-payment-orc-03
      provider: paymentService
      consumer: orchestrator
  - stateName: Payment processed
    comment: orchestrator received response from payment and ready to send update point request to Point service
    end: False
    nextState:
      stateName: point-update
      testCaseId: t-orc-point-01
      provider: orchestrator
      consumer: pointService
  - stateName: point-update
    comment: do update point
    end: False
    options:
      - stateName: Point updated
        testCaseId: t-point-orc-01
        provider: pointService
        consumer: orchestrator
      - stateName: Point-update failed
        testCaseId: t-point-orc-02
        provider: pointService
        consumer: orchestrator
  - stateName: Point-update failed
    comment: to revert points
    end: False
    nextState:
      stateName: Point-update reverted
      testCaseId: t-orc-point-02
      provider: orchestrator
      consumer: pointService
  - stateName: Point-update reverted
    comment: revert points
    end: False
    nextState:
      stateName: Point-update done
      testCaseId: t-point-orc-03
      provider: pointService
      consumer: orchestrator
  - stateName: Point-update done
    comment: orchestrator received response that point finished compensation , ready to do payment compensation
    end: False
    nextState:
      stateName: Payment reversed
      testCaseId: t-orc-payment-03
      provider: orchestrator
      consumer: paymentService
  - stateName: Point updated
    comment: orchestrator ready to send Log request
    end: False
    nextState:
      stateName: Logged
      testCaseId: t-orc-logging-01
      provider: orchestrator
      consumer: loggingService
  - stateName: Logged
    comment: logging
    end: False
    nextState:
      stateName: Approved top-up
      testCaseId: t-logging-orc-01
      provider: loggingService
      consumer: orchestrator
  - stateName: Approved top-up
    comment: finish saga process
    end: True
  - stateName: Top-up canceled
    comment: finish compensation process and finish saga
    end: True


```
:::


### PDVPS_saga_fail_CCTS-T-06

:::spoiler 點我開啟原始碼
```yaml=
CCTSVersion: "0.12"
title: PDVPS saga fail CASE - Eventlog composition not found  - CCTS-T-06
startAt: Top-up Event initialized
states:
  - stateName: Top-up Event initialized
    comment: initial state
    end: False
    nextState:
      stateName: payment
      testCaseId: t-orc-payment-01
      provider: orchestrator
      consumer: paymentService
  - stateName: payment
    comment: make payment
    end: False
    options:
      - stateName: Payment processed
        testCaseId: t-payment-orc-01
        provider: paymentService
        consumer: orchestrator
      - stateName: Payment failed
        testCaseId: t-payment-orc-02
        provider: paymentService
        consumer: orchestrator
  - stateName: Payment failed
    comment: do payment fail compensation
    end: False
    nextState:
      stateName: Payment reversed
      testCaseId: t-orc-payment-02
      provider: orchestrator
      consumer: paymentService
  - stateName: Payment reversed
    comment: reverse Payment
    end: False
    nextState:
      stateName: Top-up canceled
      testCaseId: t-payment-orc-03
      provider: paymentService
      consumer: orchestrator
  - stateName: Payment processed
    comment: orchestrator received response from payment and ready to send update point request to Point service
    end: False
    nextState:
      stateName: point-update
      testCaseId: t-orc-point-01
      provider: orchestrator
      consumer: pointService
  - stateName: point-update
    comment: do update point
    end: False
    options:
      - stateName: Point updated
        testCaseId: t-point-orc-01
        provider: pointService
        consumer: orchestrator
      - stateName: Point-update failed
        testCaseId: t-point-orc-02
        provider: pointService
        consumer: orchestrator
  - stateName: Point-update failed
    comment: to revert points
    end: False
    nextState:
      stateName: Point-update reverted
      testCaseId: t-orc-point-02
      provider: orchestrator
      consumer: pointService
  - stateName: Point-update reverted
    comment: revert points
    end: False
    nextState:
      stateName: Point-update done
      testCaseId: t-point-orc-03
      provider: pointService
      consumer: orchestrator
  - stateName: Point-update done
    comment: orchestrator received response that point finished compensation , ready to do payment compensation
    end: False
    nextState:
      stateName: Payment reversed
      testCaseId: t-orc-payment-03
      provider: orchestrator
      consumer: paymentService
  - stateName: Point updated
    comment: orchestrator ready to send Log request
    end: False
    nextState:
      stateName: Logged
      testCaseId: t-orc-logging-01
      provider: orchestrator
      consumer: loggingService
  - stateName: Logged
    comment: logging
    end: False
    nextState:
      stateName: Approved top-up
      testCaseId: t-logging-orc-01
      provider: loggingService
      consumer: orchestrator
  - stateName: Approved top-up
    comment: finish saga process
    end: True
  - stateName: Top-up canceled
    comment: finish compensation process and finish saga
    end: True

```
:::

### PDVPS_saga_fail_CCTS-T-07
::: spoiler 點我開啟原始碼
```yaml=
CCTSVersion: "0.12"
title: PDVPS saga pass CASE - CCTS-T-07
startAt: Top-up Event initialized
states:
  - stateName: Top-up Event initialized
    comment: initial state
    end: False
    nextState:
      stateName: payment
      testCaseId: t-orc-payment-01
      provider: orchestrator
      consumer: paymentService
  - stateName: payment
    comment: make payment
    end: False
    options:
      - stateName: Payment processed
        testCaseId: t-payment-orc-01
        provider: paymentService
        consumer: orchestrator
      - stateName: Payment failed
        testCaseId: t-payment-orc-02
        provider: paymentService
        consumer: orchestrator
  - stateName: Payment failed
    comment: do payment fail compensation
    end: False
    nextState:
      stateName: Payment reversed
      testCaseId: t-orc-payment-02
      provider: orchestrator
      consumer: paymentService
  - stateName: Payment reversed
    comment: reverse Payment
    end: False
    nextState:
      stateName: Top-up canceled
      testCaseId: t-payment-orc-03
      provider: paymentService
      consumer: orchestrator
  - stateName: Payment processed
    comment: orchestrator received response from payment and ready to send update point request to Point service
    end: False
    nextState:
      stateName: point-update
      testCaseId: t-orc-point-01
      provider: orchestrator
      consumer: pointService
  - stateName: point-update
    comment: do update point
    end: False
    options:
      - stateName: Point updated
        testCaseId: t-point-orc-01
        provider: pointService
        consumer: orchestrator
      - stateName: Point-update failed
        testCaseId: t-point-orc-02
        provider: pointService
        consumer: orchestrator
  - stateName: Point-update failed
    comment: to revert points
    end: False
    nextState:
      stateName: Point-update reverted
      testCaseId: t-orc-point-02
      provider: orchestrator
      consumer: pointService
  - stateName: Point-update reverted
    comment: revert points
    end: False
    nextState:
      stateName: Point-update done
      testCaseId: t-point-orc-03
      provider: pointService
      consumer: orchestrator
  - stateName: Point-update done
    comment: orchestrator received response that point finished compensation , ready to do payment compensation
    end: False
    nextState:
      stateName: Payment reversed
      testCaseId: t-orc-payment-03
      provider: orchestrator
      consumer: paymentService
  - stateName: Point updated
    comment: orchestrator ready to send Log request
    end: False
    nextState:
      stateName: Logged
      testCaseId: t-orc-logging-01
      provider: orchestrator
      consumer: loggingService
  - stateName: Logged
    comment: logging
    end: False
    nextState:
      stateName: Approved top-up
      testCaseId: t-logging-orc-01
      provider: loggingService
      consumer: orchestrator
  - stateName: Approved top-up
    comment: finish saga process
    end: True
  - stateName: Top-up canceled
    comment: finish compensation process and finish saga
    end: True

```
:::



## 測試結果報告
+ [測試結果報告連結](https://hackmd.io/IOM5d_kNQIqIcPGn6Yvu1A)
