diff --git a/gate-web/src/test/groovy/com/netflix/spinnaker/gate/controllers/WebhookControllerSpec.groovy b/gate-web/src/test/groovy/com/netflix/spinnaker/gate/controllers/WebhookControllerSpec.groovy index 74f80b3669..c1c987a77a 100644 --- a/gate-web/src/test/groovy/com/netflix/spinnaker/gate/controllers/WebhookControllerSpec.groovy +++ b/gate-web/src/test/groovy/com/netflix/spinnaker/gate/controllers/WebhookControllerSpec.groovy @@ -91,4 +91,16 @@ class WebhooksControllerSpec extends Specification { NestedServletException ex = thrown() ex.message.startsWith("Request processing failed; nested exception is retrofit.RetrofitError: Failed to connect to localhost") } + + void 'handles CDEvents API with BAD_REQUEST'() { + given: + + when: + MockHttpServletResponse response = mockMvc.perform(post("/webhooks/cdevents/artifactPackaged") + .accept(MediaType.APPLICATION_JSON)) + .andReturn().response + + then: + response.status == 400 + } }