Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump io.vertx:vertx-dependencies from 4.4.4 to 4.4.6 #1722

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@
<org.apache.httpcomponents.version>4.5.14</org.apache.httpcomponents.version>
<io.fabric8.client.version>6.7.2</io.fabric8.client.version>
<io.netty.version>4.1.101.Final</io.netty.version>
<io.vertx.version>4.4.4</io.vertx.version>
<io.vertx.version>4.4.6</io.vertx.version>
<!--
FIXME this needs to be synced with the vertx version - is there a BOM to use or something?
https://github.com/vert-x3/vertx-web/blob/${io.vertx.version}/vertx-web-graphql/pom.xml#L35
-->
<com.graphql.java.extended.scalars.version>20.2</com.graphql.java.extended.scalars.version>
<com.graphql.java.extended.scalars.version>20.4</com.graphql.java.extended.scalars.version>
<com.nimbusds.jose.jwt.version>9.31</com.nimbusds.jose.jwt.version>
<org.bouncycastle.version>1.75</org.bouncycastle.version>
<org.jasypt.version>1.9.3</org.jasypt.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ public IntermediateResponse<Void> handle(RequestParameters params) throws ApiExc
.send();
if (Boolean.valueOf(params.getQueryParams().get(CLEAN_PARAM))) {
vertx.executeBlocking(
promise -> {
() -> {
try {
cleanup(params, rule);
promise.complete();
} catch (Exception e) {
promise.fail(e);
logger.error(e);
}
return null;
});
}
return new IntermediateResponse<Void>().body(null);
Expand All @@ -144,7 +144,7 @@ private void cleanup(RequestParameters params, Rule rule) {
.forEach(
(ServiceRef ref) -> {
vertx.executeBlocking(
promise -> {
() -> {
try {
if (ruleRegistry.applies(rule, ref)) {
String targetId = ref.getServiceUri().toString();
Expand All @@ -157,11 +157,10 @@ private void cleanup(RequestParameters params, Rule rule) {
recordings.stopRecording(
cd, rule.getRecordingName(), true);
}
promise.complete();
} catch (Exception e) {
logger.error(e);
promise.fail(e);
}
return null;
});
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ public IntermediateResponse<Void> handle(RequestParameters params) throws ApiExc

if (!enabled && Boolean.valueOf(params.getQueryParams().get(CLEAN_PARAM))) {
vertx.executeBlocking(
promise -> {
() -> {
try {
cleanup(params, rule);
promise.complete();
} catch (Exception e) {
promise.fail(e);
logger.error(e);
}
return null;
});
}

Expand All @@ -158,7 +158,7 @@ private void cleanup(RequestParameters params, Rule rule) {
.forEach(
(ServiceRef ref) -> {
vertx.executeBlocking(
promise -> {
() -> {
try {
if (ruleRegistry.applies(rule, ref)) {
String targetId = ref.getServiceUri().toString();
Expand All @@ -171,11 +171,10 @@ private void cleanup(RequestParameters params, Rule rule) {
recordings.stopRecording(
cd, rule.getRecordingName(), true);
}
promise.complete();
} catch (Exception e) {
logger.error(e);
promise.fail(e);
}
return null;
});
});
}
Expand Down
15 changes: 14 additions & 1 deletion src/test/java/io/cryostat/MockVertx.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package io.cryostat;

import java.util.concurrent.Callable;

import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
import io.vertx.core.Promise;
Expand Down Expand Up @@ -114,7 +116,7 @@ public boolean failed() {
.executeBlocking(Mockito.any(), Mockito.any());

Mockito.lenient()
.when(vertx.executeBlocking(Mockito.any()))
.when(vertx.executeBlocking(Mockito.any(Handler.class)))
.thenAnswer(
new Answer() {
@Override
Expand All @@ -128,6 +130,17 @@ public Object answer(InvocationOnMock invocation) throws Throwable {
}
});

Mockito.lenient()
.when(vertx.executeBlocking(Mockito.any(Callable.class)))
.thenAnswer(
new Answer() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
Callable callable = invocation.getArgument(0);
return callable.call();
}
});

Mockito.lenient()
.doAnswer(
new Answer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.Callable;

import io.cryostat.MainModule;
import io.cryostat.MockVertx;
Expand Down Expand Up @@ -181,7 +182,7 @@ void shouldRespondWith404ForNonexistentRule() throws Exception {
Assertions.assertThrows(ApiException.class, () -> handler.handle(params));
MatcherAssert.assertThat(ex.getStatusCode(), Matchers.equalTo(404));

Mockito.verify(vertx, Mockito.never()).executeBlocking(Mockito.any());
Mockito.verify(vertx, Mockito.never()).executeBlocking(Mockito.any(Callable.class));
Mockito.verify(registry, Mockito.never()).deleteRule(Mockito.any(Rule.class));
Mockito.verify(registry, Mockito.never()).deleteRule(Mockito.anyString());
Mockito.verify(registry, Mockito.never()).applies(Mockito.any(), Mockito.any());
Expand Down Expand Up @@ -223,7 +224,7 @@ void shouldRespondWith200ForCleanupFailures() throws Exception {
IntermediateResponse<Void> response = handler.handle(params);
MatcherAssert.assertThat(response.getStatusCode(), Matchers.equalTo(200));

Mockito.verify(vertx, Mockito.times(2)).executeBlocking(Mockito.any());
Mockito.verify(vertx, Mockito.times(2)).executeBlocking(Mockito.any(Callable.class));
Mockito.verify(registry).deleteRule(rule);
Mockito.verify(registry).applies(rule, serviceRef);
Mockito.verify(recordingTargetHelper)
Expand Down Expand Up @@ -253,7 +254,7 @@ void shouldRespondWith200AfterCleanupNoop() throws Exception {
IntermediateResponse<Void> response = handler.handle(params);
MatcherAssert.assertThat(response.getStatusCode(), Matchers.equalTo(200));

Mockito.verify(vertx, Mockito.times(1)).executeBlocking(Mockito.any());
Mockito.verify(vertx, Mockito.times(1)).executeBlocking(Mockito.any(Callable.class));
Mockito.verify(registry).deleteRule(rule);
Mockito.verify(registry, Mockito.never()).applies(Mockito.any(), Mockito.any());
Mockito.verify(recordingTargetHelper, Mockito.never())
Expand Down Expand Up @@ -288,7 +289,7 @@ void shouldRespondWith200AfterSuccessfulCleanup() throws Exception {
IntermediateResponse<Void> response = handler.handle(params);
MatcherAssert.assertThat(response.getStatusCode(), Matchers.equalTo(200));

Mockito.verify(vertx, Mockito.times(2)).executeBlocking(Mockito.any());
Mockito.verify(vertx, Mockito.times(2)).executeBlocking(Mockito.any(Callable.class));
Mockito.verify(registry).deleteRule(rule);
Mockito.verify(registry).applies(Mockito.any(), Mockito.any());
Mockito.verify(recordingTargetHelper)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.Callable;

import io.cryostat.MainModule;
import io.cryostat.MockVertx;
Expand Down Expand Up @@ -220,7 +221,7 @@ void shouldDisableRuleAndCleanup() throws Exception {
Mockito.verify(notificationBuilder).build();
Mockito.verify(notification).send();

Mockito.verify(vertx, Mockito.times(2)).executeBlocking(Mockito.any());
Mockito.verify(vertx, Mockito.times(2)).executeBlocking(Mockito.any(Callable.class));
Mockito.verify(registry)
.applies(Mockito.any(Rule.class), Mockito.any(ServiceRef.class));
Mockito.verify(recordingTargetHelper)
Expand Down
Loading