Skip to content

Commit 12ee999

Browse files
authored
Merge pull request #327 from cyb3r4nt/jsonrpc-deps-update-2024-03
dependencies update 2024-03
2 parents 6dd4a96 + 89d5794 commit 12ee999

File tree

6 files changed

+46
-30
lines changed

6 files changed

+46
-30
lines changed

build.gradle

+17-15
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
buildscript {
22

33
ext {
4-
set("jacksonVersion", "2.13.4")
5-
set("springVersion", "5.3.23")
6-
set("springBotVersion", "2.7.4")
7-
set("jettyVersion", "9.4.49.v20220914")
8-
set("slf4jVersion", "2.0.3")
4+
set("jacksonVersion", "2.16.1")
5+
// Versions 6.0.0 and above no longer support Java 1.8
6+
set("springVersion", "5.3.32")
7+
// Versions 3.0.0 and above no longer support Java 1.8
8+
set("springBootVersion", "2.7.18")
9+
set("jettyVersion", "9.4.54.v20240208")
10+
set("slf4jVersion", "2.0.12")
911
}
1012

1113
repositories {
@@ -15,8 +17,8 @@ buildscript {
1517
}
1618

1719
dependencies {
18-
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.3"
19-
classpath("com.adarshr:gradle-test-logger-plugin:1.6.0")
20+
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0"
21+
classpath("com.adarshr:gradle-test-logger-plugin:3.2.0")
2022
}
2123
}
2224

@@ -67,7 +69,7 @@ test {
6769
}
6870

6971
jacoco {
70-
toolVersion = "0.8.5"
72+
toolVersion = "0.8.11"
7173
}
7274

7375
jacocoTestReport {
@@ -114,23 +116,23 @@ dependencies {
114116
springSupportImplementation "org.springframework:spring-web:${springVersion}"
115117
springSupportImplementation "org.springframework:spring-webmvc:${springVersion}"
116118

117-
implementation 'commons-codec:commons-codec:1.15'
118-
implementation 'org.apache.httpcomponents:httpcore-nio:4.4.15'
119+
implementation 'commons-codec:commons-codec:1.16.1'
120+
implementation 'org.apache.httpcomponents:httpcore-nio:4.4.16'
119121

120122
testImplementation 'junit:junit:4.13.2'
121-
testImplementation 'org.easymock:easymock:4.3'
122-
testImplementation("org.springframework.boot:spring-boot-starter-web:${springBotVersion}") {
123+
testImplementation 'org.easymock:easymock:5.2.0'
124+
testImplementation("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") {
123125
exclude module: 'logback-classic'
124126
}
125-
testImplementation "org.springframework.boot:spring-boot-starter-test:${springBotVersion}"
127+
testImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}"
126128
testImplementation("org.eclipse.jetty:jetty-server:${jettyVersion}") {
127129
exclude module: 'javax.servlet'
128130
}
129131
testImplementation("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
130132
exclude module: 'org.eclipse.jetty.orbit'
131133
}
132-
testRuntimeOnly 'org.apache.logging.log4j:log4j-slf4j-impl:2.19.0'
133-
testRuntimeOnly 'org.apache.logging.log4j:log4j-core:2.19.0'
134+
testRuntimeOnly 'org.apache.logging.log4j:log4j-slf4j-impl:2.23.0'
135+
testRuntimeOnly 'org.apache.logging.log4j:log4j-core:2.23.0'
134136

135137
}
136138

publishing.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88
gradlePluginPortal()
99
}
1010
dependencies {
11-
classpath 'io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.11.0'
11+
classpath 'io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0'
1212
classpath 'gradle.plugin.net.wooga.gradle:atlas-github:1.0.1'
1313
classpath 'net.researchgate:gradle-release:2.7.0'
1414
classpath 'org.ajoberstar:grgit:2.3.0'

src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java

+2
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ protected Class<?>[] getHandlerInterfaces(final String serviceName) {
282282
*
283283
* @param node the {@link JsonNode}
284284
* @return the {@link JsonResponse} instance
285+
* @throws JsonParseException when {@link JsonNode} read fails
286+
* @throws JsonMappingException when {@link JsonNode} read fails
285287
*/
286288
protected JsonResponse handleJsonNodeRequest(final JsonNode node)
287289
throws JsonParseException, JsonMappingException {

src/main/java/com/googlecode/jsonrpc4j/JsonRpcHttpAsyncClient.java

+13-9
Original file line numberDiff line numberDiff line change
@@ -412,29 +412,33 @@ private void initialize() {
412412
pool = new BasicNIOConnPool(ioReactor, nioConnFactory, Integer.getInteger("com.googlecode.jsonrpc4j.async.connect.timeout", 30000));
413413
pool.setDefaultMaxPerRoute(Integer.getInteger("com.googlecode.jsonrpc4j.async.max.inflight.route", 500));
414414
pool.setMaxTotal(Integer.getInteger("com.googlecode.jsonrpc4j.async.max.inflight.total", 500));
415-
416-
Thread t = new Thread(new Runnable() {
417-
@Override
418-
public void run() {
415+
416+
Thread t = new Thread(
417+
() -> {
419418
try {
420419
HttpAsyncRequestExecutor protocolHandler = new HttpAsyncRequestExecutor();
421-
IOEventDispatch ioEventDispatch = new DefaultHttpClientIODispatch(protocolHandler, sslContext, connectionConfig);
420+
IOEventDispatch ioEventDispatch = new DefaultHttpClientIODispatch<>(
421+
protocolHandler,
422+
sslContext,
423+
connectionConfig
424+
);
422425
ioReactor.execute(ioEventDispatch);
423426
} catch (InterruptedIOException ex) {
424427
System.err.println("Interrupted");
425428
} catch (IOException e) {
426429
System.err.println("I/O error: " + e.getMessage());
427430
}
428-
}
429-
}, "jsonrpc4j HTTP IOReactor");
430-
431+
},
432+
"jsonrpc4j HTTP IOReactor"
433+
);
434+
431435
t.setDaemon(true);
432436
t.start();
433437

434438
HttpProcessor httpProcessor = new ImmutableHttpProcessor(new RequestContent(), new RequestTargetHost(), new RequestConnControl(), new RequestUserAgent(), new RequestExpectContinue(false));
435439
requester = new HttpAsyncRequester(httpProcessor, new DefaultConnectionReuseStrategy());
436440
}
437-
441+
438442
private IOReactorConfig.Builder createConfig() {
439443
IOReactorConfig.Builder config = IOReactorConfig.custom();
440444
config = config.setSoTimeout(Integer.getInteger("com.googlecode.jsonrpc4j.async.socket.timeout", 30000));

src/main/java/com/googlecode/jsonrpc4j/JsonRpcServer.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ private InputStream getRequestStream(ResourceRequest request) throws IOException
104104
}
105105

106106
private static InputStream createInputStream(ResourceRequest request) throws IOException {
107-
return createInputStream(request.getParameter(METHOD), request.getParameter(ID), request.getParameter(PARAMS));
107+
return createInputStream(
108+
request.getRenderParameters().getValue(METHOD),
109+
request.getRenderParameters().getValue(ID),
110+
request.getRenderParameters().getValue(PARAMS)
111+
);
108112
}
109113

110114
/**

src/test/java/com/googlecode/jsonrpc4j/integration/HttpCodeTest.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,24 @@
1414
import java.net.MalformedURLException;
1515

1616
import static org.hamcrest.CoreMatchers.anyOf;
17+
import static org.hamcrest.CoreMatchers.endsWith;
1718
import static org.hamcrest.CoreMatchers.equalTo;
1819
import static org.hamcrest.CoreMatchers.startsWith;
1920

2021
public class HttpCodeTest extends BaseRestTest {
2122

2223
@Test
2324
public void http405OnInvalidUrl() throws MalformedURLException {
24-
expectedEx.expectMessage(anyOf(
25+
expectedEx.expectMessage(
26+
anyOf(
2527
equalTo("405 HTTP method POST is not supported by this URL"),
2628
equalTo("404 Not Found"),
2729
equalTo("HTTP method POST is not supported by this URL"),
28-
equalTo("Method Not Allowed"),
29-
startsWith("Server returned HTTP response code: 405 for URL: http://127.0.0.1")));
30-
expectedEx.expect(Exception.class);
30+
startsWith("Server returned HTTP response code: 405 for URL: http://127.0.0.1"),
31+
endsWith("Method Not Allowed")
32+
)
33+
);
34+
expectedEx.expect(JsonRpcClientException.class);
3135
FakeServiceInterface service = ProxyUtil.createClientProxy(FakeServiceInterface.class, getClient("error"));
3236
service.doSomething();
3337
}

0 commit comments

Comments
 (0)