Use correct gitlab header value

fixes gh-340
This commit is contained in:
Spencer Gibb
2016-02-23 13:57:50 -07:00
parent 82e009b1c2
commit f0b263fc58
3 changed files with 4 additions and 4 deletions

View File

@@ -34,7 +34,7 @@ public class GitlabPropertyPathNotificationExtractor
@Override
public PropertyPathNotification extract(MultiValueMap<String, String> headers,
Map<String, Object> 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

View File

@@ -61,7 +61,7 @@ public class CompositePropertyPathNotificationExtractorTests {
new ClassPathResource("gitlab.json").getInputStream(),
new TypeReference<Map<String, Object>>() {
});
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]);

View File

@@ -46,7 +46,7 @@ public class GitlabPropertyPathNotificationExtractorTests {
new ClassPathResource("gitlab.json").getInputStream(),
new TypeReference<Map<String, Object>>() {
});
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<Map<String, Object>>() {
});
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);
}