|
| 1 | +/* |
| 2 | + * The MIT License |
| 3 | + * |
| 4 | + * Copyright (c) 2024 strangelookingnerd |
| 5 | + * |
| 6 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | + * of this software and associated documentation files (the "Software"), to deal |
| 8 | + * in the Software without restriction, including without limitation the rights |
| 9 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 | + * copies of the Software, and to permit persons to whom the Software is |
| 11 | + * furnished to do so, subject to the following conditions: |
| 12 | + * |
| 13 | + * The above copyright notice and this permission notice shall be included in |
| 14 | + * all copies or substantial portions of the Software. |
| 15 | + * |
| 16 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 22 | + * THE SOFTWARE. |
| 23 | + */ |
| 24 | + |
1 | 25 | package io.jenkins.plugins.httpclient5;
|
2 | 26 |
|
3 | 27 | import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
6 | 30 | import org.apache.hc.client5.http.fluent.Request;
|
7 | 31 | import org.apache.hc.client5.http.fluent.Response;
|
8 | 32 | import org.apache.hc.core5.http.HttpStatus;
|
9 |
| -import org.junit.jupiter.api.Test; |
| 33 | +import org.junit.Rule; |
| 34 | +import org.junit.Test; |
10 | 35 | import org.jvnet.hudson.test.JenkinsRule;
|
11 |
| -import org.jvnet.hudson.test.junit.jupiter.WithJenkins; |
| 36 | +import org.jvnet.hudson.test.RealJenkinsRule; |
| 37 | + |
| 38 | +public class SmokeTest { |
12 | 39 |
|
13 |
| -@WithJenkins |
14 |
| -class SmokeTest { |
| 40 | + @Rule |
| 41 | + public RealJenkinsRule rr = new RealJenkinsRule(); |
15 | 42 |
|
16 | 43 | @Test
|
17 |
| - void smokeTest(JenkinsRule r) throws Exception { |
| 44 | + public void smokeTest() throws Throwable { |
| 45 | + rr.then(SmokeTest::_smokeTest); |
| 46 | + } |
| 47 | + |
| 48 | + private static void _smokeTest(JenkinsRule r) throws Exception { |
18 | 49 | URI uri = r.getURL().toURI();
|
19 | 50 | Response response = Request.get(uri).execute();
|
20 | 51 | assertEquals(HttpStatus.SC_OK, response.returnResponse().getCode());
|
|
0 commit comments