Use consistent exception messages in Assert calls
Update `Assert` calls to consistently use messages of the form "'item' must [not] ...". Closes gh-43780
This commit is contained in:
parent
f08188d5cf
commit
a49719d73e
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -48,7 +48,7 @@ class AvailabilityProbesHealthEndpointGroups implements HealthEndpointGroups {
|
||||
private static final String READINESS = "readiness";
|
||||
|
||||
AvailabilityProbesHealthEndpointGroups(HealthEndpointGroups groups, boolean addAdditionalPaths) {
|
||||
Assert.notNull(groups, "Groups must not be null");
|
||||
Assert.notNull(groups, "'groups' must not be null");
|
||||
this.groups = groups;
|
||||
this.probeGroups = createProbeGroups(addAdditionalPaths);
|
||||
Set<String> names = new LinkedHashSet<>(groups.getNames());
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -37,7 +37,7 @@ class DelegatingAvailabilityProbesHealthEndpointGroup implements HealthEndpointG
|
||||
|
||||
DelegatingAvailabilityProbesHealthEndpointGroup(HealthEndpointGroup delegate,
|
||||
AdditionalHealthEndpointPath additionalPath) {
|
||||
Assert.notNull(delegate, "Delegate must not be null");
|
||||
Assert.notNull(delegate, "'delegate' must not be null");
|
||||
this.delegate = delegate;
|
||||
this.additionalPath = additionalPath;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -56,8 +56,8 @@ class ReactiveCloudFoundrySecurityService {
|
||||
|
||||
ReactiveCloudFoundrySecurityService(WebClient.Builder webClientBuilder, String cloudControllerUrl,
|
||||
boolean skipSslValidation) {
|
||||
Assert.notNull(webClientBuilder, "WebClient must not be null");
|
||||
Assert.notNull(cloudControllerUrl, "CloudControllerUrl must not be null");
|
||||
Assert.notNull(webClientBuilder, "'webClientBuilder' must not be null");
|
||||
Assert.notNull(cloudControllerUrl, "'cloudControllerUrl' must not be null");
|
||||
if (skipSslValidation) {
|
||||
webClientBuilder.clientConnector(buildTrustAllSslConnector());
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -49,8 +49,8 @@ class CloudFoundrySecurityService {
|
||||
|
||||
CloudFoundrySecurityService(RestTemplateBuilder restTemplateBuilder, String cloudControllerUrl,
|
||||
boolean skipSslValidation) {
|
||||
Assert.notNull(restTemplateBuilder, "RestTemplateBuilder must not be null");
|
||||
Assert.notNull(cloudControllerUrl, "CloudControllerUrl must not be null");
|
||||
Assert.notNull(restTemplateBuilder, "'restTemplateBuilder' must not be null");
|
||||
Assert.notNull(cloudControllerUrl, "'cloudControllerUrl' must not be null");
|
||||
if (skipSslValidation) {
|
||||
restTemplateBuilder = restTemplateBuilder.requestFactory(SkipSslVerificationHttpRequestFactory.class);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -80,10 +80,10 @@ public class IncludeExcludeEndpointFilter<E extends ExposableEndpoint<?>> implem
|
||||
|
||||
private IncludeExcludeEndpointFilter(Class<E> endpointType, Environment environment, String prefix,
|
||||
EndpointPatterns defaultIncludes) {
|
||||
Assert.notNull(endpointType, "EndpointType must not be null");
|
||||
Assert.notNull(environment, "Environment must not be null");
|
||||
Assert.hasText(prefix, "Prefix must not be empty");
|
||||
Assert.notNull(defaultIncludes, "DefaultIncludes must not be null");
|
||||
Assert.notNull(endpointType, "'endpointType' must not be null");
|
||||
Assert.notNull(environment, "'environment' must not be null");
|
||||
Assert.hasText(prefix, "'prefix' must not be empty");
|
||||
Assert.notNull(defaultIncludes, "'defaultIncludes' must not be null");
|
||||
Binder binder = Binder.get(environment);
|
||||
this.endpointType = endpointType;
|
||||
this.include = new EndpointPatterns(bind(binder, prefix + ".include"));
|
||||
@ -93,8 +93,8 @@ public class IncludeExcludeEndpointFilter<E extends ExposableEndpoint<?>> implem
|
||||
|
||||
private IncludeExcludeEndpointFilter(Class<E> endpointType, Collection<String> include, Collection<String> exclude,
|
||||
EndpointPatterns defaultIncludes) {
|
||||
Assert.notNull(endpointType, "EndpointType Type must not be null");
|
||||
Assert.notNull(defaultIncludes, "DefaultIncludes must not be null");
|
||||
Assert.notNull(endpointType, "'endpointType' Type must not be null");
|
||||
Assert.notNull(defaultIncludes, "'defaultIncludes' must not be null");
|
||||
this.endpointType = endpointType;
|
||||
this.include = new EndpointPatterns(include);
|
||||
this.defaultIncludes = defaultIncludes;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -62,7 +62,7 @@ public class WebEndpointProperties {
|
||||
}
|
||||
|
||||
public void setBasePath(String basePath) {
|
||||
Assert.isTrue(basePath.isEmpty() || basePath.startsWith("/"), "Base path must start with '/' or be empty");
|
||||
Assert.isTrue(basePath.isEmpty() || basePath.startsWith("/"), "'basePath' must start with '/' or be empty");
|
||||
this.basePath = cleanBasePath(basePath);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -47,7 +47,7 @@ public abstract class AbstractCompositeHealthContributorConfiguration<C, I exten
|
||||
}
|
||||
|
||||
protected final C createContributor(Map<String, B> beans) {
|
||||
Assert.notEmpty(beans, "Beans must not be empty");
|
||||
Assert.notEmpty(beans, "'beans' must not be empty");
|
||||
if (beans.size() == 1) {
|
||||
return createIndicator(beans.values().iterator().next());
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -97,7 +97,7 @@ public class DataSourceHealthContributorAutoConfiguration implements Initializin
|
||||
}
|
||||
|
||||
private HealthContributor createContributor(Map<String, DataSource> beans) {
|
||||
Assert.notEmpty(beans, "Beans must not be empty");
|
||||
Assert.notEmpty(beans, "'beans' must not be empty");
|
||||
if (beans.size() == 1) {
|
||||
return createContributor(beans.values().iterator().next());
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -43,7 +43,7 @@ public final class OnlyOnceLoggingDenyMeterFilter implements MeterFilter {
|
||||
private final Supplier<String> message;
|
||||
|
||||
public OnlyOnceLoggingDenyMeterFilter(Supplier<String> message) {
|
||||
Assert.notNull(message, "Message must not be null");
|
||||
Assert.notNull(message, "'message' must not be null");
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -51,7 +51,7 @@ public class PropertiesMeterFilter implements MeterFilter {
|
||||
private final MeterFilter mapFilter;
|
||||
|
||||
public PropertiesMeterFilter(MetricsProperties properties) {
|
||||
Assert.notNull(properties, "Properties must not be null");
|
||||
Assert.notNull(properties, "'properties' must not be null");
|
||||
this.properties = properties;
|
||||
this.mapFilter = createMapFilter(properties.getTags());
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -38,7 +38,7 @@ public class PropertiesConfigAdapter<T> {
|
||||
* @param properties the source properties
|
||||
*/
|
||||
public PropertiesConfigAdapter(T properties) {
|
||||
Assert.notNull(properties, "Properties must not be null");
|
||||
Assert.notNull(properties, "'properties' must not be null");
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -56,7 +56,7 @@ public class DiskSpaceHealthIndicatorProperties {
|
||||
}
|
||||
|
||||
public void setThreshold(DataSize threshold) {
|
||||
Assert.isTrue(!threshold.isNegative(), "threshold must be greater than or equal to 0");
|
||||
Assert.isTrue(!threshold.isNegative(), "'threshold' must be greater than or equal to 0");
|
||||
this.threshold = threshold;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -37,7 +37,7 @@ class LocalBaggageFields {
|
||||
private final List<String> fields;
|
||||
|
||||
LocalBaggageFields(List<String> fields) {
|
||||
Assert.notNull(fields, "fields must not be null");
|
||||
Assert.notNull(fields, "'fields' must not be null");
|
||||
this.fields = fields;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -68,7 +68,7 @@ public interface SpanExporters extends Iterable<SpanExporter> {
|
||||
* @return the constructed {@link SpanExporters} instance
|
||||
*/
|
||||
static SpanExporters of(Collection<? extends SpanExporter> spanExporters) {
|
||||
Assert.notNull(spanExporters, "SpanExporters must not be null");
|
||||
Assert.notNull(spanExporters, "'spanExporters' must not be null");
|
||||
List<SpanExporter> copy = List.copyOf(spanExporters);
|
||||
return () -> copy;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -68,7 +68,7 @@ public interface SpanProcessors extends Iterable<SpanProcessor> {
|
||||
* @return the constructed {@link SpanProcessors} instance
|
||||
*/
|
||||
static SpanProcessors of(Collection<? extends SpanProcessor> spanProcessors) {
|
||||
Assert.notNull(spanProcessors, "SpanProcessors must not be null");
|
||||
Assert.notNull(spanProcessors, "'spanProcessors' must not be null");
|
||||
List<SpanProcessor> copy = List.copyOf(spanProcessors);
|
||||
return () -> copy;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -47,8 +47,8 @@ public class ManagementErrorEndpoint {
|
||||
private final ErrorProperties errorProperties;
|
||||
|
||||
public ManagementErrorEndpoint(ErrorAttributes errorAttributes, ErrorProperties errorProperties) {
|
||||
Assert.notNull(errorAttributes, "ErrorAttributes must not be null");
|
||||
Assert.notNull(errorProperties, "ErrorProperties must not be null");
|
||||
Assert.notNull(errorAttributes, "'errorAttributes' must not be null");
|
||||
Assert.notNull(errorProperties, "'errorProperties' must not be null");
|
||||
this.errorAttributes = errorAttributes;
|
||||
this.errorProperties = errorProperties;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -52,7 +52,7 @@ class AvailabilityProbesHealthEndpointGroupsTests {
|
||||
@Test
|
||||
void createWhenGroupsIsNullThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new AvailabilityProbesHealthEndpointGroups(null, false))
|
||||
.withMessage("Groups must not be null");
|
||||
.withMessage("'groups' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -45,28 +45,28 @@ class IncludeExcludeEndpointFilterTests {
|
||||
void createWhenEndpointTypeIsNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> new IncludeExcludeEndpointFilter<>(null, new MockEnvironment(), "foo"))
|
||||
.withMessageContaining("EndpointType must not be null");
|
||||
.withMessageContaining("'endpointType' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
void createWhenEnvironmentIsNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> new IncludeExcludeEndpointFilter<>(ExposableEndpoint.class, null, "foo"))
|
||||
.withMessageContaining("Environment must not be null");
|
||||
.withMessageContaining("'environment' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
void createWhenPrefixIsNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> new IncludeExcludeEndpointFilter<>(ExposableEndpoint.class, new MockEnvironment(), null))
|
||||
.withMessageContaining("Prefix must not be empty");
|
||||
.withMessageContaining("'prefix' must not be empty");
|
||||
}
|
||||
|
||||
@Test
|
||||
void createWhenPrefixIsEmptyShouldThrowException() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> new IncludeExcludeEndpointFilter<>(ExposableEndpoint.class, new MockEnvironment(), ""))
|
||||
.withMessageContaining("Prefix must not be empty");
|
||||
.withMessageContaining("'prefix' must not be empty");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -47,7 +47,7 @@ class WebEndpointPropertiesTests {
|
||||
void basePathMustStartWithSlash() {
|
||||
WebEndpointProperties properties = new WebEndpointProperties();
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> properties.setBasePath("admin"))
|
||||
.withMessageContaining("Base path must start with '/' or be empty");
|
||||
.withMessageContaining("'basePath' must start with '/' or be empty");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -49,7 +49,7 @@ abstract class AbstractCompositeHealthContributorConfigurationTests<C, I extends
|
||||
void createContributorWhenBeansIsEmptyThrowsException() {
|
||||
Map<String, TestBean> beans = Collections.emptyMap();
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> newComposite().createContributor(beans))
|
||||
.withMessage("Beans must not be empty");
|
||||
.withMessage("'beans' must not be empty");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -48,7 +48,7 @@ class PropertiesMeterFilterTests {
|
||||
@Test
|
||||
void createWhenPropertiesIsNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new PropertiesMeterFilter(null))
|
||||
.withMessageContaining("Properties must not be null");
|
||||
.withMessageContaining("'properties' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -49,7 +49,7 @@ class DiskSpaceHealthContributorAutoConfigurationTests {
|
||||
.run((context) -> assertThat(context).hasFailed()
|
||||
.getFailure()
|
||||
.rootCause()
|
||||
.hasMessage("threshold must be greater than or equal to 0"));
|
||||
.hasMessage("'threshold' must be greater than or equal to 0"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -35,7 +35,7 @@ public class RabbitHealthIndicator extends AbstractHealthIndicator {
|
||||
|
||||
public RabbitHealthIndicator(RabbitTemplate rabbitTemplate) {
|
||||
super("Rabbit health check failed");
|
||||
Assert.notNull(rabbitTemplate, "RabbitTemplate must not be null");
|
||||
Assert.notNull(rabbitTemplate, "'rabbitTemplate' must not be null");
|
||||
this.rabbitTemplate = rabbitTemplate;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -83,8 +83,8 @@ public class AuditEvent implements Serializable {
|
||||
* @param data the event data
|
||||
*/
|
||||
public AuditEvent(Instant timestamp, String principal, String type, Map<String, Object> data) {
|
||||
Assert.notNull(timestamp, "Timestamp must not be null");
|
||||
Assert.notNull(type, "Type must not be null");
|
||||
Assert.notNull(timestamp, "'timestamp' must not be null");
|
||||
Assert.notNull(type, "'type' must not be null");
|
||||
this.timestamp = timestamp;
|
||||
this.principal = (principal != null) ? principal : "";
|
||||
this.type = type;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -38,7 +38,7 @@ public class AuditEventsEndpoint {
|
||||
private final AuditEventRepository auditEventRepository;
|
||||
|
||||
public AuditEventsEndpoint(AuditEventRepository auditEventRepository) {
|
||||
Assert.notNull(auditEventRepository, "AuditEventRepository must not be null");
|
||||
Assert.notNull(auditEventRepository, "'auditEventRepository' must not be null");
|
||||
this.auditEventRepository = auditEventRepository;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -63,7 +63,7 @@ public class InMemoryAuditEventRepository implements AuditEventRepository {
|
||||
|
||||
@Override
|
||||
public void add(AuditEvent event) {
|
||||
Assert.notNull(event, "AuditEvent must not be null");
|
||||
Assert.notNull(event, "'event' must not be null");
|
||||
synchronized (this.monitor) {
|
||||
this.tail = (this.tail + 1) % this.events.length;
|
||||
this.events[this.tail] = event;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -77,7 +77,7 @@ public class AuditApplicationEvent extends ApplicationEvent {
|
||||
*/
|
||||
public AuditApplicationEvent(AuditEvent auditEvent) {
|
||||
super(auditEvent);
|
||||
Assert.notNull(auditEvent, "AuditEvent must not be null");
|
||||
Assert.notNull(auditEvent, "'auditEvent' must not be null");
|
||||
this.auditEvent = auditEvent;
|
||||
}
|
||||
|
||||
|
@ -55,9 +55,9 @@ public class AvailabilityStateHealthIndicator extends AbstractHealthIndicator {
|
||||
public <S extends AvailabilityState> AvailabilityStateHealthIndicator(
|
||||
ApplicationAvailability applicationAvailability, Class<S> stateType,
|
||||
Consumer<StatusMappings<S>> statusMappings) {
|
||||
Assert.notNull(applicationAvailability, "ApplicationAvailability must not be null");
|
||||
Assert.notNull(stateType, "StateType must not be null");
|
||||
Assert.notNull(statusMappings, "StatusMappings must not be null");
|
||||
Assert.notNull(applicationAvailability, "'applicationAvailability' must not be null");
|
||||
Assert.notNull(stateType, "'stateType' must not be null");
|
||||
Assert.notNull(statusMappings, "'statusMappings' must not be null");
|
||||
this.applicationAvailability = applicationAvailability;
|
||||
this.stateType = stateType;
|
||||
statusMappings.accept(this.statusMappings::put);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -47,7 +47,7 @@ public class CassandraDriverHealthIndicator extends AbstractHealthIndicator {
|
||||
*/
|
||||
public CassandraDriverHealthIndicator(CqlSession session) {
|
||||
super("Cassandra health check failed");
|
||||
Assert.notNull(session, "session must not be null");
|
||||
Assert.notNull(session, "'session' must not be null");
|
||||
this.session = session;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -48,7 +48,7 @@ public class CassandraDriverReactiveHealthIndicator extends AbstractReactiveHeal
|
||||
*/
|
||||
public CassandraDriverReactiveHealthIndicator(CqlSession session) {
|
||||
super("Cassandra health check failed");
|
||||
Assert.notNull(session, "session must not be null");
|
||||
Assert.notNull(session, "'session' must not be null");
|
||||
this.session = session;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -42,7 +42,7 @@ public class CouchbaseHealthIndicator extends AbstractHealthIndicator {
|
||||
*/
|
||||
public CouchbaseHealthIndicator(Cluster cluster) {
|
||||
super("Couchbase health check failed");
|
||||
Assert.notNull(cluster, "Cluster must not be null");
|
||||
Assert.notNull(cluster, "'cluster' must not be null");
|
||||
this.cluster = cluster;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -37,7 +37,7 @@ public class MongoReactiveHealthIndicator extends AbstractReactiveHealthIndicato
|
||||
|
||||
public MongoReactiveHealthIndicator(ReactiveMongoTemplate reactiveMongoTemplate) {
|
||||
super("Mongo health check failed");
|
||||
Assert.notNull(reactiveMongoTemplate, "ReactiveMongoTemplate must not be null");
|
||||
Assert.notNull(reactiveMongoTemplate, "'reactiveMongoTemplate' must not be null");
|
||||
this.reactiveMongoTemplate = reactiveMongoTemplate;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -40,7 +40,7 @@ public class RedisHealthIndicator extends AbstractHealthIndicator {
|
||||
|
||||
public RedisHealthIndicator(RedisConnectionFactory connectionFactory) {
|
||||
super("Redis health check failed");
|
||||
Assert.notNull(connectionFactory, "ConnectionFactory must not be null");
|
||||
Assert.notNull(connectionFactory, "'connectionFactory' must not be null");
|
||||
this.redisConnectionFactory = connectionFactory;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -57,8 +57,8 @@ public abstract class AbstractExposableEndpoint<O extends Operation> implements
|
||||
* @since 3.4.0
|
||||
*/
|
||||
public AbstractExposableEndpoint(EndpointId id, Access defaultAccess, Collection<? extends O> operations) {
|
||||
Assert.notNull(id, "ID must not be null");
|
||||
Assert.notNull(operations, "Operations must not be null");
|
||||
Assert.notNull(id, "'id' must not be null");
|
||||
Assert.notNull(operations, "'operations' must not be null");
|
||||
this.id = id;
|
||||
this.defaultAccess = defaultAccess;
|
||||
this.operations = List.copyOf(operations);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -47,7 +47,7 @@ public enum Access {
|
||||
* @return this access if less than the maximum or the maximum permitted
|
||||
*/
|
||||
public Access cap(Access maxPermitted) {
|
||||
Assert.notNull(maxPermitted, "'maxPermittedAccess' must not be null");
|
||||
Assert.notNull(maxPermitted, "'maxPermitted' must not be null");
|
||||
return (ordinal() <= maxPermitted.ordinal()) ? this : maxPermitted;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -54,10 +54,10 @@ public final class EndpointId {
|
||||
private final String lowerCaseAlphaNumeric;
|
||||
|
||||
private EndpointId(String value) {
|
||||
Assert.hasText(value, "Value must not be empty");
|
||||
Assert.isTrue(VALID_PATTERN.matcher(value).matches(), "Value must only contain valid chars");
|
||||
Assert.isTrue(!Character.isDigit(value.charAt(0)), "Value must not start with a number");
|
||||
Assert.isTrue(!Character.isUpperCase(value.charAt(0)), "Value must not start with an uppercase letter");
|
||||
Assert.hasText(value, "'value' must not be empty");
|
||||
Assert.isTrue(VALID_PATTERN.matcher(value).matches(), "'value' must only contain valid chars");
|
||||
Assert.isTrue(!Character.isDigit(value.charAt(0)), "'value' must not start with a number");
|
||||
Assert.isTrue(!Character.isUpperCase(value.charAt(0)), "'value' must not start with an uppercase letter");
|
||||
if (WARNING_PATTERN.matcher(value).find()) {
|
||||
logWarning(value);
|
||||
}
|
||||
@ -125,7 +125,7 @@ public final class EndpointId {
|
||||
* @since 2.2.0
|
||||
*/
|
||||
public static EndpointId of(Environment environment, String value) {
|
||||
Assert.notNull(environment, "Environment must not be null");
|
||||
Assert.notNull(environment, "'environment' must not be null");
|
||||
return new EndpointId(migrateLegacyId(environment, value));
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -48,8 +48,8 @@ public class InvocationContext {
|
||||
*/
|
||||
public InvocationContext(SecurityContext securityContext, Map<String, Object> arguments,
|
||||
OperationArgumentResolver... argumentResolvers) {
|
||||
Assert.notNull(securityContext, "SecurityContext must not be null");
|
||||
Assert.notNull(arguments, "Arguments must not be null");
|
||||
Assert.notNull(securityContext, "'securityContext' must not be null");
|
||||
Assert.notNull(arguments, "'arguments' must not be null");
|
||||
this.arguments = arguments;
|
||||
this.argumentResolvers = new ArrayList<>();
|
||||
if (argumentResolvers != null) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -53,8 +53,8 @@ public interface OperationArgumentResolver {
|
||||
* @return an {@link OperationArgumentResolver} instance
|
||||
*/
|
||||
static <T> OperationArgumentResolver of(Class<T> type, Supplier<? extends T> supplier) {
|
||||
Assert.notNull(type, "Type must not be null");
|
||||
Assert.notNull(supplier, "Supplier must not be null");
|
||||
Assert.notNull(type, "'type' must not be null");
|
||||
Assert.notNull(supplier, "'supplier' must not be null");
|
||||
return new OperationArgumentResolver() {
|
||||
|
||||
@Override
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -70,8 +70,8 @@ public abstract class AbstractDiscoveredEndpoint<O extends Operation> extends Ab
|
||||
public AbstractDiscoveredEndpoint(EndpointDiscoverer<?, ?> discoverer, Object endpointBean, EndpointId id,
|
||||
Access defaultAccess, Collection<? extends O> operations) {
|
||||
super(id, defaultAccess, operations);
|
||||
Assert.notNull(discoverer, "Discoverer must not be null");
|
||||
Assert.notNull(endpointBean, "EndpointBean must not be null");
|
||||
Assert.notNull(discoverer, "'discoverer' must not be null");
|
||||
Assert.notNull(endpointBean, "'endpointBean' must not be null");
|
||||
this.discoverer = discoverer;
|
||||
this.endpointBean = endpointBean;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -41,7 +41,7 @@ public class DiscoveredOperationMethod extends OperationMethod {
|
||||
public DiscoveredOperationMethod(Method method, OperationType operationType,
|
||||
AnnotationAttributes annotationAttributes) {
|
||||
super(method, operationType);
|
||||
Assert.notNull(annotationAttributes, "AnnotationAttributes must not be null");
|
||||
Assert.notNull(annotationAttributes, "'annotationAttributes' must not be null");
|
||||
List<String> producesMediaTypes = new ArrayList<>();
|
||||
producesMediaTypes.addAll(Arrays.asList(annotationAttributes.getStringArray("produces")));
|
||||
producesMediaTypes.addAll(getProducesFromProducible(annotationAttributes));
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -35,7 +35,7 @@ public abstract class DiscovererEndpointFilter implements EndpointFilter<Discove
|
||||
* @param discoverer the required discoverer
|
||||
*/
|
||||
protected DiscovererEndpointFilter(Class<? extends EndpointDiscoverer<?, ?>> discoverer) {
|
||||
Assert.notNull(discoverer, "Discoverer must not be null");
|
||||
Assert.notNull(discoverer, "'discoverer' must not be null");
|
||||
this.discoverer = discoverer;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -111,11 +111,11 @@ public abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>, O exten
|
||||
public EndpointDiscoverer(ApplicationContext applicationContext, ParameterValueMapper parameterValueMapper,
|
||||
Collection<OperationInvokerAdvisor> invokerAdvisors, Collection<EndpointFilter<E>> endpointFilters,
|
||||
Collection<OperationFilter<O>> operationFilters) {
|
||||
Assert.notNull(applicationContext, "ApplicationContext must not be null");
|
||||
Assert.notNull(parameterValueMapper, "ParameterValueMapper must not be null");
|
||||
Assert.notNull(invokerAdvisors, "InvokerAdvisors must not be null");
|
||||
Assert.notNull(endpointFilters, "EndpointFilters must not be null");
|
||||
Assert.notNull(operationFilters, "OperationFilters must not be null");
|
||||
Assert.notNull(applicationContext, "'applicationContext' must not be null");
|
||||
Assert.notNull(parameterValueMapper, "'parameterValueMapper' must not be null");
|
||||
Assert.notNull(invokerAdvisors, "'invokerAdvisors' must not be null");
|
||||
Assert.notNull(endpointFilters, "'endpointFilters' must not be null");
|
||||
Assert.notNull(operationFilters, "'operationFilters' must not be null");
|
||||
this.applicationContext = applicationContext;
|
||||
this.endpointFilters = Collections.unmodifiableCollection(endpointFilters);
|
||||
this.operationFilters = Collections.unmodifiableCollection(operationFilters);
|
||||
@ -440,8 +440,8 @@ public abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>, O exten
|
||||
* @param description a human-readable description of the key
|
||||
*/
|
||||
public OperationKey(Object key, Supplier<String> description) {
|
||||
Assert.notNull(key, "Key must not be null");
|
||||
Assert.notNull(description, "Description must not be null");
|
||||
Assert.notNull(key, "'key' must not be null");
|
||||
Assert.notNull(description, "'description' must not be null");
|
||||
this.key = key;
|
||||
this.description = description;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -47,7 +47,7 @@ public class ConversionServiceParameterValueMapper implements ParameterValueMapp
|
||||
* @param conversionService the conversion service
|
||||
*/
|
||||
public ConversionServiceParameterValueMapper(ConversionService conversionService) {
|
||||
Assert.notNull(conversionService, "ConversionService must not be null");
|
||||
Assert.notNull(conversionService, "'conversionService' must not be null");
|
||||
this.conversionService = conversionService;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -48,8 +48,8 @@ public class OperationMethod {
|
||||
* @param operationType the operation type
|
||||
*/
|
||||
public OperationMethod(Method method, OperationType operationType) {
|
||||
Assert.notNull(method, "Method must not be null");
|
||||
Assert.notNull(operationType, "OperationType must not be null");
|
||||
Assert.notNull(method, "'method' must not be null");
|
||||
Assert.notNull(operationType, "'operationType' must not be null");
|
||||
this.method = method;
|
||||
this.operationType = operationType;
|
||||
this.operationParameters = new OperationMethodParameters(method, DEFAULT_PARAMETER_NAME_DISCOVERER);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -44,8 +44,8 @@ class OperationMethodParameters implements OperationParameters {
|
||||
* @param parameterNameDiscoverer the parameter name discoverer
|
||||
*/
|
||||
OperationMethodParameters(Method method, ParameterNameDiscoverer parameterNameDiscoverer) {
|
||||
Assert.notNull(method, "Method must not be null");
|
||||
Assert.notNull(parameterNameDiscoverer, "ParameterNameDiscoverer must not be null");
|
||||
Assert.notNull(method, "'method' must not be null");
|
||||
Assert.notNull(parameterNameDiscoverer, "'parameterNameDiscoverer' must not be null");
|
||||
String[] parameterNames = parameterNameDiscoverer.getParameterNames(method);
|
||||
Parameter[] parameters = method.getParameters();
|
||||
Assert.state(parameterNames != null, () -> "Failed to extract parameter names for " + method);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -56,9 +56,9 @@ public class ReflectiveOperationInvoker implements OperationInvoker {
|
||||
*/
|
||||
public ReflectiveOperationInvoker(Object target, OperationMethod operationMethod,
|
||||
ParameterValueMapper parameterValueMapper) {
|
||||
Assert.notNull(target, "Target must not be null");
|
||||
Assert.notNull(operationMethod, "OperationMethod must not be null");
|
||||
Assert.notNull(parameterValueMapper, "ParameterValueMapper must not be null");
|
||||
Assert.notNull(target, "'target' must not be null");
|
||||
Assert.notNull(operationMethod, "'operationMethod' must not be null");
|
||||
Assert.notNull(parameterValueMapper, "'parameterValueMapper' must not be null");
|
||||
ReflectionUtils.makeAccessible(operationMethod.getMethod());
|
||||
this.target = target;
|
||||
this.operationMethod = operationMethod;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -65,7 +65,7 @@ public class CachingOperationInvoker implements OperationInvoker {
|
||||
* @param timeToLive the maximum time in milliseconds that a response can be cached
|
||||
*/
|
||||
CachingOperationInvoker(OperationInvoker invoker, long timeToLive) {
|
||||
Assert.isTrue(timeToLive > 0, "TimeToLive must be strictly positive");
|
||||
Assert.isTrue(timeToLive > 0, "'timeToLive' must be greater than zero");
|
||||
this.invoker = invoker;
|
||||
this.timeToLive = timeToLive;
|
||||
this.cachedResponses = new ConcurrentReferenceHashMap<>();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -63,8 +63,8 @@ public class EndpointMBean implements DynamicMBean {
|
||||
private final Map<String, JmxOperation> operations;
|
||||
|
||||
EndpointMBean(JmxOperationResponseMapper responseMapper, ClassLoader classLoader, ExposableJmxEndpoint endpoint) {
|
||||
Assert.notNull(responseMapper, "ResponseMapper must not be null");
|
||||
Assert.notNull(endpoint, "Endpoint must not be null");
|
||||
Assert.notNull(responseMapper, "'responseMapper' must not be null");
|
||||
Assert.notNull(endpoint, "'endpoint' must not be null");
|
||||
this.responseMapper = responseMapper;
|
||||
this.classLoader = classLoader;
|
||||
this.endpoint = endpoint;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -61,10 +61,10 @@ public class JmxEndpointExporter implements InitializingBean, DisposableBean, Be
|
||||
|
||||
public JmxEndpointExporter(MBeanServer mBeanServer, EndpointObjectNameFactory objectNameFactory,
|
||||
JmxOperationResponseMapper responseMapper, Collection<? extends ExposableJmxEndpoint> endpoints) {
|
||||
Assert.notNull(mBeanServer, "MBeanServer must not be null");
|
||||
Assert.notNull(objectNameFactory, "ObjectNameFactory must not be null");
|
||||
Assert.notNull(responseMapper, "ResponseMapper must not be null");
|
||||
Assert.notNull(endpoints, "Endpoints must not be null");
|
||||
Assert.notNull(mBeanServer, "'mBeanServer' must not be null");
|
||||
Assert.notNull(objectNameFactory, "'objectNameFactory' must not be null");
|
||||
Assert.notNull(responseMapper, "'responseMapper' must not be null");
|
||||
Assert.notNull(endpoints, "'endpoints' must not be null");
|
||||
this.mBeanServer = mBeanServer;
|
||||
this.objectNameFactory = objectNameFactory;
|
||||
this.responseMapper = responseMapper;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -72,8 +72,8 @@ public class EndpointMediaTypes {
|
||||
* @param consumed the default media types that are consumed by an endpoint. Must not
|
||||
*/
|
||||
public EndpointMediaTypes(List<String> produced, List<String> consumed) {
|
||||
Assert.notNull(produced, "Produced must not be null");
|
||||
Assert.notNull(consumed, "Consumed must not be null");
|
||||
Assert.notNull(produced, "'produced' must not be null");
|
||||
Assert.notNull(consumed, "'consumed' must not be null");
|
||||
this.produced = Collections.unmodifiableList(produced);
|
||||
this.consumed = Collections.unmodifiableList(consumed);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -49,7 +49,7 @@ public final class EndpointServlet {
|
||||
}
|
||||
|
||||
private static Servlet instantiateClass(Class<? extends Servlet> servlet) {
|
||||
Assert.notNull(servlet, "Servlet must not be null");
|
||||
Assert.notNull(servlet, "'servlet' must not be null");
|
||||
return BeanUtils.instantiateClass(servlet);
|
||||
}
|
||||
|
||||
@ -58,21 +58,21 @@ public final class EndpointServlet {
|
||||
}
|
||||
|
||||
private EndpointServlet(Servlet servlet, Map<String, String> initParameters, int loadOnStartup) {
|
||||
Assert.notNull(servlet, "Servlet must not be null");
|
||||
Assert.notNull(servlet, "'servlet' must not be null");
|
||||
this.servlet = servlet;
|
||||
this.initParameters = Collections.unmodifiableMap(initParameters);
|
||||
this.loadOnStartup = loadOnStartup;
|
||||
}
|
||||
|
||||
public EndpointServlet withInitParameter(String name, String value) {
|
||||
Assert.hasText(name, "Name must not be empty");
|
||||
Assert.hasText(name, "'name' must not be empty");
|
||||
return withInitParameters(Collections.singletonMap(name, value));
|
||||
}
|
||||
|
||||
public EndpointServlet withInitParameters(Map<String, String> initParameters) {
|
||||
Assert.notNull(initParameters, "InitParameters must not be null");
|
||||
Assert.notNull(initParameters, "'initParameters' must not be null");
|
||||
boolean hasEmptyName = initParameters.keySet().stream().anyMatch((name) -> !StringUtils.hasText(name));
|
||||
Assert.isTrue(!hasEmptyName, "InitParameters must not contain empty names");
|
||||
Assert.isTrue(!hasEmptyName, "'initParameters' must not contain empty names");
|
||||
Map<String, String> mergedInitParameters = new LinkedHashMap<>(this.initParameters);
|
||||
mergedInitParameters.putAll(initParameters);
|
||||
return new EndpointServlet(this.servlet, mergedInitParameters, this.loadOnStartup);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -38,7 +38,7 @@ public class Link {
|
||||
* @param href the href
|
||||
*/
|
||||
public Link(String href) {
|
||||
Assert.notNull(href, "HREF must not be null");
|
||||
Assert.notNull(href, "'href' must not be null");
|
||||
this.href = href;
|
||||
this.templated = href.contains("{");
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -47,7 +47,7 @@ public class PathMappedEndpoints implements Iterable<PathMappedEndpoint> {
|
||||
* @param supplier the endpoint supplier
|
||||
*/
|
||||
public PathMappedEndpoints(String basePath, EndpointsSupplier<?> supplier) {
|
||||
Assert.notNull(supplier, "Supplier must not be null");
|
||||
Assert.notNull(supplier, "'supplier' must not be null");
|
||||
this.basePath = (basePath != null) ? basePath : "";
|
||||
this.endpoints = getEndpoints(Collections.singleton(supplier));
|
||||
}
|
||||
@ -58,7 +58,7 @@ public class PathMappedEndpoints implements Iterable<PathMappedEndpoint> {
|
||||
* @param suppliers the endpoint suppliers
|
||||
*/
|
||||
public PathMappedEndpoints(String basePath, Collection<EndpointsSupplier<?>> suppliers) {
|
||||
Assert.notNull(suppliers, "Suppliers must not be null");
|
||||
Assert.notNull(suppliers, "'suppliers' must not be null");
|
||||
this.basePath = (basePath != null) ? basePath : "";
|
||||
this.endpoints = getEndpoints(suppliers);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -49,7 +49,7 @@ public interface PathMapper {
|
||||
* @return the path of the endpoint
|
||||
*/
|
||||
static String getRootPath(List<PathMapper> pathMappers, EndpointId endpointId) {
|
||||
Assert.notNull(endpointId, "EndpointId must not be null");
|
||||
Assert.notNull(endpointId, "'endpointId' must not be null");
|
||||
if (pathMappers != null) {
|
||||
for (PathMapper mapper : pathMappers) {
|
||||
String path = mapper.getRootPath(endpointId);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -70,7 +70,7 @@ public class ServletEndpointRegistrar implements ServletContextInitializer {
|
||||
|
||||
public ServletEndpointRegistrar(String basePath, Collection<ExposableServletEndpoint> servletEndpoints,
|
||||
EndpointAccessResolver endpointAccessResolver) {
|
||||
Assert.notNull(servletEndpoints, "ServletEndpoints must not be null");
|
||||
Assert.notNull(servletEndpoints, "'servletEndpoints' must not be null");
|
||||
this.basePath = cleanBasePath(basePath);
|
||||
this.servletEndpoints = servletEndpoints;
|
||||
this.endpointAccessResolver = endpointAccessResolver;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -47,7 +47,7 @@ class RequestPredicateFactory {
|
||||
private final EndpointMediaTypes endpointMediaTypes;
|
||||
|
||||
RequestPredicateFactory(EndpointMediaTypes endpointMediaTypes) {
|
||||
Assert.notNull(endpointMediaTypes, "EndpointMediaTypes must not be null");
|
||||
Assert.notNull(endpointMediaTypes, "'endpointMediaTypes' must not be null");
|
||||
this.endpointMediaTypes = endpointMediaTypes;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -87,8 +87,8 @@ public class ControllerEndpointHandlerMapping extends RequestMappingHandlerMappi
|
||||
public ControllerEndpointHandlerMapping(EndpointMapping endpointMapping,
|
||||
Collection<ExposableControllerEndpoint> endpoints, CorsConfiguration corsConfiguration,
|
||||
EndpointAccessResolver endpointAccessResolver) {
|
||||
Assert.notNull(endpointMapping, "EndpointMapping must not be null");
|
||||
Assert.notNull(endpoints, "Endpoints must not be null");
|
||||
Assert.notNull(endpointMapping, "'endpointMapping' must not be null");
|
||||
Assert.notNull(endpoints, "'endpoints' must not be null");
|
||||
this.endpointMapping = endpointMapping;
|
||||
this.handlers = getHandlers(endpoints);
|
||||
this.corsConfiguration = corsConfiguration;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -88,8 +88,8 @@ public class ControllerEndpointHandlerMapping extends RequestMappingHandlerMappi
|
||||
public ControllerEndpointHandlerMapping(EndpointMapping endpointMapping,
|
||||
Collection<ExposableControllerEndpoint> endpoints, CorsConfiguration corsConfiguration,
|
||||
EndpointAccessResolver endpointAccessResolver) {
|
||||
Assert.notNull(endpointMapping, "EndpointMapping must not be null");
|
||||
Assert.notNull(endpoints, "Endpoints must not be null");
|
||||
Assert.notNull(endpointMapping, "'endpointMapping' must not be null");
|
||||
Assert.notNull(endpoints, "'endpoints' must not be null");
|
||||
this.endpointMapping = endpointMapping;
|
||||
this.handlers = getHandlers(endpoints);
|
||||
this.corsConfiguration = corsConfiguration;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -36,7 +36,7 @@ public class HazelcastHealthIndicator extends AbstractHealthIndicator {
|
||||
|
||||
public HazelcastHealthIndicator(HazelcastInstance hazelcast) {
|
||||
super("Hazelcast health check failed");
|
||||
Assert.notNull(hazelcast, "HazelcastInstance must not be null");
|
||||
Assert.notNull(hazelcast, "'hazelcast' must not be null");
|
||||
this.hazelcast = hazelcast;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -71,7 +71,7 @@ public abstract class AbstractHealthIndicator implements HealthIndicator {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
protected AbstractHealthIndicator(Function<Exception, String> healthCheckFailedMessage) {
|
||||
Assert.notNull(healthCheckFailedMessage, "HealthCheckFailedMessage must not be null");
|
||||
Assert.notNull(healthCheckFailedMessage, "'healthCheckFailedMessage' must not be null");
|
||||
this.healthCheckFailedMessage = healthCheckFailedMessage;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -70,7 +70,7 @@ public abstract class AbstractReactiveHealthIndicator implements ReactiveHealthI
|
||||
* @since 2.1.7
|
||||
*/
|
||||
protected AbstractReactiveHealthIndicator(Function<Throwable, String> healthCheckFailedMessage) {
|
||||
Assert.notNull(healthCheckFailedMessage, "HealthCheckFailedMessage must not be null");
|
||||
Assert.notNull(healthCheckFailedMessage, "'healthCheckFailedMessage' must not be null");
|
||||
this.healthCheckFailedMessage = healthCheckFailedMessage;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -103,10 +103,10 @@ public final class AdditionalHealthEndpointPath {
|
||||
* @return the new instance
|
||||
*/
|
||||
public static AdditionalHealthEndpointPath from(String value) {
|
||||
Assert.hasText(value, "Value must not be null");
|
||||
Assert.hasText(value, "'value' must not be null");
|
||||
String[] values = value.split(":");
|
||||
Assert.isTrue(values.length == 2, "Value must contain a valid namespace and value separated by ':'.");
|
||||
Assert.isTrue(StringUtils.hasText(values[0]), "Value must contain a valid namespace.");
|
||||
Assert.isTrue(values.length == 2, "'value' must contain a valid namespace and value separated by ':'.");
|
||||
Assert.isTrue(StringUtils.hasText(values[0]), "'value' must contain a valid namespace.");
|
||||
WebServerNamespace namespace = WebServerNamespace.from(values[0]);
|
||||
validateValue(values[1]);
|
||||
return new AdditionalHealthEndpointPath(namespace, values[1]);
|
||||
@ -120,15 +120,15 @@ public final class AdditionalHealthEndpointPath {
|
||||
* @return the new instance
|
||||
*/
|
||||
public static AdditionalHealthEndpointPath of(WebServerNamespace webServerNamespace, String value) {
|
||||
Assert.notNull(webServerNamespace, "The server namespace must not be null.");
|
||||
Assert.notNull(value, "The value must not be null.");
|
||||
Assert.notNull(webServerNamespace, "'webServerNamespace' must not be null.");
|
||||
Assert.notNull(value, "'value' must not be null.");
|
||||
validateValue(value);
|
||||
return new AdditionalHealthEndpointPath(webServerNamespace, value);
|
||||
}
|
||||
|
||||
private static void validateValue(String value) {
|
||||
Assert.isTrue(StringUtils.countOccurrencesOf(value, "/") <= 1 && value.indexOf("/") <= 0,
|
||||
"Value must contain only one segment.");
|
||||
"'value' must contain only one segment.");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -44,7 +44,7 @@ public class CompositeHealth extends HealthComponent {
|
||||
private final Map<String, HealthComponent> details;
|
||||
|
||||
CompositeHealth(ApiVersion apiVersion, Status status, Map<String, HealthComponent> components) {
|
||||
Assert.notNull(status, "Status must not be null");
|
||||
Assert.notNull(status, "'status' must not be null");
|
||||
this.status = status;
|
||||
this.components = (apiVersion != ApiVersion.V3) ? null : sort(components);
|
||||
this.details = (apiVersion != ApiVersion.V2) ? null : sort(components);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -33,7 +33,7 @@ class CompositeHealthContributorReactiveAdapter implements CompositeReactiveHeal
|
||||
private final CompositeHealthContributor delegate;
|
||||
|
||||
CompositeHealthContributorReactiveAdapter(CompositeHealthContributor delegate) {
|
||||
Assert.notNull(delegate, "Delegate must not be null");
|
||||
Assert.notNull(delegate, "'delegate' must not be null");
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -50,8 +50,8 @@ class DefaultContributorRegistry<C> implements ContributorRegistry<C> {
|
||||
}
|
||||
|
||||
DefaultContributorRegistry(Map<String, C> contributors, Function<String, String> nameFactory) {
|
||||
Assert.notNull(contributors, "Contributors must not be null");
|
||||
Assert.notNull(nameFactory, "NameFactory must not be null");
|
||||
Assert.notNull(contributors, "'contributors' must not be null");
|
||||
Assert.notNull(nameFactory, "'nameFactory' must not be null");
|
||||
this.nameFactory = nameFactory;
|
||||
Map<String, C> namedContributors = new LinkedHashMap<>();
|
||||
contributors.forEach((name, contributor) -> namedContributors.put(nameFactory.apply(name), contributor));
|
||||
@ -60,8 +60,8 @@ class DefaultContributorRegistry<C> implements ContributorRegistry<C> {
|
||||
|
||||
@Override
|
||||
public void registerContributor(String name, C contributor) {
|
||||
Assert.notNull(name, "Name must not be null");
|
||||
Assert.notNull(contributor, "Contributor must not be null");
|
||||
Assert.notNull(name, "'name' must not be null");
|
||||
Assert.notNull(contributor, "'contributor' must not be null");
|
||||
String adaptedName = this.nameFactory.apply(name);
|
||||
synchronized (this.monitor) {
|
||||
Assert.state(!this.contributors.containsKey(adaptedName),
|
||||
@ -74,7 +74,7 @@ class DefaultContributorRegistry<C> implements ContributorRegistry<C> {
|
||||
|
||||
@Override
|
||||
public C unregisterContributor(String name) {
|
||||
Assert.notNull(name, "Name must not be null");
|
||||
Assert.notNull(name, "'name' must not be null");
|
||||
String adaptedName = this.nameFactory.apply(name);
|
||||
synchronized (this.monitor) {
|
||||
C unregistered = this.contributors.get(adaptedName);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -60,7 +60,7 @@ public final class Health extends HealthComponent {
|
||||
* @param builder the Builder to use
|
||||
*/
|
||||
private Health(Builder builder) {
|
||||
Assert.notNull(builder, "Builder must not be null");
|
||||
Assert.notNull(builder, "'builder' must not be null");
|
||||
this.status = builder.status;
|
||||
this.details = Collections.unmodifiableMap(builder.details);
|
||||
}
|
||||
@ -207,7 +207,7 @@ public final class Health extends HealthComponent {
|
||||
* @param status the {@link Status} to use
|
||||
*/
|
||||
public Builder(Status status) {
|
||||
Assert.notNull(status, "Status must not be null");
|
||||
Assert.notNull(status, "'status' must not be null");
|
||||
this.status = status;
|
||||
this.details = new LinkedHashMap<>();
|
||||
}
|
||||
@ -219,21 +219,21 @@ public final class Health extends HealthComponent {
|
||||
* @param details the details {@link Map} to use
|
||||
*/
|
||||
public Builder(Status status, Map<String, ?> details) {
|
||||
Assert.notNull(status, "Status must not be null");
|
||||
Assert.notNull(details, "Details must not be null");
|
||||
Assert.notNull(status, "'status' must not be null");
|
||||
Assert.notNull(details, "'details' must not be null");
|
||||
this.status = status;
|
||||
this.details = new LinkedHashMap<>(details);
|
||||
}
|
||||
|
||||
/**
|
||||
* Record detail for given {@link Exception}.
|
||||
* @param ex the exception
|
||||
* @param exception the exception
|
||||
* @return this {@link Builder} instance
|
||||
*/
|
||||
public Builder withException(Throwable ex) {
|
||||
Assert.notNull(ex, "Exception must not be null");
|
||||
this.exception = ex;
|
||||
return withDetail("error", ex.getClass().getName() + ": " + ex.getMessage());
|
||||
public Builder withException(Throwable exception) {
|
||||
Assert.notNull(exception, "'exception' must not be null");
|
||||
this.exception = exception;
|
||||
return withDetail("error", exception.getClass().getName() + ": " + exception.getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -243,8 +243,8 @@ public final class Health extends HealthComponent {
|
||||
* @return this {@link Builder} instance
|
||||
*/
|
||||
public Builder withDetail(String key, Object value) {
|
||||
Assert.notNull(key, "Key must not be null");
|
||||
Assert.notNull(value, "Value must not be null");
|
||||
Assert.notNull(key, "'key' must not be null");
|
||||
Assert.notNull(value, "'value' must not be null");
|
||||
this.details.put(key, value);
|
||||
return this;
|
||||
}
|
||||
@ -257,7 +257,7 @@ public final class Health extends HealthComponent {
|
||||
* @since 2.1.0
|
||||
*/
|
||||
public Builder withDetails(Map<String, ?> details) {
|
||||
Assert.notNull(details, "Details must not be null");
|
||||
Assert.notNull(details, "'details' must not be null");
|
||||
this.details.putAll(details);
|
||||
return this;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -58,7 +58,7 @@ public interface HealthEndpointGroups {
|
||||
* @since 2.6.0
|
||||
*/
|
||||
default HealthEndpointGroup get(AdditionalHealthEndpointPath path) {
|
||||
Assert.notNull(path, "Path must not be null");
|
||||
Assert.notNull(path, "'path' must not be null");
|
||||
for (String name : getNames()) {
|
||||
HealthEndpointGroup group = get(name);
|
||||
if (path.equals(group.getAdditionalPath())) {
|
||||
@ -76,7 +76,7 @@ public interface HealthEndpointGroups {
|
||||
* @since 2.6.0
|
||||
*/
|
||||
default Set<HealthEndpointGroup> getAllWithAdditionalPath(WebServerNamespace namespace) {
|
||||
Assert.notNull(namespace, "Namespace must not be null");
|
||||
Assert.notNull(namespace, "'namespace' must not be null");
|
||||
Set<HealthEndpointGroup> filteredGroups = new LinkedHashSet<>();
|
||||
getNames().stream()
|
||||
.map(this::get)
|
||||
@ -92,8 +92,8 @@ public interface HealthEndpointGroups {
|
||||
* @return a new {@link HealthEndpointGroups} instance
|
||||
*/
|
||||
static HealthEndpointGroups of(HealthEndpointGroup primary, Map<String, HealthEndpointGroup> additional) {
|
||||
Assert.notNull(primary, "Primary must not be null");
|
||||
Assert.notNull(additional, "Additional must not be null");
|
||||
Assert.notNull(primary, "'primary' must not be null");
|
||||
Assert.notNull(additional, "'additional' must not be null");
|
||||
return new HealthEndpointGroups() {
|
||||
|
||||
@Override
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -63,8 +63,8 @@ abstract class HealthEndpointSupport<C, T> {
|
||||
*/
|
||||
HealthEndpointSupport(ContributorRegistry<C> registry, HealthEndpointGroups groups,
|
||||
Duration slowIndicatorLoggingThreshold) {
|
||||
Assert.notNull(registry, "Registry must not be null");
|
||||
Assert.notNull(groups, "Groups must not be null");
|
||||
Assert.notNull(registry, "'registry' must not be null");
|
||||
Assert.notNull(groups, "'groups' must not be null");
|
||||
this.registry = registry;
|
||||
this.groups = groups;
|
||||
this.slowIndicatorLoggingThreshold = slowIndicatorLoggingThreshold;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -32,7 +32,7 @@ class HealthIndicatorReactiveAdapter implements ReactiveHealthIndicator {
|
||||
private final HealthIndicator delegate;
|
||||
|
||||
HealthIndicatorReactiveAdapter(HealthIndicator delegate) {
|
||||
Assert.notNull(delegate, "Delegate must not be null");
|
||||
Assert.notNull(delegate, "'delegate' must not be null");
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -42,8 +42,8 @@ public interface NamedContributor<C> {
|
||||
C getContributor();
|
||||
|
||||
static <C> NamedContributor<C> of(String name, C contributor) {
|
||||
Assert.notNull(name, "Name must not be null");
|
||||
Assert.notNull(contributor, "Contributor must not be null");
|
||||
Assert.notNull(name, "'name' must not be null");
|
||||
Assert.notNull(contributor, "'contributor' must not be null");
|
||||
return new NamedContributor<>() {
|
||||
|
||||
@Override
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -40,24 +40,25 @@ abstract class NamedContributorsMapAdapter<V, C> implements NamedContributors<C>
|
||||
private final Map<String, C> map;
|
||||
|
||||
NamedContributorsMapAdapter(Map<String, V> map, Function<V, ? extends C> valueAdapter) {
|
||||
Assert.notNull(map, "Map must not be null");
|
||||
Assert.notNull(valueAdapter, "ValueAdapter must not be null");
|
||||
map.keySet().forEach(this::validateKey);
|
||||
this.map = Collections.unmodifiableMap(map.entrySet()
|
||||
.stream()
|
||||
.collect(LinkedHashMap::new,
|
||||
(result, entry) -> result.put(entry.getKey(), adapt(entry.getValue(), valueAdapter)), Map::putAll));
|
||||
Assert.notNull(map, "'map' must not be null");
|
||||
Assert.notNull(valueAdapter, "'valueAdapter' must not be null");
|
||||
map.keySet().forEach(this::validateMapKey);
|
||||
this.map = Collections.unmodifiableMap(map.entrySet().stream().collect(LinkedHashMap::new, (result, entry) -> {
|
||||
String key = entry.getKey();
|
||||
C value = adaptMapValue(entry.getValue(), valueAdapter);
|
||||
result.put(key, value);
|
||||
}, Map::putAll));
|
||||
|
||||
}
|
||||
|
||||
private void validateKey(String value) {
|
||||
Assert.notNull(value, "Map must not contain null keys");
|
||||
Assert.isTrue(!value.contains("/"), "Map keys must not contain a '/'");
|
||||
private void validateMapKey(String value) {
|
||||
Assert.notNull(value, "'map' must not contain null keys");
|
||||
Assert.isTrue(!value.contains("/"), "'map' keys must not contain a '/'");
|
||||
}
|
||||
|
||||
private C adapt(V value, Function<V, ? extends C> valueAdapter) {
|
||||
private C adaptMapValue(V value, Function<V, ? extends C> valueAdapter) {
|
||||
C contributor = (value != null) ? valueAdapter.apply(value) : null;
|
||||
Assert.notNull(contributor, "Map must not contain null values");
|
||||
Assert.notNull(contributor, "'map' must not contain null values");
|
||||
return contributor;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -32,7 +32,7 @@ import org.springframework.util.Assert;
|
||||
public interface ReactiveHealthContributor {
|
||||
|
||||
static ReactiveHealthContributor adapt(HealthContributor healthContributor) {
|
||||
Assert.notNull(healthContributor, "HealthContributor must not be null");
|
||||
Assert.notNull(healthContributor, "'healthContributor' must not be null");
|
||||
if (healthContributor instanceof HealthIndicator healthIndicator) {
|
||||
return new HealthIndicatorReactiveAdapter(healthIndicator);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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,8 +78,8 @@ public final class Status {
|
||||
* @param description a description of the status
|
||||
*/
|
||||
public Status(String code, String description) {
|
||||
Assert.notNull(code, "Code must not be null");
|
||||
Assert.notNull(description, "Description must not be null");
|
||||
Assert.notNull(code, "'code' must not be null");
|
||||
Assert.notNull(description, "'description' must not be null");
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -42,7 +42,7 @@ public class InfoEndpoint {
|
||||
* @param infoContributors the info contributors to use
|
||||
*/
|
||||
public InfoEndpoint(List<InfoContributor> infoContributors) {
|
||||
Assert.notNull(infoContributors, "Info contributors must not be null");
|
||||
Assert.notNull(infoContributors, "'infoContributors' must not be null");
|
||||
this.infoContributors = infoContributors;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -31,7 +31,7 @@ public class SimpleInfoContributor implements InfoContributor {
|
||||
private final Object detail;
|
||||
|
||||
public SimpleInfoContributor(String prefix, Object detail) {
|
||||
Assert.notNull(prefix, "Prefix must not be null");
|
||||
Assert.notNull(prefix, "'prefix' must not be null");
|
||||
this.prefix = prefix;
|
||||
this.detail = detail;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -41,7 +41,7 @@ public class LdapHealthIndicator extends AbstractHealthIndicator {
|
||||
|
||||
public LdapHealthIndicator(LdapOperations ldapOperations) {
|
||||
super("LDAP health check failed");
|
||||
Assert.notNull(ldapOperations, "LdapOperations must not be null");
|
||||
Assert.notNull(ldapOperations, "'ldapOperations' must not be null");
|
||||
this.ldapOperations = ldapOperations;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -51,7 +51,7 @@ public class LiquibaseEndpoint {
|
||||
private final ApplicationContext context;
|
||||
|
||||
public LiquibaseEndpoint(ApplicationContext context) {
|
||||
Assert.notNull(context, "Context must be specified");
|
||||
Assert.notNull(context, "'context' must be specified");
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -64,8 +64,8 @@ public class LoggersEndpoint {
|
||||
* @param loggerGroups the logger group to expose
|
||||
*/
|
||||
public LoggersEndpoint(LoggingSystem loggingSystem, LoggerGroups loggerGroups) {
|
||||
Assert.notNull(loggingSystem, "LoggingSystem must not be null");
|
||||
Assert.notNull(loggerGroups, "LoggerGroups must not be null");
|
||||
Assert.notNull(loggingSystem, "'loggingSystem' must not be null");
|
||||
Assert.notNull(loggerGroups, "'loggerGroups' must not be null");
|
||||
this.loggingSystem = loggingSystem;
|
||||
this.loggerGroups = loggerGroups;
|
||||
}
|
||||
@ -88,7 +88,7 @@ public class LoggersEndpoint {
|
||||
|
||||
@ReadOperation
|
||||
public LoggerLevelsDescriptor loggerLevels(@Selector String name) {
|
||||
Assert.notNull(name, "Name must not be null");
|
||||
Assert.notNull(name, "'name' must not be null");
|
||||
LoggerGroup group = this.loggerGroups.get(name);
|
||||
if (group != null) {
|
||||
return new GroupLoggerLevelsDescriptor(group.getConfiguredLevel(), group.getMembers());
|
||||
@ -99,7 +99,7 @@ public class LoggersEndpoint {
|
||||
|
||||
@WriteOperation
|
||||
public void configureLogLevel(@Selector String name, @Nullable LogLevel configuredLevel) {
|
||||
Assert.notNull(name, "Name must not be empty");
|
||||
Assert.notNull(name, "'name' must not be empty");
|
||||
LoggerGroup group = this.loggerGroups.get(name);
|
||||
if (group != null && group.hasMembers()) {
|
||||
group.configureLogLevel(configuredLevel, this.loggingSystem::setLogLevel);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -45,7 +45,7 @@ public class RabbitMetrics implements MeterBinder {
|
||||
* @param tags tags to apply to all recorded metrics
|
||||
*/
|
||||
public RabbitMetrics(ConnectionFactory connectionFactory, Iterable<Tag> tags) {
|
||||
Assert.notNull(connectionFactory, "ConnectionFactory must not be null");
|
||||
Assert.notNull(connectionFactory, "'connectionFactory' must not be null");
|
||||
this.connectionFactory = connectionFactory;
|
||||
this.tags = (tags != null) ? tags : Collections.emptyList();
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -87,11 +87,11 @@ public class PrometheusPushGatewayManager {
|
||||
*/
|
||||
public PrometheusPushGatewayManager(PushGateway pushGateway, CollectorRegistry registry, TaskScheduler scheduler,
|
||||
Duration pushRate, String job, Map<String, String> groupingKey, ShutdownOperation shutdownOperation) {
|
||||
Assert.notNull(pushGateway, "PushGateway must not be null");
|
||||
Assert.notNull(registry, "Registry must not be null");
|
||||
Assert.notNull(scheduler, "Scheduler must not be null");
|
||||
Assert.notNull(pushRate, "PushRate must not be null");
|
||||
Assert.hasLength(job, "Job must not be empty");
|
||||
Assert.notNull(pushGateway, "'pushGateway' must not be null");
|
||||
Assert.notNull(registry, "'registry' must not be null");
|
||||
Assert.notNull(scheduler, "'scheduler' must not be null");
|
||||
Assert.notNull(pushRate, "'pushRate' must not be null");
|
||||
Assert.hasLength(job, "'job' must not be empty");
|
||||
this.pushGateway = pushGateway;
|
||||
this.registry = registry;
|
||||
this.job = job;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -56,8 +56,8 @@ public class DataSourcePoolMetrics implements MeterBinder {
|
||||
|
||||
public DataSourcePoolMetrics(DataSource dataSource, DataSourcePoolMetadataProvider metadataProvider, String name,
|
||||
Iterable<Tag> tags) {
|
||||
Assert.notNull(dataSource, "DataSource must not be null");
|
||||
Assert.notNull(metadataProvider, "MetadataProvider must not be null");
|
||||
Assert.notNull(dataSource, "'dataSource' must not be null");
|
||||
Assert.notNull(metadataProvider, "'metadataProvider' must not be null");
|
||||
this.dataSource = dataSource;
|
||||
this.metadataProvider = new CachingDataSourcePoolMetadataProvider(metadataProvider);
|
||||
this.tags = Tags.concat(tags, "name", name);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -39,7 +39,7 @@ public class DiskSpaceMetricsBinder implements MeterBinder {
|
||||
private final Iterable<Tag> tags;
|
||||
|
||||
public DiskSpaceMetricsBinder(List<File> paths, Iterable<Tag> tags) {
|
||||
Assert.notEmpty(paths, "Paths must not be empty");
|
||||
Assert.notEmpty(paths, "'paths' must not be empty");
|
||||
this.paths = paths;
|
||||
this.tags = tags;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -43,8 +43,8 @@ public class ObservationRestClientCustomizer implements RestClientCustomizer {
|
||||
*/
|
||||
public ObservationRestClientCustomizer(ObservationRegistry observationRegistry,
|
||||
ClientRequestObservationConvention observationConvention) {
|
||||
Assert.notNull(observationConvention, "ObservationConvention must not be null");
|
||||
Assert.notNull(observationRegistry, "ObservationRegistry must not be null");
|
||||
Assert.notNull(observationConvention, "'observationConvention' must not be null");
|
||||
Assert.notNull(observationRegistry, "'observationRegistry' must not be null");
|
||||
this.observationRegistry = observationRegistry;
|
||||
this.observationConvention = observationConvention;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -75,7 +75,7 @@ public class QuartzEndpoint {
|
||||
private final Sanitizer sanitizer;
|
||||
|
||||
public QuartzEndpoint(Scheduler scheduler, Iterable<SanitizingFunction> sanitizingFunctions) {
|
||||
Assert.notNull(scheduler, "Scheduler must not be null");
|
||||
Assert.notNull(scheduler, "'scheduler' must not be null");
|
||||
this.scheduler = scheduler;
|
||||
this.sanitizer = new Sanitizer(sanitizingFunctions);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -63,7 +63,7 @@ public class ConnectionFactoryHealthIndicator extends AbstractReactiveHealthIndi
|
||||
* validation
|
||||
*/
|
||||
public ConnectionFactoryHealthIndicator(ConnectionFactory connectionFactory, String validationQuery) {
|
||||
Assert.notNull(connectionFactory, "ConnectionFactory must not be null");
|
||||
Assert.notNull(connectionFactory, "'connectionFactory' must not be null");
|
||||
this.connectionFactory = connectionFactory;
|
||||
this.validationQuery = validationQuery;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -50,7 +50,7 @@ public class ReactiveSessionsEndpoint {
|
||||
*/
|
||||
public ReactiveSessionsEndpoint(ReactiveSessionRepository<? extends Session> sessionRepository,
|
||||
ReactiveFindByIndexNameSessionRepository<? extends Session> indexedSessionRepository) {
|
||||
Assert.notNull(sessionRepository, "ReactiveSessionRepository must not be null");
|
||||
Assert.notNull(sessionRepository, "'sessionRepository' must not be null");
|
||||
this.sessionRepository = sessionRepository;
|
||||
this.indexedSessionRepository = indexedSessionRepository;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -61,7 +61,7 @@ public class SessionsEndpoint {
|
||||
*/
|
||||
public SessionsEndpoint(SessionRepository<? extends Session> sessionRepository,
|
||||
FindByIndexNameSessionRepository<? extends Session> indexedSessionRepository) {
|
||||
Assert.notNull(sessionRepository, "SessionRepository must not be null");
|
||||
Assert.notNull(sessionRepository, "'sessionRepository' must not be null");
|
||||
this.sessionRepository = sessionRepository;
|
||||
this.indexedSessionRepository = indexedSessionRepository;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -40,7 +40,7 @@ public class HttpExchangesEndpoint {
|
||||
* @param repository the exchange repository
|
||||
*/
|
||||
public HttpExchangesEndpoint(HttpExchangeRepository repository) {
|
||||
Assert.notNull(repository, "Repository must not be null");
|
||||
Assert.notNull(repository, "'repository' must not be null");
|
||||
this.repository = repository;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -53,7 +53,7 @@ class RabbitHealthIndicatorTests {
|
||||
@Test
|
||||
void createWhenRabbitTemplateIsNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new RabbitHealthIndicator(null))
|
||||
.withMessageContaining("RabbitTemplate must not be null");
|
||||
.withMessageContaining("'rabbitTemplate' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -60,14 +60,14 @@ class AuditEventTests {
|
||||
void nullTimestamp() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> new AuditEvent(null, "phil", "UNKNOWN", Collections.singletonMap("a", "b")))
|
||||
.withMessageContaining("Timestamp must not be null");
|
||||
.withMessageContaining("'timestamp' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
void nullType() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> new AuditEvent("phil", null, Collections.singletonMap("a", "b")))
|
||||
.withMessageContaining("Type must not be null");
|
||||
.withMessageContaining("'type' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -63,7 +63,7 @@ class InMemoryAuditEventRepositoryTests {
|
||||
void addNullAuditEvent() {
|
||||
InMemoryAuditEventRepository repository = new InMemoryAuditEventRepository();
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> repository.add(null))
|
||||
.withMessageContaining("AuditEvent must not be null");
|
||||
.withMessageContaining("'event' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -47,7 +47,7 @@ class AvailabilityStateHealthIndicatorTests {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> new AvailabilityStateHealthIndicator(null, LivenessState.class, (statusMappings) -> {
|
||||
}))
|
||||
.withMessage("ApplicationAvailability must not be null");
|
||||
.withMessage("'applicationAvailability' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -55,7 +55,7 @@ class AvailabilityStateHealthIndicatorTests {
|
||||
assertThatIllegalArgumentException().isThrownBy(
|
||||
() -> new AvailabilityStateHealthIndicator(this.applicationAvailability, null, (statusMappings) -> {
|
||||
}))
|
||||
.withMessage("StateType must not be null");
|
||||
.withMessage("'stateType' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -63,7 +63,7 @@ class AvailabilityStateHealthIndicatorTests {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(
|
||||
() -> new AvailabilityStateHealthIndicator(this.applicationAvailability, LivenessState.class, null))
|
||||
.withMessage("StatusMappings must not be null");
|
||||
.withMessage("'statusMappings' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -37,42 +37,43 @@ class EndpointIdTests {
|
||||
@Test
|
||||
void ofWhenNullThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> EndpointId.of(null))
|
||||
.withMessage("Value must not be empty");
|
||||
.withMessage("'value' must not be empty");
|
||||
}
|
||||
|
||||
@Test
|
||||
void ofWhenEmptyThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> EndpointId.of("")).withMessage("Value must not be empty");
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> EndpointId.of(""))
|
||||
.withMessage("'value' must not be empty");
|
||||
}
|
||||
|
||||
@Test
|
||||
void ofWhenContainsSlashThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> EndpointId.of("foo/bar"))
|
||||
.withMessage("Value must only contain valid chars");
|
||||
.withMessage("'value' must only contain valid chars");
|
||||
}
|
||||
|
||||
@Test
|
||||
void ofWhenContainsBackslashThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> EndpointId.of("foo\\bar"))
|
||||
.withMessage("Value must only contain valid chars");
|
||||
.withMessage("'value' must only contain valid chars");
|
||||
}
|
||||
|
||||
@Test
|
||||
void ofWhenHasBadCharThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> EndpointId.of("foo!bar"))
|
||||
.withMessage("Value must only contain valid chars");
|
||||
.withMessage("'value' must only contain valid chars");
|
||||
}
|
||||
|
||||
@Test
|
||||
void ofWhenStartsWithNumberThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> EndpointId.of("1foo"))
|
||||
.withMessage("Value must not start with a number");
|
||||
.withMessage("'value' must not start with a number");
|
||||
}
|
||||
|
||||
@Test
|
||||
void ofWhenStartsWithUppercaseLetterThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> EndpointId.of("Foo"))
|
||||
.withMessage("Value must not start with an uppercase letter");
|
||||
.withMessage("'value' must not start with an uppercase letter");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -45,13 +45,13 @@ class InvocationContextTests {
|
||||
@Test
|
||||
void createWhenSecurityContextIsNullThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new InvocationContext(null, this.arguments))
|
||||
.withMessage("SecurityContext must not be null");
|
||||
.withMessage("'securityContext' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
void createWhenArgumentsIsNullThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new InvocationContext(this.securityContext, null))
|
||||
.withMessage("Arguments must not be null");
|
||||
.withMessage("'arguments' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -42,7 +42,7 @@ class DiscoveredOperationMethodTests {
|
||||
Method method = ReflectionUtils.findMethod(getClass(), "example");
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> new DiscoveredOperationMethod(method, OperationType.READ, null))
|
||||
.withMessageContaining("AnnotationAttributes must not be null");
|
||||
.withMessageContaining("'annotationAttributes' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -43,7 +43,7 @@ class DiscovererEndpointFilterTests {
|
||||
@Test
|
||||
void createWhenDiscovererIsNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new TestDiscovererEndpointFilter(null))
|
||||
.withMessageContaining("Discoverer must not be null");
|
||||
.withMessageContaining("'discoverer' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -76,7 +76,7 @@ class EndpointDiscovererTests {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> new TestEndpointDiscoverer(null, mock(ParameterValueMapper.class),
|
||||
Collections.emptyList(), Collections.emptyList()))
|
||||
.withMessageContaining("ApplicationContext must not be null");
|
||||
.withMessageContaining("'applicationContext' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -84,7 +84,7 @@ class EndpointDiscovererTests {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> new TestEndpointDiscoverer(mock(ApplicationContext.class), null, Collections.emptyList(),
|
||||
Collections.emptyList()))
|
||||
.withMessageContaining("ParameterValueMapper must not be null");
|
||||
.withMessageContaining("'parameterValueMapper' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -92,7 +92,7 @@ class EndpointDiscovererTests {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> new TestEndpointDiscoverer(mock(ApplicationContext.class),
|
||||
mock(ParameterValueMapper.class), null, Collections.emptyList()))
|
||||
.withMessageContaining("InvokerAdvisors must not be null");
|
||||
.withMessageContaining("'invokerAdvisors' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -100,7 +100,7 @@ class EndpointDiscovererTests {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> new TestEndpointDiscoverer(mock(ApplicationContext.class),
|
||||
mock(ParameterValueMapper.class), Collections.emptyList(), null))
|
||||
.withMessageContaining("Filters must not be null");
|
||||
.withMessageContaining("'endpointFilters' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -51,13 +51,13 @@ class OperationMethodParametersTests {
|
||||
void createWhenMethodIsNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> new OperationMethodParameters(null, mock(ParameterNameDiscoverer.class)))
|
||||
.withMessageContaining("Method must not be null");
|
||||
.withMessageContaining("'method' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
void createWhenParameterNameDiscovererIsNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new OperationMethodParameters(this.exampleMethod, null))
|
||||
.withMessageContaining("ParameterNameDiscoverer must not be null");
|
||||
.withMessageContaining("'parameterNameDiscoverer' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -39,13 +39,13 @@ class OperationMethodTests {
|
||||
@Test
|
||||
void createWhenMethodIsNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new OperationMethod(null, OperationType.READ))
|
||||
.withMessageContaining("Method must not be null");
|
||||
.withMessageContaining("'method' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
void createWhenOperationTypeIsNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new OperationMethod(this.exampleMethod, null))
|
||||
.withMessageContaining("OperationType must not be null");
|
||||
.withMessageContaining("'operationType' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@ -60,21 +60,21 @@ class ReflectiveOperationInvokerTests {
|
||||
void createWhenTargetIsNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> new ReflectiveOperationInvoker(null, this.operationMethod, this.parameterValueMapper))
|
||||
.withMessageContaining("Target must not be null");
|
||||
.withMessageContaining("'target' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
void createWhenOperationMethodIsNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> new ReflectiveOperationInvoker(this.target, null, this.parameterValueMapper))
|
||||
.withMessageContaining("OperationMethod must not be null");
|
||||
.withMessageContaining("'operationMethod' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
void createWhenParameterValueMapperIsNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> new ReflectiveOperationInvoker(this.target, this.operationMethod, null))
|
||||
.withMessageContaining("ParameterValueMapper must not be null");
|
||||
.withMessageContaining("'parameterValueMapper' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user