Use correct gitlab header value
fixes gh-340
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user