See gh-32502
This commit is contained in:
Stéphane Nicoll
2024-04-04 14:40:31 +02:00
parent 521cda009b
commit b68f76c86e
7 changed files with 17 additions and 19 deletions

View File

@@ -105,7 +105,7 @@ class InvocableHandlerMethodTests {
@Test
void resolveNoArgsOnSchedulerThread() {
Method method = ResolvableMethod.on(TestController.class).mockCall(o -> o.noArgsThread()).method();
Method method = ResolvableMethod.on(TestController.class).mockCall(TestController::noArgsThread).method();
Mono<HandlerResult> mono = invokeOnScheduler(Schedulers.newSingle("good"), new TestController(), method);
assertHandlerResultValue(mono, "on thread: good-", false);

View File

@@ -217,7 +217,9 @@ class ControllerAdviceTests {
Method method = controller.getClass().getMethod(methodName, parameterTypes);
HandlerMethod handlerMethod = new HandlerMethod(controller, method);
return adapter.handle(exchange, handlerMethod).block(timeout);
HandlerResult handlerResult = adapter.handle(exchange, handlerMethod).block(timeout);
assertThat(handlerResult).isNotNull();
return handlerResult;
}

View File

@@ -80,8 +80,7 @@ class ModelInitializerTests {
ControllerMethodResolver methodResolver = new ControllerMethodResolver(
resolverConfigurer, adapterRegistry, new StaticApplicationContext(),
Collections.emptyList(), null,
null, null);
Collections.emptyList(), null, null, null);
this.modelInitializer = new ModelInitializer(methodResolver, adapterRegistry);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -78,10 +78,8 @@ class RequestMappingIntegrationTests extends AbstractRequestMappingIntegrationTe
url += "/";
assertThat(getRestTemplate().getForObject(url, String.class)).isEqualTo("root");
assertThat(getApplicationContext().getBean(TestExecutor.class).invocationCount.get())
.as("executor").isEqualTo(4);
assertThat(getApplicationContext().getBean(TestPredicate.class).invocationCount.get())
.as("predicate").isEqualTo(4);
assertThat(getApplicationContext().getBean(TestExecutor.class).invocationCount.get()).isEqualTo(4);
assertThat(getApplicationContext().getBean(TestPredicate.class).invocationCount.get()).isEqualTo(4);
}
@ParameterizedHttpServerTest

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.