-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6be977
commit fc5306c
Showing
24 changed files
with
1,167 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,23 @@ | ||
When reporting a bug, please try to provide as much information as possible. | ||
|
||
* Plugin version used. | ||
* Your configuration: | ||
* A response of an invocation with `curl`, there are examples in the README. | ||
* Or other detailed information of the configuration. | ||
* Your configuration. | ||
* Variables configured, names, expressions... | ||
* Post content received. It can be found in the job execution log. People using GitHub often forget to set the content type in "Manage webhook" when configuring the webhook at GitHub. | ||
* A `curl` command and its response. | ||
* Expected result and actual result. | ||
|
||
You may also have a look at the test cases as they should answer the most common questions: | ||
|
||
https://github.com/jenkinsci/generic-webhook-trigger-plugin/tree/master/src/test/resources/org/jenkinsci/plugins/gwt/bdd | ||
|
||
If you are fiddling with expressions, you may want to checkout: | ||
|
||
* [This JSONPath site](https://jsonpath.curiousconcept.com/) | ||
* [This XPath site](http://www.freeformatter.com/xpath-tester.html) | ||
* [This regexp site](https://jex.im/regulex/) | ||
|
||
A Curl command can look something like this: | ||
``` | ||
curl -v -H "Content-Type: application/json" -X POST -d '{ "app":{ "name":"GitHub API", "url":"http://developer.github.com/v3/oauth/" }}' http://localhost:8080/jenkins/generic-webhook-trigger/invoke?token=sometoken | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
src/test/java/org/jenkinsci/plugins/gwt/bdd/FeatureState.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
package org.jenkinsci.plugins.gwt.bdd; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import org.jenkinsci.plugins.gwt.GenericHeaderVariable; | ||
import org.jenkinsci.plugins.gwt.GenericRequestVariable; | ||
import org.jenkinsci.plugins.gwt.GenericVariable; | ||
|
||
public class FeatureState { | ||
private Map<String, List<String>> headers = new HashMap<>(); | ||
private Map<String, String[]> parameterMap = new HashMap<>(); | ||
private String postContent; | ||
private List<GenericVariable> genericVariables = new ArrayList<>(); | ||
private List<GenericRequestVariable> genericRequestVariables = new ArrayList<>(); | ||
private List<GenericHeaderVariable> genericHeaderVariables = new ArrayList<>(); | ||
private String regexpFilterText; | ||
private String regexpFilterExpression; | ||
|
||
public Map<String, List<String>> getHeaders() { | ||
return headers; | ||
} | ||
|
||
public void setHeaders(final Map<String, List<String>> headers) { | ||
this.headers = headers; | ||
} | ||
|
||
public Map<String, String[]> getParameterMap() { | ||
return parameterMap; | ||
} | ||
|
||
public void setParameterMap(final Map<String, String[]> parameterMap) { | ||
this.parameterMap = parameterMap; | ||
} | ||
|
||
public String getPostContent() { | ||
return postContent; | ||
} | ||
|
||
public void setPostContent(final String postContent) { | ||
this.postContent = postContent; | ||
} | ||
|
||
public List<GenericVariable> getGenericVariables() { | ||
return genericVariables; | ||
} | ||
|
||
public void setGenericVariables(final List<GenericVariable> genericVariables) { | ||
this.genericVariables = genericVariables; | ||
} | ||
|
||
public List<GenericRequestVariable> getGenericRequestVariables() { | ||
return genericRequestVariables; | ||
} | ||
|
||
public void setGenericRequestVariables( | ||
final List<GenericRequestVariable> genericRequestVariables) { | ||
this.genericRequestVariables = genericRequestVariables; | ||
} | ||
|
||
public List<GenericHeaderVariable> getGenericHeaderVariables() { | ||
return genericHeaderVariables; | ||
} | ||
|
||
public void setGenericHeaderVariables(final List<GenericHeaderVariable> genericHeaderVariables) { | ||
this.genericHeaderVariables = genericHeaderVariables; | ||
} | ||
|
||
public String getRegexpFilterText() { | ||
return regexpFilterText; | ||
} | ||
|
||
public void setRegexpFilterText(final String regexpFilterText) { | ||
this.regexpFilterText = regexpFilterText; | ||
} | ||
|
||
public String getRegexpFilterExpression() { | ||
return regexpFilterExpression; | ||
} | ||
|
||
public void setRegexpFilterExpression(final String regexpFilterExpression) { | ||
this.regexpFilterExpression = regexpFilterExpression; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "FeatureState [headers=" | ||
+ headers | ||
+ ", parameterMap=" | ||
+ parameterMap | ||
+ ", postContent=" | ||
+ postContent | ||
+ ", genericVariables=" | ||
+ genericVariables | ||
+ ", genericRequestVariables=" | ||
+ genericRequestVariables | ||
+ ", genericHeaderVariables=" | ||
+ genericHeaderVariables | ||
+ ", regexpFilterText=" | ||
+ regexpFilterText | ||
+ ", regexpFilterExpression=" | ||
+ regexpFilterExpression | ||
+ "]"; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/test/java/org/jenkinsci/plugins/gwt/bdd/GenericFilterPojo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.jenkinsci.plugins.gwt.bdd; | ||
|
||
public class GenericFilterPojo { | ||
private String expression; | ||
private String text; | ||
|
||
public String getExpression() { | ||
return expression; | ||
} | ||
|
||
public void setExpression(final String expression) { | ||
this.expression = expression; | ||
} | ||
|
||
public String getText() { | ||
return text; | ||
} | ||
|
||
public void setText(final String text) { | ||
this.text = text; | ||
} | ||
} |
Oops, something went wrong.