Skip to content

Commit

Permalink
chore: refactor test for unsupported yaml extension
Browse files Browse the repository at this point in the history
  • Loading branch information
kostas-petrakis committed Nov 5, 2024
1 parent 5735520 commit 507f204
Showing 1 changed file with 2 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class WebhookEventServiceTest {
}

@Test
fun `should handle push event with supported YAML extension`() {
fun `should handle push event only with supported YAML extension`() {
val payload = """{
"repository": {
"name": "repo",
Expand Down Expand Up @@ -300,27 +300,6 @@ class WebhookEventServiceTest {
)
)
}
}

@Test
fun `should not handle push event with unsupported YAML extension`() {
val payload = """{
"repository": {
"name": "repo",
"full_name": "owner/repo",
"owner": {"name": "owner"},
"default_branch": "main"
},
"head_commit": {
"added": ["custom/path/added1/$UNSUPPORTED_MANIFEST_EXTENSION"],
"modified": [],
"removed": []
},
"installation": {"id": 1},
"ref": "refs/heads/main"
}"""

webhookEventService.consumeWebhookEvent("PUSH", payload)

verify(exactly = 0) {
webSocketService.sendMessage(
Expand All @@ -329,7 +308,7 @@ class WebhookEventServiceTest {
"owner/repo",
ManifestFileAction.ADDED,
"content",
"custom/path/added1/$MANIFEST_FILE_NAME"
"custom/path/added1/$UNSUPPORTED_MANIFEST_EXTENSION"
)
)
}
Expand Down

0 comments on commit 507f204

Please sign in to comment.