Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 0 additions & 119 deletions CHANGELOG/CHANGELOG-r1.md

This file was deleted.

3 changes: 0 additions & 3 deletions CHANGELOG/README.md

This file was deleted.

147 changes: 147 additions & 0 deletions code/API_definitions/release-test-notifications.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
openapi: 3.0.3
info:
title: Release Test Notifications
description: |
Test API for notification subscription management.
This is not a real API — it exists solely for validation framework testing.
version: wip
x-camara-commonalities: 0.6
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
externalDocs:
description: Product documentation at CAMARA
url: https://github.com/camaraproject/TestRepo
servers:
- url: "{apiRoot}/release-test-notifications/vwip"
variables:
apiRoot:
default: https://localhost:443
description: API root
tags:
- name: Subscriptions
description: Subscription management operations
paths:
/subscriptions:
post:
operationId: CreateSubscription

Check notice on line 27 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

S-007

Operation Id must be in Camel case "must be camel case"
summary: Create a new notification subscription
description: Creates a subscription for receiving event notifications via webhook callback.
tags:

Check failure on line 30 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

Y-012

trailing spaces

Check failure on line 30 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / pr_validation / PR Validation

30:12 [trailing-spaces] trailing spaces
- Subscriptions
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/subscriptionRequest"
responses:
"201":
description: Subscription created
content:
application/json:
schema:
$ref: "#/components/schemas/Subscription"
get:

Check failure on line 45 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

Y-012

trailing spaces

Check failure on line 45 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / pr_validation / PR Validation

45:9 [trailing-spaces] trailing spaces
operationId: listSubscriptions
summary: List subscriptions
description: Returns a list of active notification subscriptions.
tags:
- Subscriptions
parameters:
- name: pageSize

Check warning on line 52 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

S-009

Parameter description is missing or empty%3A "[0].description" property must be truthy
in: query
schema:
type: integer
minimum: 1
maximum: 100
responses:
"200":
description: Subscriptions listed
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Subscription"
/subscriptions/{subscriptionId}:
get:
operationId: getSubscription
summary: Get a specific subscription
description: Returns a single notification subscription by its identifier. This description is intentionally very long to trigger a line length warning from yamllint because it exceeds the typical maximum character limit configured in the CAMARA yamllint configuration
tags:
- Subscriptions
parameters:
- name: subscriptionId

Check warning on line 75 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

S-009

Parameter description is missing or empty%3A "[0].description" property must be truthy
in: path
required: true
schema:
type: string
responses:
"200":
description: Subscription details
content:
application/json:
schema:
$ref: "#/components/schemas/Subscription"
delete:
operationId: deleteSubscription
summary: Delete a subscription
description: Deletes a notification subscription. No further events will be delivered.
tags:
- Subscriptions
parameters:
- name: subscriptionId

Check warning on line 94 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

S-009

Parameter description is missing or empty%3A "[0].description" property must be truthy

Check failure on line 94 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

S-227

Path parameter "subscriptionId" must have "required" property that is set to "true".
in: path
required: yes

Check failure on line 96 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

S-209

"required" property must be boolean.

Check failure on line 96 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

S-209

"required" property must be equal to constant.

Check failure on line 96 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

Y-013

truthy value should be one of [false, true]

Check failure on line 96 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / pr_validation / PR Validation

96:21 [truthy] truthy value should be one of [false, true]
schema:
type: string
responses:
"204":
description: Subscription deleted
components:
schemas:
subscriptionRequest:

Check warning on line 104 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

S-015

subscriptionRequest should be pascal case (UppperCamelCase)

Check warning on line 104 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

S-011

Property description is missing or empty%3A "subscriptionRequest.description" property must be truthy
type: object
required:
- webhook
- eventTypes
properties:
webhook:

Check warning on line 110 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

S-011

Property description is missing or empty%3A "webhook.description" property must be truthy
type: object
required:
- notificationUrl
properties:
notificationUrl:
type: string
format: uri
description: The URL to receive event notifications.
eventTypes:
type: array
items:
type: string
description: List of event types to subscribe to.
Subscription:

Check warning on line 124 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

S-011

Property description is missing or empty%3A "Subscription.description" property must be truthy
type: object
properties:
id:
type: string
description: Unique subscription identifier.
webhook:

Check warning on line 130 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

S-011

Property description is missing or empty%3A "webhook.description" property must be truthy
type: object
properties:
notificationUrl:
type: string
format: uri
eventTypes:

Check warning on line 136 in code/API_definitions/release-test-notifications.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

S-011

Property description is missing or empty%3A "eventTypes.description" property must be truthy
type: array
items:
type: string
startsAt:
type: string
format: date-time
description: Subscription activation timestamp.
expiresAt:
type: string
format: date-time
description: Subscription expiration timestamp.
31 changes: 30 additions & 1 deletion code/API_definitions/release-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,19 @@
tags:
- name: Status
description: Service status operations
paths:
paths:

Check failure on line 24 in code/API_definitions/release-test.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

Y-012

trailing spaces

Check failure on line 24 in code/API_definitions/release-test.yaml

View workflow job for this annotation

GitHub Actions / pr_validation / PR Validation

24:7 [trailing-spaces] trailing spaces
/status:
get:
operationId: getStatus
summary: Get service status
description: Returns the current status of the release test service.
tags:
- Status
parameters:
- name: verbose
in: query
schema:
type: boolean
responses:
"200":
description: Service is running
Expand All @@ -41,3 +46,27 @@
type: string
enum:
- available
/status/{id}:
get:
operationId: getStatusById
summary: Get status for a specific component
tags:
- Status
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
"200":
description: Component status
content:
application/json:
schema:
type: object
properties:
componentName:
type: string
status:
type: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Feature: CAMARA Release Test Notifications API, vwip - Operation: createSubscription

# Input to be provided by the implementation to the tests
# References to OAS spec schemas refer to schemas specified in
# /code/API_definitions/release-test-notifications.yaml

Background: Common createSubscription setup
Given an environment at "apiRoot"
And the resource "/release-test-notifications/vwip/subscriptions"
And the header "Authorization" is set to a valid access token
And the header "Content-Type" is set to "application/json"

# Success scenarios

@ReleaseTest_Notifications_createSubscription_201.01_success
Scenario: Create subscription successfully
Given the request body is set to a valid subscription request
When the HTTPS "POST" request is sent
Then the response status code is 201
And the response header "Content-Type" is "application/json"
And the response property "$.id" exists
And the response property "$.webhook.notificationUrl" exists

# Error scenarios

@ReleaseTest_Notifications_createSubscription_400.01_missing_webhook
Scenario: Error response for missing webhook field
Given the request body property "$.webhook" is not included
When the HTTPS "POST" request is sent
Then the response status code is 400
And the response header "Content-Type" is "application/json"
And the response property "$.status" is 400
And the response property "$.code" is "INVALID_ARGUMENT"
And the response property "$.message" exists

@ReleaseTest_Notifications_createSubscription_401.01_no_authorization
Scenario: Error response for missing authorization header
Given the header "Authorization" is not set
When the HTTPS "POST" request is sent
Then the response status code is 401
And the response property "$.status" is 401
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" exists

Scenario: Error response for invalid event type
Given the request body property "$.eventTypes[0]" is set to "INVALID_EVENT"
When the HTTPS "POST" request is sent
Then the response status code is 400
And the response property "$.code" is "INVALID_ARGUMENT"


@ReleaseTest_Notifications_createSubscription_201.01_success
Scenario: Create subscription with all fields
Given the request body is set to a valid subscription request with all optional fields
When the HTTPS "POST" request is sent
Then the response status code is 201
And the response property "$.id" exists
And the response property "$.startsAt" exists
And the response property "$.expiresAt" exists
Loading