diff --git a/pom.xml b/pom.xml index ee69c41e..3e857f4c 100644 --- a/pom.xml +++ b/pom.xml @@ -70,9 +70,9 @@ 2.4.4 - commons-httpclient - commons-httpclient - 3.1 + org.apache.httpcomponents + httpclient + 4.3.2 org.json diff --git a/src/test/java/jenkins/plugins/slack/HttpClientStub.java b/src/test/java/jenkins/plugins/slack/HttpClientStub.java deleted file mode 100644 index f6de0935..00000000 --- a/src/test/java/jenkins/plugins/slack/HttpClientStub.java +++ /dev/null @@ -1,34 +0,0 @@ -package jenkins.plugins.slack; - -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HttpMethod; -import org.apache.commons.httpclient.HttpStatus; - -public class HttpClientStub extends HttpClient { - - private int numberOfCallsToExecuteMethod; - private int httpStatus; - private boolean failAlternateResponses = false; - - @Override - public int executeMethod(HttpMethod httpMethod) { - numberOfCallsToExecuteMethod++; - if (failAlternateResponses && (numberOfCallsToExecuteMethod % 2 == 0)) { - return HttpStatus.SC_NOT_FOUND; - } else { - return httpStatus; - } - } - - public int getNumberOfCallsToExecuteMethod() { - return numberOfCallsToExecuteMethod; - } - - public void setHttpStatus(int httpStatus) { - this.httpStatus = httpStatus; - } - - public void setFailAlternateResponses(boolean failAlternateResponses) { - this.failAlternateResponses = failAlternateResponses; - } -}