Add nullability annotations to smoke-test/spring-boot-smoke-test-actuator-extension
See gh-46587
This commit is contained in:
parent
e1f4102dfb
commit
8e17277efd
|
@ -18,6 +18,8 @@ package smoketest.actuator.extension;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.boot.actuate.autoconfigure.endpoint.condition.EndpointExposureOutcomeContributor;
|
||||
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.EndpointExposure;
|
||||
import org.springframework.boot.actuate.endpoint.EndpointId;
|
||||
|
@ -34,7 +36,7 @@ class MyExtensionEndpointExposureOutcomeContributor implements EndpointExposureO
|
|||
}
|
||||
|
||||
@Override
|
||||
public ConditionOutcome getExposureOutcome(EndpointId endpointId, Set<EndpointExposure> exposures,
|
||||
public @Nullable ConditionOutcome getExposureOutcome(EndpointId endpointId, Set<EndpointExposure> exposures,
|
||||
Builder message) {
|
||||
if (exposures.contains(EndpointExposure.WEB) && this.filter.match(endpointId)) {
|
||||
return ConditionOutcome.match(message.because("marked as exposed by a my extension '"
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.util.Map;
|
|||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver;
|
||||
import org.springframework.boot.actuate.endpoint.web.EndpointMapping;
|
||||
|
@ -40,7 +41,7 @@ class MyExtensionWebMvcEndpointHandlerMapping extends AbstractWebMvcEndpointHand
|
|||
private final EndpointLinksResolver linksResolver;
|
||||
|
||||
MyExtensionWebMvcEndpointHandlerMapping(Collection<ExposableWebEndpoint> endpoints,
|
||||
EndpointMediaTypes endpointMediaTypes, CorsConfiguration corsConfiguration) {
|
||||
EndpointMediaTypes endpointMediaTypes, @Nullable CorsConfiguration corsConfiguration) {
|
||||
super(new EndpointMapping(PATH), endpoints, endpointMediaTypes, corsConfiguration, true);
|
||||
this.linksResolver = new EndpointLinksResolver(endpoints, PATH);
|
||||
setOrder(-100);
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright 2012-present 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@NullMarked
|
||||
package smoketest.actuator.extension;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
Loading…
Reference in New Issue