Update Spring and various deps to next major version (#794)
This commit updates the following dependencies to the next major version to follow suit w/ Spring Boot 3.4.0 * Update Spring to 6.2.0-M7 * Update Reactor to 6.2.0-M7 * Update Micrometer to 1.14.0-M2 * Update Micrometer Tracig to 1.4.0-M2 Resolves #790 #791 #792 #793
This commit is contained in:
@@ -5,16 +5,16 @@ commons-compress = "1.26.2"
|
||||
jackson = "2.17.2"
|
||||
jsr305 = "3.0.2"
|
||||
logback = "1.5.6"
|
||||
micrometer = "1.13.3"
|
||||
micrometer = "1.14.0-M2"
|
||||
micrometer-docs-gen = "1.0.3"
|
||||
micrometer-tracing = "1.3.3"
|
||||
micrometer-tracing = "1.4.0-M2"
|
||||
protobuf = "3.25.4"
|
||||
pulsar = "3.3.1"
|
||||
pulsar-reactive = "0.5.6"
|
||||
reactor = "2023.0.9"
|
||||
spring = "6.1.11"
|
||||
reactor = "2024.0.0-SNAPSHOT"
|
||||
spring = "6.2.0-M7"
|
||||
# tests
|
||||
assertj = "3.25.3"
|
||||
assertj = "3.26.3"
|
||||
awaitility = "4.2.2"
|
||||
jacoco = "0.8.9"
|
||||
json-path = "2.9.0"
|
||||
|
||||
@@ -19,7 +19,7 @@ package org.springframework.pulsar.function;
|
||||
import static com.github.stefanbirkner.systemlambda.SystemLambda.tapSystemErrAndOutNormalized;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
import static org.assertj.core.api.Assertions.catchThrowableOfType;
|
||||
import static org.assertj.core.api.Assertions.catchThrowable;
|
||||
import static org.assertj.core.api.Assertions.entry;
|
||||
import static org.mockito.Mockito.doThrow;
|
||||
import static org.mockito.Mockito.inOrder;
|
||||
@@ -29,9 +29,12 @@ import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.verifyNoInteractions;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.pulsar.client.admin.PulsarAdmin;
|
||||
import org.apache.pulsar.client.admin.PulsarAdminException;
|
||||
import org.apache.pulsar.client.api.PulsarClientException;
|
||||
import org.assertj.core.api.InstanceOfAssertFactories;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -92,6 +95,15 @@ class PulsarFunctionAdministrationTests {
|
||||
when(source1.type()).thenReturn(FunctionType.SOURCE);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@SuppressWarnings("varargs")
|
||||
private void assertThatPulsarFunctionExceptionFailedWith(Throwable thrown,
|
||||
Map.Entry<? extends PulsarFunctionOperations<?>, ? extends Exception>... expectedFunctionAndErrors) {
|
||||
assertThat(thrown).isInstanceOf(PulsarFunctionException.class)
|
||||
.extracting("failures", InstanceOfAssertFactories.MAP)
|
||||
.containsExactly(expectedFunctionAndErrors);
|
||||
}
|
||||
|
||||
@Nested
|
||||
class ProperCreateUpdateApiCalled {
|
||||
|
||||
@@ -228,22 +240,21 @@ class PulsarFunctionAdministrationTests {
|
||||
void firstProcessedFunctionFails() throws PulsarAdminException {
|
||||
var ex = new PulsarAdminException("BOOM");
|
||||
when(function1.functionExists(pulsarAdmin)).thenThrow(ex);
|
||||
var thrown = catchThrowableOfType(() -> functionAdmin.createOrUpdateUserDefinedFunctions(),
|
||||
PulsarFunctionException.class);
|
||||
assertThat(thrown.getFailures()).containsExactly(entry(function1, ex));
|
||||
var thrown = catchThrowable(() -> functionAdmin.createOrUpdateUserDefinedFunctions());
|
||||
assertThatPulsarFunctionExceptionFailedWith(thrown, entry(function1, ex));
|
||||
verify(function1, never()).create(pulsarAdmin);
|
||||
verify(function1, never()).update(pulsarAdmin);
|
||||
verifyNoInteractions(sink1, source1);
|
||||
assertThat(functionAdmin.getProcessedFunctions()).isEmpty();
|
||||
}
|
||||
|
||||
// PulsarFunctionOperations<?>, Exception
|
||||
@Test
|
||||
void middleProcessedFunctionFails() throws PulsarAdminException {
|
||||
var ex = new PulsarAdminException("BOOM");
|
||||
when(sink1.functionExists(pulsarAdmin)).thenThrow(ex);
|
||||
var thrown = catchThrowableOfType(() -> functionAdmin.createOrUpdateUserDefinedFunctions(),
|
||||
PulsarFunctionException.class);
|
||||
assertThat(thrown.getFailures()).containsExactly(entry(sink1, ex));
|
||||
var thrown = catchThrowable(() -> functionAdmin.createOrUpdateUserDefinedFunctions());
|
||||
assertThatPulsarFunctionExceptionFailedWith(thrown, entry(sink1, ex));
|
||||
verify(function1).create(pulsarAdmin);
|
||||
verify(sink1, never()).create(pulsarAdmin);
|
||||
verify(sink1, never()).update(pulsarAdmin);
|
||||
@@ -255,9 +266,8 @@ class PulsarFunctionAdministrationTests {
|
||||
void lastProcessedFunctionFails() throws PulsarAdminException {
|
||||
var ex = new PulsarAdminException("BOOM");
|
||||
when(source1.functionExists(pulsarAdmin)).thenThrow(ex);
|
||||
var thrown = catchThrowableOfType(() -> functionAdmin.createOrUpdateUserDefinedFunctions(),
|
||||
PulsarFunctionException.class);
|
||||
assertThat(thrown.getFailures()).containsExactly(entry(source1, ex));
|
||||
var thrown = catchThrowable(() -> functionAdmin.createOrUpdateUserDefinedFunctions());
|
||||
assertThatPulsarFunctionExceptionFailedWith(thrown, entry(source1, ex));
|
||||
verify(function1).create(pulsarAdmin);
|
||||
verify(sink1).create(pulsarAdmin);
|
||||
verify(source1, never()).create(pulsarAdmin);
|
||||
@@ -282,9 +292,8 @@ class PulsarFunctionAdministrationTests {
|
||||
void firstProcessedFunctionFails() throws PulsarAdminException {
|
||||
var ex = new PulsarAdminException("BOOM");
|
||||
when(function1.functionExists(pulsarAdmin)).thenThrow(ex);
|
||||
var thrown = catchThrowableOfType(() -> functionAdmin.createOrUpdateUserDefinedFunctions(),
|
||||
PulsarFunctionException.class);
|
||||
assertThat(thrown.getFailures()).containsExactly(entry(function1, ex));
|
||||
var thrown = catchThrowable(() -> functionAdmin.createOrUpdateUserDefinedFunctions());
|
||||
assertThatPulsarFunctionExceptionFailedWith(thrown, entry(function1, ex));
|
||||
verify(function1, never()).create(pulsarAdmin);
|
||||
verify(function1, never()).update(pulsarAdmin);
|
||||
verify(sink1).create(pulsarAdmin);
|
||||
@@ -296,9 +305,8 @@ class PulsarFunctionAdministrationTests {
|
||||
void middleProcessedFunctionFails() throws PulsarAdminException {
|
||||
var ex = new PulsarAdminException("BOOM");
|
||||
when(sink1.functionExists(pulsarAdmin)).thenThrow(ex);
|
||||
var thrown = catchThrowableOfType(() -> functionAdmin.createOrUpdateUserDefinedFunctions(),
|
||||
PulsarFunctionException.class);
|
||||
assertThat(thrown.getFailures()).containsExactly(entry(sink1, ex));
|
||||
var thrown = catchThrowable(() -> functionAdmin.createOrUpdateUserDefinedFunctions());
|
||||
assertThatPulsarFunctionExceptionFailedWith(thrown, entry(sink1, ex));
|
||||
verify(function1).create(pulsarAdmin);
|
||||
verify(sink1, never()).create(pulsarAdmin);
|
||||
verify(sink1, never()).update(pulsarAdmin);
|
||||
@@ -310,9 +318,8 @@ class PulsarFunctionAdministrationTests {
|
||||
void lastProcessedFunctionFails() throws PulsarAdminException {
|
||||
var ex = new PulsarAdminException("BOOM");
|
||||
when(source1.functionExists(pulsarAdmin)).thenThrow(ex);
|
||||
var thrown = catchThrowableOfType(() -> functionAdmin.createOrUpdateUserDefinedFunctions(),
|
||||
PulsarFunctionException.class);
|
||||
assertThat(thrown.getFailures()).containsExactly(entry(source1, ex));
|
||||
var thrown = catchThrowable(() -> functionAdmin.createOrUpdateUserDefinedFunctions());
|
||||
assertThatPulsarFunctionExceptionFailedWith(thrown, entry(source1, ex));
|
||||
verify(function1).create(pulsarAdmin);
|
||||
verify(sink1).create(pulsarAdmin);
|
||||
verify(source1, never()).create(pulsarAdmin);
|
||||
@@ -328,9 +335,8 @@ class PulsarFunctionAdministrationTests {
|
||||
when(function1.functionExists(pulsarAdmin)).thenThrow(ex1);
|
||||
when(sink1.functionExists(pulsarAdmin)).thenThrow(ex2);
|
||||
when(source1.functionExists(pulsarAdmin)).thenThrow(ex3);
|
||||
var thrown = catchThrowableOfType(() -> functionAdmin.createOrUpdateUserDefinedFunctions(),
|
||||
PulsarFunctionException.class);
|
||||
assertThat(thrown.getFailures()).containsExactly(entry(function1, ex1), entry(sink1, ex2),
|
||||
var thrown = catchThrowable(() -> functionAdmin.createOrUpdateUserDefinedFunctions());
|
||||
assertThatPulsarFunctionExceptionFailedWith(thrown, entry(function1, ex1), entry(sink1, ex2),
|
||||
entry(source1, ex3));
|
||||
verify(function1, never()).create(pulsarAdmin);
|
||||
verify(function1, never()).update(pulsarAdmin);
|
||||
@@ -474,9 +480,8 @@ class PulsarFunctionAdministrationTests {
|
||||
void firstProcessedFunctionFails() {
|
||||
var ex = new PulsarException("BOOM");
|
||||
doThrow(ex).when(source1).stop(pulsarAdmin);
|
||||
var thrown = catchThrowableOfType(() -> functionAdmin.enforceStopPolicyOnUserDefinedFunctions(),
|
||||
PulsarFunctionException.class);
|
||||
assertThat(thrown.getFailures()).containsExactly(entry(source1, ex));
|
||||
var thrown = catchThrowable(() -> functionAdmin.enforceStopPolicyOnUserDefinedFunctions());
|
||||
assertThatPulsarFunctionExceptionFailedWith(thrown, entry(source1, ex));
|
||||
verify(sink1).stop(pulsarAdmin);
|
||||
verify(function1).stop(pulsarAdmin);
|
||||
}
|
||||
@@ -485,9 +490,8 @@ class PulsarFunctionAdministrationTests {
|
||||
void middleProcessedFunctionFails() {
|
||||
var ex = new PulsarException("BOOM");
|
||||
doThrow(ex).when(sink1).stop(pulsarAdmin);
|
||||
var thrown = catchThrowableOfType(() -> functionAdmin.enforceStopPolicyOnUserDefinedFunctions(),
|
||||
PulsarFunctionException.class);
|
||||
assertThat(thrown.getFailures()).containsExactly(entry(sink1, ex));
|
||||
var thrown = catchThrowable(() -> functionAdmin.enforceStopPolicyOnUserDefinedFunctions());
|
||||
assertThatPulsarFunctionExceptionFailedWith(thrown, entry(sink1, ex));
|
||||
verify(source1).stop(pulsarAdmin);
|
||||
verify(function1).stop(pulsarAdmin);
|
||||
}
|
||||
@@ -496,9 +500,8 @@ class PulsarFunctionAdministrationTests {
|
||||
void lastProcessedFunctionFails() {
|
||||
var ex = new PulsarException("BOOM");
|
||||
doThrow(ex).when(function1).stop(pulsarAdmin);
|
||||
var thrown = catchThrowableOfType(() -> functionAdmin.enforceStopPolicyOnUserDefinedFunctions(),
|
||||
PulsarFunctionException.class);
|
||||
assertThat(thrown.getFailures()).containsExactly(entry(function1, ex));
|
||||
var thrown = catchThrowable(() -> functionAdmin.enforceStopPolicyOnUserDefinedFunctions());
|
||||
assertThatPulsarFunctionExceptionFailedWith(thrown, entry(function1, ex));
|
||||
verify(source1).stop(pulsarAdmin);
|
||||
verify(sink1).stop(pulsarAdmin);
|
||||
}
|
||||
@@ -511,9 +514,8 @@ class PulsarFunctionAdministrationTests {
|
||||
doThrow(ex1).when(source1).stop(pulsarAdmin);
|
||||
doThrow(ex2).when(sink1).stop(pulsarAdmin);
|
||||
doThrow(ex3).when(function1).stop(pulsarAdmin);
|
||||
var thrown = catchThrowableOfType(() -> functionAdmin.enforceStopPolicyOnUserDefinedFunctions(),
|
||||
PulsarFunctionException.class);
|
||||
assertThat(thrown.getFailures()).containsExactly(entry(source1, ex1), entry(sink1, ex2),
|
||||
var thrown = catchThrowable(() -> functionAdmin.enforceStopPolicyOnUserDefinedFunctions());
|
||||
assertThatPulsarFunctionExceptionFailedWith(thrown, entry(source1, ex1), entry(sink1, ex2),
|
||||
entry(function1, ex3));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user