Skip to content

Commit a61d492

Browse files
mikebell90Chavjoh
authored andcommitted
Don't refer to vertx classes in factory method
1 parent 5d65ffb commit a61d492

3 files changed

Lines changed: 25 additions & 10 deletions

File tree

pom.xml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,28 @@
3737

3838
<properties>
3939
<lombok.version>1.18.36</lombok.version>
40+
<vertx-web-client.version>4.5.11</vertx-web-client.version>
41+
<slf4j-api.version>2.0.16</slf4j-api.version>
42+
<log4j-bom.version>2.24.3</log4j-bom.version>
43+
<junit-bom.version>5.11.4</junit-bom.version>
44+
<common-client.version>2.1.3</common-client.version>
45+
<httpclient5.version>5.4.1</httpclient5.version>
46+
<okhttp.version>4.12.0</okhttp.version>
4047
</properties>
4148

4249
<dependencyManagement>
4350
<dependencies>
4451
<dependency>
4552
<groupId>org.apache.logging.log4j</groupId>
4653
<artifactId>log4j-bom</artifactId>
47-
<version>2.24.3</version>
54+
<version>${log4j-bom.version}</version>
4855
<type>pom</type>
4956
<scope>import</scope>
5057
</dependency>
5158
<dependency>
5259
<groupId>org.junit</groupId>
5360
<artifactId>junit-bom</artifactId>
54-
<version>5.11.4</version>
61+
<version>${junit-bom.version}</version>
5562
<type>pom</type>
5663
<scope>import</scope>
5764
</dependency>
@@ -69,37 +76,37 @@
6976
<dependency>
7077
<groupId>com.chavaillaz</groupId>
7178
<artifactId>common-client</artifactId>
72-
<version>2.1.3</version>
79+
<version>${common-client.version}</version>
7380
</dependency>
7481

7582
<dependency>
7683
<groupId>org.apache.httpcomponents.client5</groupId>
7784
<artifactId>httpclient5</artifactId>
78-
<version>5.4.1</version>
85+
<version>${httpclient5.version}</version>
7986
<scope>compile</scope>
8087
<optional>true</optional>
8188
</dependency>
8289

8390
<dependency>
8491
<groupId>com.squareup.okhttp3</groupId>
8592
<artifactId>okhttp</artifactId>
86-
<version>4.12.0</version>
93+
<version>${okhttp.version}</version>
8794
<scope>compile</scope>
8895
<optional>true</optional>
8996
</dependency>
9097

9198
<dependency>
9299
<groupId>io.vertx</groupId>
93100
<artifactId>vertx-web-client</artifactId>
94-
<version>4.5.11</version>
101+
<version>${vertx-web-client.version}</version>
95102
<scope>compile</scope>
96103
<optional>true</optional>
97104
</dependency>
98105

99106
<dependency>
100107
<groupId>org.slf4j</groupId>
101108
<artifactId>slf4j-api</artifactId>
102-
<version>2.0.16</version>
109+
<version>${slf4j-api.version}</version>
103110
</dependency>
104111

105112
<!-- Test dependencies -->

src/main/java/com/chavaillaz/client/jira/JiraClient.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.chavaillaz.client.jira;
22

3-
import static io.vertx.core.Vertx.vertx;
4-
53
import com.chavaillaz.client.common.Client;
64
import com.chavaillaz.client.jira.apache.ApacheHttpJiraClient;
75
import com.chavaillaz.client.jira.api.IssueApi;
@@ -49,7 +47,7 @@ static OkHttpJiraClient<Issue> okHttpClient(String jiraUrl) {
4947
* @param jiraUrl The Jira URL
5048
*/
5149
static VertxHttpJiraClient<Issue> vertxClient(String jiraUrl) {
52-
return new VertxHttpJiraClient<>(vertx(), jiraUrl, Issue.class);
50+
return new VertxHttpJiraClient<>(jiraUrl, Issue.class);
5351
}
5452

5553
/**

src/main/java/com/chavaillaz/client/jira/vertx/VertxHttpJiraClient.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ public VertxHttpJiraClient(Vertx vertx, String jiraUrl, Class<I> issueType) {
3030
this.vertx = vertx;
3131
}
3232

33+
/**
34+
* Creates a new {@link JiraClient} using Vert.x HTTP client with the given issue type.
35+
*
36+
* @param jiraUrl The Jira URL
37+
* @param issueType The issue class type
38+
*/
39+
public VertxHttpJiraClient(String jiraUrl, Class<I> issueType) {
40+
this(Vertx.vertx(), jiraUrl, issueType);
41+
}
42+
3343
@Override
3444
public WebClient newHttpClient() {
3545
return WebClient.create(vertx, defaultWebClientOptions(proxy));

0 commit comments

Comments
 (0)