Skip to content

Commit fbfcfaa

Browse files
committed
Remove deprecated AssertJ calls
This fixes some AssertJ deprecations that came along w/ the update to AssertJ `3.73`.
1 parent 9971908 commit fbfcfaa

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

spring-pulsar/src/test/java/org/springframework/pulsar/function/PulsarFunctionAdministrationTests.java

+22-22
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ class WithFailFast {
228228
void firstProcessedFunctionFails() throws PulsarAdminException {
229229
var ex = new PulsarAdminException("BOOM");
230230
when(function1.functionExists(pulsarAdmin)).thenThrow(ex);
231-
var thrown = catchThrowableOfType(() -> functionAdmin.createOrUpdateUserDefinedFunctions(),
232-
PulsarFunctionException.class);
231+
var thrown = catchThrowableOfType(PulsarFunctionException.class,
232+
() -> functionAdmin.createOrUpdateUserDefinedFunctions());
233233
assertThat(thrown.getFailures()).containsExactly(entry(function1, ex));
234234
verify(function1, never()).create(pulsarAdmin);
235235
verify(function1, never()).update(pulsarAdmin);
@@ -241,8 +241,8 @@ void firstProcessedFunctionFails() throws PulsarAdminException {
241241
void middleProcessedFunctionFails() throws PulsarAdminException {
242242
var ex = new PulsarAdminException("BOOM");
243243
when(sink1.functionExists(pulsarAdmin)).thenThrow(ex);
244-
var thrown = catchThrowableOfType(() -> functionAdmin.createOrUpdateUserDefinedFunctions(),
245-
PulsarFunctionException.class);
244+
var thrown = catchThrowableOfType(PulsarFunctionException.class,
245+
() -> functionAdmin.createOrUpdateUserDefinedFunctions());
246246
assertThat(thrown.getFailures()).containsExactly(entry(sink1, ex));
247247
verify(function1).create(pulsarAdmin);
248248
verify(sink1, never()).create(pulsarAdmin);
@@ -255,8 +255,8 @@ void middleProcessedFunctionFails() throws PulsarAdminException {
255255
void lastProcessedFunctionFails() throws PulsarAdminException {
256256
var ex = new PulsarAdminException("BOOM");
257257
when(source1.functionExists(pulsarAdmin)).thenThrow(ex);
258-
var thrown = catchThrowableOfType(() -> functionAdmin.createOrUpdateUserDefinedFunctions(),
259-
PulsarFunctionException.class);
258+
var thrown = catchThrowableOfType(PulsarFunctionException.class,
259+
() -> functionAdmin.createOrUpdateUserDefinedFunctions());
260260
assertThat(thrown.getFailures()).containsExactly(entry(source1, ex));
261261
verify(function1).create(pulsarAdmin);
262262
verify(sink1).create(pulsarAdmin);
@@ -282,8 +282,8 @@ void disableFailFastOnFunctionAdmin() {
282282
void firstProcessedFunctionFails() throws PulsarAdminException {
283283
var ex = new PulsarAdminException("BOOM");
284284
when(function1.functionExists(pulsarAdmin)).thenThrow(ex);
285-
var thrown = catchThrowableOfType(() -> functionAdmin.createOrUpdateUserDefinedFunctions(),
286-
PulsarFunctionException.class);
285+
var thrown = catchThrowableOfType(PulsarFunctionException.class,
286+
() -> functionAdmin.createOrUpdateUserDefinedFunctions());
287287
assertThat(thrown.getFailures()).containsExactly(entry(function1, ex));
288288
verify(function1, never()).create(pulsarAdmin);
289289
verify(function1, never()).update(pulsarAdmin);
@@ -296,8 +296,8 @@ void firstProcessedFunctionFails() throws PulsarAdminException {
296296
void middleProcessedFunctionFails() throws PulsarAdminException {
297297
var ex = new PulsarAdminException("BOOM");
298298
when(sink1.functionExists(pulsarAdmin)).thenThrow(ex);
299-
var thrown = catchThrowableOfType(() -> functionAdmin.createOrUpdateUserDefinedFunctions(),
300-
PulsarFunctionException.class);
299+
var thrown = catchThrowableOfType(PulsarFunctionException.class,
300+
() -> functionAdmin.createOrUpdateUserDefinedFunctions());
301301
assertThat(thrown.getFailures()).containsExactly(entry(sink1, ex));
302302
verify(function1).create(pulsarAdmin);
303303
verify(sink1, never()).create(pulsarAdmin);
@@ -310,8 +310,8 @@ void middleProcessedFunctionFails() throws PulsarAdminException {
310310
void lastProcessedFunctionFails() throws PulsarAdminException {
311311
var ex = new PulsarAdminException("BOOM");
312312
when(source1.functionExists(pulsarAdmin)).thenThrow(ex);
313-
var thrown = catchThrowableOfType(() -> functionAdmin.createOrUpdateUserDefinedFunctions(),
314-
PulsarFunctionException.class);
313+
var thrown = catchThrowableOfType(PulsarFunctionException.class,
314+
() -> functionAdmin.createOrUpdateUserDefinedFunctions());
315315
assertThat(thrown.getFailures()).containsExactly(entry(source1, ex));
316316
verify(function1).create(pulsarAdmin);
317317
verify(sink1).create(pulsarAdmin);
@@ -328,8 +328,8 @@ void allProcessedFunctionsFail() throws PulsarAdminException {
328328
when(function1.functionExists(pulsarAdmin)).thenThrow(ex1);
329329
when(sink1.functionExists(pulsarAdmin)).thenThrow(ex2);
330330
when(source1.functionExists(pulsarAdmin)).thenThrow(ex3);
331-
var thrown = catchThrowableOfType(() -> functionAdmin.createOrUpdateUserDefinedFunctions(),
332-
PulsarFunctionException.class);
331+
var thrown = catchThrowableOfType(PulsarFunctionException.class,
332+
() -> functionAdmin.createOrUpdateUserDefinedFunctions());
333333
assertThat(thrown.getFailures()).containsExactly(entry(function1, ex1), entry(sink1, ex2),
334334
entry(source1, ex3));
335335
verify(function1, never()).create(pulsarAdmin);
@@ -474,8 +474,8 @@ void createAdminClientFails() throws PulsarClientException {
474474
void firstProcessedFunctionFails() {
475475
var ex = new PulsarException("BOOM");
476476
doThrow(ex).when(source1).stop(pulsarAdmin);
477-
var thrown = catchThrowableOfType(() -> functionAdmin.enforceStopPolicyOnUserDefinedFunctions(),
478-
PulsarFunctionException.class);
477+
var thrown = catchThrowableOfType(PulsarFunctionException.class,
478+
() -> functionAdmin.enforceStopPolicyOnUserDefinedFunctions());
479479
assertThat(thrown.getFailures()).containsExactly(entry(source1, ex));
480480
verify(sink1).stop(pulsarAdmin);
481481
verify(function1).stop(pulsarAdmin);
@@ -485,8 +485,8 @@ void firstProcessedFunctionFails() {
485485
void middleProcessedFunctionFails() {
486486
var ex = new PulsarException("BOOM");
487487
doThrow(ex).when(sink1).stop(pulsarAdmin);
488-
var thrown = catchThrowableOfType(() -> functionAdmin.enforceStopPolicyOnUserDefinedFunctions(),
489-
PulsarFunctionException.class);
488+
var thrown = catchThrowableOfType(PulsarFunctionException.class,
489+
() -> functionAdmin.enforceStopPolicyOnUserDefinedFunctions());
490490
assertThat(thrown.getFailures()).containsExactly(entry(sink1, ex));
491491
verify(source1).stop(pulsarAdmin);
492492
verify(function1).stop(pulsarAdmin);
@@ -496,8 +496,8 @@ void middleProcessedFunctionFails() {
496496
void lastProcessedFunctionFails() {
497497
var ex = new PulsarException("BOOM");
498498
doThrow(ex).when(function1).stop(pulsarAdmin);
499-
var thrown = catchThrowableOfType(() -> functionAdmin.enforceStopPolicyOnUserDefinedFunctions(),
500-
PulsarFunctionException.class);
499+
var thrown = catchThrowableOfType(PulsarFunctionException.class,
500+
() -> functionAdmin.enforceStopPolicyOnUserDefinedFunctions());
501501
assertThat(thrown.getFailures()).containsExactly(entry(function1, ex));
502502
verify(source1).stop(pulsarAdmin);
503503
verify(sink1).stop(pulsarAdmin);
@@ -511,8 +511,8 @@ void allProcessedFunctionsFail() {
511511
doThrow(ex1).when(source1).stop(pulsarAdmin);
512512
doThrow(ex2).when(sink1).stop(pulsarAdmin);
513513
doThrow(ex3).when(function1).stop(pulsarAdmin);
514-
var thrown = catchThrowableOfType(() -> functionAdmin.enforceStopPolicyOnUserDefinedFunctions(),
515-
PulsarFunctionException.class);
514+
var thrown = catchThrowableOfType(PulsarFunctionException.class,
515+
() -> functionAdmin.enforceStopPolicyOnUserDefinedFunctions());
516516
assertThat(thrown.getFailures()).containsExactly(entry(source1, ex1), entry(sink1, ex2),
517517
entry(function1, ex3));
518518
}

0 commit comments

Comments
 (0)