Skip to content

Commit

Permalink
Added test cases in update event and task
Browse files Browse the repository at this point in the history
  • Loading branch information
Raj-Shah1 committed Oct 27, 2023
1 parent eaaf3f7 commit 2dd7180
Show file tree
Hide file tree
Showing 2 changed files with 210 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -1,43 +1,105 @@
[
{
"description": "Should successfully update the event for given event id",
"input": {
"body": {
"description":"Create Event",
"start_datetime": "2023-07-21T13:12:17.000+0000",
"end_datetime": "2023-07-22T13:12:17.000+0000"
},
"accountId": "0011e00000bWSxdAAG",
"eventId":"0691e000001X1yTAAS"
{
"description": "Should successfully update the event for given event id",
"input": {
"body": {
"description":"Create Event",
"start_datetime": "2023-07-21T13:12:17.000+0000",
"end_datetime": "2023-07-22T13:12:17.000+0000"
},
"mocks": {
"makeCompositeRequest": {
"compositeResponse": [
{
"body": null,
"httpHeaders": {},
"httpStatusCode": 200,
"referenceId": "UpdateEvent"
}
]
}
"accountId": "0011e00000bWSxdAAG",
"eventId":"0691e000001X1yTAAS"
},
"mocks": {
"makeCompositeRequest": {
"compositeResponse": [
{
"body": null,
"httpHeaders": {},
"httpStatusCode": 200,
"referenceId": "UpdateEvent"
}
]
}
},
"output": {}
},
{
"description": "Should fail when event task description is not provided",
"input": {
"body": {
"start_datetime": "2023-07-21T13:12:17.000+0000",
"end_datetime": "2023-07-22T13:12:17.000+0000"
},
"accountId": "0011e00000bWSxdAAG"
},
"mocks": {},
"output": {
"http_code": 400,
"message": "At least one parameter is invalid or missing.",
"code": "INVALID_PARAMS",
"internal_error_identifier": "b_2",
"param_errors": [
"missing_description"
]
}
},
{
"description": "Should fail when the event start_datetime is invalid",
"input": {
"body": {
"description":"Create Event",
"start_datetime": "2023-07-21",
"end_datetime": "2023-07-22T13:12:17.000+0000"
},
"output": {}
"accountId": "0011e00000bWSxdAAG"
},
{
"description": "should return error response when event id is invalid",
"input": {
"body": {
"description":"Create Event",
"start_datetime": "2023-07-21T13:12:17.000+0000",
"end_datetime": "2023-07-22T13:12:17.000+0000"
},
"accountId": "0011e00000bWSxdAAG",
"eventId":"invalidEventId"
"mocks": {},
"output": {
"http_code": 400,
"message": "At least one parameter is invalid or missing.",
"code": "INVALID_PARAMS",
"internal_error_identifier": "b_2",
"param_errors": [
"invalid_start_datetime"
]
}
},
{
"description": "Should fail when the event end_datetime is invalid",
"input": {
"body": {
"description":"Create Event",
"start_datetime": "2023-07-22T13:12:17.000+0000",
"end_datetime": "2023-07-22T13:12.000+0000"
},
"accountId": "0011e00000bWSxdAAG"
},
"mocks": {},
"output": {
"http_code": 400,
"message": "At least one parameter is invalid or missing.",
"code": "INVALID_PARAMS",
"internal_error_identifier": "b_2",
"param_errors": [
"invalid_end_datetime"
]
}
},
{
"description": "should return error response when event id is invalid",
"input": {
"body": {
"description":"Create Event",
"start_datetime": "2023-07-21T13:12:17.000+0000",
"end_datetime": "2023-07-22T13:12:17.000+0000"
},
"mocks": {
"makeCompositeRequest": {
"compositeResponse": [
"accountId": "0011e00000bWSxdAAG",
"eventId":"invalidEventId"
},
"mocks": {
"makeCompositeRequest": {
"compositeResponse": [
{
"body": [
{
Expand All @@ -51,15 +113,15 @@
}
]
}
},
"output": {
"http_code": 400,
"message": "At least one parameter is invalid or missing.",
"code": "INVALID_PARAMS",
"internal_error_identifier": "l_ua_uae_usae_pr_1",
"param_errors": [
"invalid_event_id"
]
}
},
"output": {
"http_code": 400,
"message": "At least one parameter is invalid or missing.",
"code": "INVALID_PARAMS",
"internal_error_identifier": "l_ua_uae_usae_pr_1",
"param_errors": [
"invalid_event_id"
]
}
]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,108 @@
},
"output": {}
},
{
"description": "Should fail when the task description is empty",
"input": {
"body": {
"crm_organization_user_id":"0011e00000bWSxdAA1",
"description":"",
"due_date":"2023-12-01"
},
"accountId": "0011e00000bWSxdAAG"
},
"mocks": {},
"output": {
"http_code": 400,
"message": "At least one parameter is invalid or missing.",
"code": "INVALID_PARAMS",
"internal_error_identifier": "b_2",
"param_errors": [
"missing_description"
]
}
},
{
"description": "Should fail when the task description is not provided",
"input": {
"body": {
"crm_organization_user_id":"0011e00000bWSxdAA1",
"due_date":"2023-12-01"
},
"accountId": "0011e00000bWSxdAAG"
},
"mocks": {},
"output": {
"http_code": 400,
"message": "At least one parameter is invalid or missing.",
"code": "INVALID_PARAMS",
"internal_error_identifier": "b_2",
"param_errors": [
"missing_description"
]
}
},
{
"description": "Should fail when the task due_date is not provided",
"input": {
"body": {
"crm_organization_user_id":"0011e00000bWSxdAA1",
"description":"Update remaining documentations"
},
"accountId": "0011e00000bWSxdAAG"
},
"mocks": {},
"output": {
"http_code": 400,
"message": "At least one parameter is invalid or missing.",
"code": "INVALID_PARAMS",
"internal_error_identifier": "b_2",
"param_errors": [
"invalid_due_date"
]
}
},
{
"description": "Should fail when the task crm_organization_user_id is not provided",
"input": {
"body": {
"description":"Update remaining documentations",
"due_date":"2023-12-01"
},
"accountId": "0011e00000bWSxdAAG"
},
"mocks": {},
"output": {
"http_code": 400,
"message": "At least one parameter is invalid or missing.",
"code": "INVALID_PARAMS",
"internal_error_identifier": "b_2",
"param_errors": [
"missing_crm_organization_user_id"
]
}
},
{
"description": "Should fail when the task Due is not valid",
"input": {
"body": {
"crm_organization_user_id":"0011e00000bWSxdAA1",
"description":"Update remaining documentations",
"due_date":"2023-120-01"
},
"accountId": "0011e00000bWSxdAAG"
},
"mocks": {},
"output": {
"http_code": 400,
"message": "At least one parameter is invalid or missing.",
"code": "INVALID_PARAMS",
"internal_error_identifier": "b_2",
"param_errors": [
"invalid_due_date"
]
}
},
{
"description": "should return error response when task id is invalid",
"input": {
Expand Down

0 comments on commit 2dd7180

Please sign in to comment.