File tree Expand file tree Collapse file tree
jenkins-client/src/main/java/com/offbytwo/jenkins/model Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99import java .io .IOException ;
1010
11+ import org .apache .http .HttpStatus ;
1112import org .apache .http .client .HttpResponseException ;
1213
1314public class Build extends BaseModel {
@@ -122,6 +123,7 @@ public TestReport getTestReport() throws IOException {
122123 * @throws IOException in case of an error.
123124 */
124125 public TestResult getTestResult () throws IOException {
126+
125127 return client .get (this .getUrl () + "/testReport/?depth=1" , TestResult .class );
126128 }
127129
@@ -141,7 +143,7 @@ public String Stop() throws HttpResponseException, IOException {
141143
142144 return client .get (url + "stop" );
143145 } catch (HttpResponseException ex ) {
144- if (ex .getStatusCode () == 405 ) {
146+ if (ex .getStatusCode () == HttpStatus . SC_METHOD_NOT_ALLOWED ) {
145147 stopPost ();
146148 return "" ;
147149 }
@@ -164,7 +166,7 @@ public String Stop(boolean crumbFlag) throws HttpResponseException, IOException
164166
165167 return client .get (url + "stop" );
166168 } catch (HttpResponseException ex ) {
167- if (ex .getStatusCode () == 405 ) {
169+ if (ex .getStatusCode () == HttpStatus . SC_METHOD_NOT_ALLOWED ) {
168170 stopPost (crumbFlag );
169171 return "" ;
170172 }
You can’t perform that action at this time.
0 commit comments