Skip to content

Uc003 Retrieve Task By Id

# specs/features/UC003-retrieve-task-by-id.feature
#
# SINGLE SOURCE OF TRUTH for UC003 behaviour.
# This file is:
#   (1) referenced by specs/use_cases/UC003-retrieve-task-by-id.md  (documentation)
#   (2) executed by the acceptance test suite                        (living documentation)
#
# Rules:
#   - Scenario IDs (e.g. UC003-S01) must match the use case document.
#   - Step definitions live in: src/test/java/.../steps/
#   - Keep scenarios focused: one behaviour per scenario.
#   - Use exact terms from specs/glossary.md.

Feature: Retrieve Task by ID
  As a User
  I want to retrieve a single Task by its ID
  So that I can view or edit its full details

  Background:
    Given a task exists with title "Fix login bug", status "TODO", and id stored as "existingTaskId"

  # ---------------------------------------------------------------------------
  # Happy path
  # ---------------------------------------------------------------------------

  Scenario: UC003-S01 Successfully retrieve an existing task by ID
    When the User requests the task with id "existingTaskId"
    Then the response status is 200
    And the response contains a task with title "Fix login bug"
    And the response contains a task with status "TODO"
    And the response contains a task with id "existingTaskId"

  # ---------------------------------------------------------------------------
  # Not found
  # ---------------------------------------------------------------------------

  Scenario: UC003-S02 Return 404 when task does not exist
    When the User requests the task with id 999999
    Then the response status is 404
    And the response error code is "TASK_NOT_FOUND"