Skip to content

Commit c5a075a

Browse files
Add valid smoke test
1 parent 77252fb commit c5a075a

File tree

1 file changed

+36
-5
lines changed

1 file changed

+36
-5
lines changed

src/test/java/io/jenkins/plugins/httpclient5/SmokeTest.java

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
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+
125
package io.jenkins.plugins.httpclient5;
226

327
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -6,15 +30,22 @@
630
import org.apache.hc.client5.http.fluent.Request;
731
import org.apache.hc.client5.http.fluent.Response;
832
import org.apache.hc.core5.http.HttpStatus;
9-
import org.junit.jupiter.api.Test;
33+
import org.junit.Rule;
34+
import org.junit.Test;
1035
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 {
1239

13-
@WithJenkins
14-
class SmokeTest {
40+
@Rule
41+
public RealJenkinsRule rr = new RealJenkinsRule();
1542

1643
@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 {
1849
URI uri = r.getURL().toURI();
1950
Response response = Request.get(uri).execute();
2051
assertEquals(HttpStatus.SC_OK, response.returnResponse().getCode());

0 commit comments

Comments
 (0)