From f0b263fc585e950f1efe92cc026d70f9baf0f6d0 Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Tue, 23 Feb 2016 13:57:50 -0700 Subject: [PATCH] Use correct gitlab header value fixes gh-340 --- .../monitor/GitlabPropertyPathNotificationExtractor.java | 2 +- .../CompositePropertyPathNotificationExtractorTests.java | 2 +- .../monitor/GitlabPropertyPathNotificationExtractorTests.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-cloud-config-monitor/src/main/java/org/springframework/cloud/config/monitor/GitlabPropertyPathNotificationExtractor.java b/spring-cloud-config-monitor/src/main/java/org/springframework/cloud/config/monitor/GitlabPropertyPathNotificationExtractor.java index b9796776..bdf35ab1 100644 --- a/spring-cloud-config-monitor/src/main/java/org/springframework/cloud/config/monitor/GitlabPropertyPathNotificationExtractor.java +++ b/spring-cloud-config-monitor/src/main/java/org/springframework/cloud/config/monitor/GitlabPropertyPathNotificationExtractor.java @@ -34,7 +34,7 @@ public class GitlabPropertyPathNotificationExtractor @Override public PropertyPathNotification extract(MultiValueMap headers, Map request) { - if ("Push Event".equals(headers.getFirst("X-Gitlab-Event"))) { + if ("Push Hook".equals(headers.getFirst("X-Gitlab-Event"))) { if (request.get("commits") instanceof Collection) { // Gitlab doesn't tell us the files that changed so this is a broadcast to // all apps diff --git a/spring-cloud-config-monitor/src/test/java/org/springframework/cloud/config/monitor/CompositePropertyPathNotificationExtractorTests.java b/spring-cloud-config-monitor/src/test/java/org/springframework/cloud/config/monitor/CompositePropertyPathNotificationExtractorTests.java index 99c84f92..4734c6d6 100644 --- a/spring-cloud-config-monitor/src/test/java/org/springframework/cloud/config/monitor/CompositePropertyPathNotificationExtractorTests.java +++ b/spring-cloud-config-monitor/src/test/java/org/springframework/cloud/config/monitor/CompositePropertyPathNotificationExtractorTests.java @@ -61,7 +61,7 @@ public class CompositePropertyPathNotificationExtractorTests { new ClassPathResource("gitlab.json").getInputStream(), new TypeReference>() { }); - this.headers.set("X-Gitlab-Event", "Push Event"); + this.headers.set("X-Gitlab-Event", "Push Hook"); PropertyPathNotification extracted = this.extractor.extract(this.headers, value); assertNotNull(extracted); assertEquals("application.yml", extracted.getPaths()[0]); diff --git a/spring-cloud-config-monitor/src/test/java/org/springframework/cloud/config/monitor/GitlabPropertyPathNotificationExtractorTests.java b/spring-cloud-config-monitor/src/test/java/org/springframework/cloud/config/monitor/GitlabPropertyPathNotificationExtractorTests.java index 38c8f72a..dcec2a46 100644 --- a/spring-cloud-config-monitor/src/test/java/org/springframework/cloud/config/monitor/GitlabPropertyPathNotificationExtractorTests.java +++ b/spring-cloud-config-monitor/src/test/java/org/springframework/cloud/config/monitor/GitlabPropertyPathNotificationExtractorTests.java @@ -46,7 +46,7 @@ public class GitlabPropertyPathNotificationExtractorTests { new ClassPathResource("gitlab.json").getInputStream(), new TypeReference>() { }); - this.headers.set("X-Gitlab-Event", "Push Event"); + this.headers.set("X-Gitlab-Event", "Push Hook"); PropertyPathNotification extracted = this.extractor.extract(this.headers, value); assertNotNull(extracted); assertEquals("application.yml", extracted.getPaths()[0]); @@ -59,7 +59,7 @@ public class GitlabPropertyPathNotificationExtractorTests { new ClassPathResource("gitlab.json").getInputStream(), new TypeReference>() { }); - this.headers.set("X-Gitlab-Event", "Issue Event"); + this.headers.set("X-Gitlab-Event", "Issue Hook"); PropertyPathNotification extracted = this.extractor.extract(this.headers, value); assertNull(extracted); }