Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: adds CRUD integration types and test cases #46

Merged
merged 9 commits into from
Dec 23, 2024

Conversation

ashwiniag
Copy link
Member

@ashwiniag ashwiniag commented Dec 20, 2024

closes #45

Introduces

As follows

Method Endpoint Description cURL Command
POST      
Create /integrationtypes Create a new integration type. curl -X POST http://localhost:8000/api/v1/integrationtypes -H "Authorization: Bearer letsdoit" -H "Content-Type: application/json" -d '{"id": "linear", "display_name": "Linear Integration"}'
GET      
Read (List) /integrationtypes List all integration types. curl -X GET http://localhost:8000/api/v1/integrationtypes -H "Authorization: Bearer letsdoit" -H "Content-Type: application/json"
GET      
Read (Detail) /integrationtypes/{id} Get details of a specific integration type. curl -X GET http://localhost:8000/api/v1/integrationtypes/linear -H "Authorization: Bearer letsdoit" -H "Content-Type: application/json"
PUT      
Update /integrationtypes/{id} Update an integration type by ID. curl -X PUT http://localhost:8000/api/v1/integrationtypes/linear -H "Authorization: Bearer letsdoit" -H "Content-Type: application/json" -d '{"display_name": "Updated Linear Integration"}'

POST /integrationtypes

Test Case Description Error Handling
Valid Input Ensure a new integration type is created successfully. ✅ response id and display_name.
Missing Required Fields Verify error when id or display_name is not provided. ✅ 400 Bad Request. ✅
Invalid ID Format Verify error when id has invalid format (uppercase, spaces, special characters). ✅ 400 Bad Request. ✅
Duplicate ID Verify error when id already exists. ✅ 409 Conflict. ✅

GET /integrationtypes/{id}

Test Case Description Error Handling
Valid ID Verify response when a valid id is provided. ✅ response id and display_name.
Non-existent ID Verify error when a non-existent id is provided. ✅ 404 Not Found. ✅
Invalid ID Format Verify error when id has invalid format (uppercase, spaces, special characters). ✅ 400 Bad Request. ✅

GET /integrationtypes

Test Case Description Error Handling
Valid Request Ensure all integration types are listed correctly. ✅ List of object integration types.
Empty Database Verify response when no integration types exist. ✅ Empty list.

PUT /integrationtypes/{id}

Test Case Description Error Handling
Valid Update Ensure the integration type is updated correctly with valid input. ✅ Updated response id display_name.
Invalid ID Format Verify error when id has invalid format (uppercase, spaces, special characters). ✅ 400 Bad Request. ✅
Non-existent ID Verify error when a non-existent id is provided for update. ✅ 404 Not Found. ✅
No Fields to Update Verify error when no fields are provided in the update request. ✅ 400 Bad Request. ✅

@ashwiniag ashwiniag requested a review from scriptnull December 21, 2024 11:31
@ashwiniag ashwiniag merged commit d5b9a3c into main Dec 23, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

api: crud operation and test cases for IntegrationTypes
1 participant