Skip to content

Commit f08188d

Browse files
committed
Change relevant Assert calls to throw IllegalStateException
Change certain Assert class from `assert...` to `assertState` so that a more appropriate `IllegalStateException` is thrown. Fixes gh-43779
1 parent 29baaf3 commit f08188d

File tree

76 files changed

+201
-188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+201
-188
lines changed

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/availability/AvailabilityStateHealthIndicator.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -69,7 +69,7 @@ private <S extends AvailabilityState> void assertAllEnumsMapped(Class<S> stateTy
6969
if (!this.statusMappings.containsKey(null) && Enum.class.isAssignableFrom(stateType)) {
7070
EnumSet elements = EnumSet.allOf((Class) stateType);
7171
for (Object element : elements) {
72-
Assert.isTrue(this.statusMappings.containsKey(element),
72+
Assert.state(this.statusMappings.containsKey(element),
7373
() -> "StatusMappings does not include " + element);
7474
}
7575
}

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/management/HeapDumpWebEndpoint.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -209,7 +209,7 @@ private OpenJ9DiagnosticsMXBeanHeapDumper() {
209209

210210
@Override
211211
public File dumpHeap(Boolean live) throws IOException, InterruptedException {
212-
Assert.isNull(live, "OpenJ9DiagnosticsMXBean does not support live parameter when dumping the heap");
212+
Assert.state(live == null, "OpenJ9DiagnosticsMXBean does not support live parameter when dumping the heap");
213213
return new File(
214214
(String) ReflectionUtils.invokeMethod(this.dumpHeapMethod, this.diagnosticMXBean, "heap", null));
215215
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/availability/AvailabilityStateHealthIndicatorTests.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,6 +28,7 @@
2828

2929
import static org.assertj.core.api.Assertions.assertThat;
3030
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
31+
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
3132
import static org.mockito.BDDMockito.given;
3233

3334
/**
@@ -67,7 +68,7 @@ void createWhenStatusMappingIsNullThrowsException() {
6768

6869
@Test
6970
void createWhenStatusMappingDoesNotCoverAllEnumsThrowsException() {
70-
assertThatIllegalArgumentException()
71+
assertThatIllegalStateException()
7172
.isThrownBy(() -> new AvailabilityStateHealthIndicator(this.applicationAvailability, LivenessState.class,
7273
(statusMappings) -> statusMappings.add(LivenessState.CORRECT, Status.UP)))
7374
.withMessage("StatusMappings does not include BROKEN");

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -57,6 +57,7 @@
5757
import org.springframework.core.type.classreading.MetadataReaderFactory;
5858
import org.springframework.util.Assert;
5959
import org.springframework.util.ClassUtils;
60+
import org.springframework.util.CollectionUtils;
6061
import org.springframework.util.StringUtils;
6162

6263
/**
@@ -170,7 +171,7 @@ protected boolean isEnabled(AnnotationMetadata metadata) {
170171
protected AnnotationAttributes getAttributes(AnnotationMetadata metadata) {
171172
String name = getAnnotationClass().getName();
172173
AnnotationAttributes attributes = AnnotationAttributes.fromMap(metadata.getAnnotationAttributes(name, true));
173-
Assert.notNull(attributes, () -> "No auto-configuration attributes found. Is " + metadata.getClassName()
174+
Assert.state(attributes != null, () -> "No auto-configuration attributes found. Is " + metadata.getClassName()
174175
+ " annotated with " + ClassUtils.getShortName(name) + "?");
175176
return attributes;
176177
}
@@ -195,7 +196,7 @@ protected List<String> getCandidateConfigurations(AnnotationMetadata metadata, A
195196
ImportCandidates importCandidates = ImportCandidates.load(this.autoConfigurationAnnotation,
196197
getBeanClassLoader());
197198
List<String> configurations = importCandidates.getCandidates();
198-
Assert.notEmpty(configurations,
199+
Assert.state(!CollectionUtils.isEmpty(configurations),
199200
"No auto configuration classes found in " + "META-INF/spring/"
200201
+ this.autoConfigurationAnnotation.getName() + ".imports. If you "
201202
+ "are using a custom packaging, make sure that file is correct.");

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobLauncherApplicationRunner.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -112,10 +112,10 @@ public JobLauncherApplicationRunner(JobLauncher jobLauncher, JobExplorer jobExpl
112112

113113
@Override
114114
public void afterPropertiesSet() {
115-
Assert.isTrue(this.jobs.size() <= 1 || StringUtils.hasText(this.jobName),
115+
Assert.state(this.jobs.size() <= 1 || StringUtils.hasText(this.jobName),
116116
"Job name must be specified in case of multiple jobs");
117117
if (StringUtils.hasText(this.jobName)) {
118-
Assert.isTrue(isLocalJob(this.jobName) || isRegisteredJob(this.jobName),
118+
Assert.state(isLocalJob(this.jobName) || isRegisteredJob(this.jobName),
119119
() -> "No job found with name '" + this.jobName + "'");
120120
}
121121
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -102,7 +102,7 @@ static class CacheManagerValidator implements InitializingBean {
102102

103103
@Override
104104
public void afterPropertiesSet() {
105-
Assert.notNull(this.cacheManager.getIfAvailable(),
105+
Assert.state(this.cacheManager.getIfAvailable() != null,
106106
() -> "No cache manager could be auto-configured, check your configuration (caching type is '"
107107
+ this.cacheProperties.getType() + "')");
108108
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -250,8 +250,8 @@ private ConfigurableListableBeanFactory getSearchBeanFactory(Spec<?> spec) {
250250
ConfigurableListableBeanFactory beanFactory = spec.getContext().getBeanFactory();
251251
if (spec.getStrategy() == SearchStrategy.ANCESTORS) {
252252
BeanFactory parent = beanFactory.getParentBeanFactory();
253-
Assert.isInstanceOf(ConfigurableListableBeanFactory.class, parent,
254-
"Unable to use SearchStrategy.ANCESTORS");
253+
Assert.state(parent instanceof ConfigurableListableBeanFactory,
254+
"Unable to use SearchStrategy.ANCESTORS without ConfigurableListableBeanFactory");
255255
beanFactory = (ConfigurableListableBeanFactory) parent;
256256
}
257257
return beanFactory;

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnResourceCondition.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeM
4545
ResourceLoader loader = context.getResourceLoader();
4646
List<String> locations = new ArrayList<>();
4747
collectValues(locations, attributes.get("resources"));
48-
Assert.isTrue(!locations.isEmpty(),
48+
Assert.state(!locations.isEmpty(),
4949
"@ConditionalOnResource annotations must specify at least one resource location");
5050
List<String> missing = new ArrayList<>();
5151
for (String location : locations) {

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ static class Extension<E extends ConfigurationExtension> {
583583
Extension(FluentConfiguration configuration, Class<E> type, String name) {
584584
this.extension = SingletonSupplier.of(() -> {
585585
E extension = configuration.getPluginRegister().getPlugin(type);
586-
Assert.notNull(extension, () -> "Flyway %s extension missing".formatted(name));
586+
Assert.state(extension != null, () -> "Flyway %s extension missing".formatted(name));
587587
return extension;
588588
});
589589
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastProperties.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@ public Resource resolveConfigLocation() {
5252
if (this.config == null) {
5353
return null;
5454
}
55-
Assert.isTrue(this.config.exists(),
55+
Assert.state(this.config.exists(),
5656
() -> "Hazelcast configuration does not exist '" + this.config.getDescription() + "'");
5757
return this.config;
5858
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ private void configurePropertyNamingStrategyField(Jackson2ObjectMapperBuilder bu
292292
// Find the field (this way we automatically support new constants
293293
// that may be added by Jackson in the future)
294294
Field field = findPropertyNamingStrategyField(fieldName);
295-
Assert.notNull(field, () -> "Constant named '" + fieldName + "' not found");
295+
Assert.state(field != null, () -> "Constant named '" + fieldName + "' not found");
296296
try {
297297
builder.propertyNamingStrategy((PropertyNamingStrategy) field.get(null));
298298
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/XADataSourceAutoConfiguration.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -96,7 +96,8 @@ private XADataSource createXaDataSourceInstance(String className) {
9696
try {
9797
Class<?> dataSourceClass = ClassUtils.forName(className, this.classLoader);
9898
Object instance = BeanUtils.instantiateClass(dataSourceClass);
99-
Assert.isInstanceOf(XADataSource.class, instance);
99+
Assert.state(instance instanceof XADataSource,
100+
() -> "DataSource class " + className + " is not an XADataSource");
100101
return (XADataSource) instance;
101102
}
102103
catch (Exception ex) {

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyRegistrationConfiguration.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -175,8 +175,8 @@ private RSAPrivateKey readPrivateKey(Resource location) {
175175
try (InputStream inputStream = location.getInputStream()) {
176176
PemContent pemContent = PemContent.load(inputStream);
177177
PrivateKey privateKey = pemContent.getPrivateKey();
178-
Assert.isInstanceOf(RSAPrivateKey.class, privateKey,
179-
"PrivateKey in resource '" + location + "' must be an RSAPrivateKey");
178+
Assert.state(privateKey instanceof RSAPrivateKey,
179+
() -> "PrivateKey in resource '" + location + "' must be an RSAPrivateKey");
180180
return (RSAPrivateKey) privateKey;
181181
}
182182
catch (Exception ex) {

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ssl/CertificateMatcher.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ class CertificateMatcher {
5353
Assert.notNull(privateKey, "Private key must not be null");
5454
this.privateKey = privateKey;
5555
this.signature = createSignature(privateKey);
56-
Assert.notNull(this.signature, "Failed to create signature");
56+
Assert.state(this.signature != null, "Failed to create signature");
5757
this.generatedSignature = sign(this.signature, privateKey);
5858
}
5959

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ssl/PropertiesSslBundle.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -127,7 +127,7 @@ private static PemSslStore getPemSslStore(String propertyName, PemSslBundlePrope
127127
if (properties.isVerifyKeys()) {
128128
CertificateMatcher certificateMatcher = new CertificateMatcher(pemSslStore.privateKey());
129129
Assert.state(certificateMatcher.matchesAny(pemSslStore.certificates()),
130-
"Private key in %s matches none of the certificates in the chain".formatted(propertyName));
130+
() -> "Private key in %s matches none of the certificates in the chain".formatted(propertyName));
131131
}
132132
return pemSslStore;
133133
}

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -91,7 +91,7 @@
9191

9292
import static org.assertj.core.api.Assertions.assertThat;
9393
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
94-
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
94+
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
9595
import static org.mockito.BDDMockito.given;
9696
import static org.mockito.Mockito.mock;
9797

@@ -484,15 +484,15 @@ void whenTheUserDefinesAJobNameThatDoesNotExistWithJobInstancesFailsFast() {
484484
JobLauncherApplicationRunner runner = createInstance();
485485
runner.setJobs(Arrays.asList(mockJob("one"), mockJob("two")));
486486
runner.setJobName("three");
487-
assertThatIllegalArgumentException().isThrownBy(runner::afterPropertiesSet)
487+
assertThatIllegalStateException().isThrownBy(runner::afterPropertiesSet)
488488
.withMessage("No job found with name 'three'");
489489
}
490490

491491
@Test
492492
void whenTheUserDefinesAJobNameThatDoesNotExistWithRegisteredJobFailsFast() {
493493
JobLauncherApplicationRunner runner = createInstance("one", "two");
494494
runner.setJobName("three");
495-
assertThatIllegalArgumentException().isThrownBy(runner::afterPropertiesSet)
495+
assertThatIllegalStateException().isThrownBy(runner::afterPropertiesSet)
496496
.withMessage("No job found with name 'three'");
497497
}
498498

spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -272,7 +272,7 @@ protected void start(FailureHandler failureHandler) throws Exception {
272272
}
273273

274274
private Throwable doStart() throws Exception {
275-
Assert.notNull(this.mainClassName, "Unable to find the main class to restart");
275+
Assert.state(this.mainClassName != null, "Unable to find the main class to restart");
276276
URL[] urls = this.urls.toArray(new URL[0]);
277277
ClassLoaderFiles updatedFiles = new ClassLoaderFiles(this.classLoaderFiles);
278278
ClassLoader classLoader = new RestartClassLoader(this.applicationClassLoader, urls, updatedFiles);

spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/DefaultConnectionPorts.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -97,7 +97,8 @@ private Map<ContainerPort, Integer> buildMappingsForHostNetworking(Config config
9797
@Override
9898
public int get(int containerPort) {
9999
Integer hostPort = this.portMappings.get(containerPort);
100-
Assert.state(hostPort != null, "No host port mapping found for container port %s".formatted(containerPort));
100+
Assert.state(hostPort != null,
101+
() -> "No host port mapping found for container port %s".formatted(containerPort));
101102
return hostPort;
102103
}
103104

spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/DefaultDockerCompose.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -102,7 +102,7 @@ public List<RunningService> getRunningServices() {
102102
Map<String, DockerCliInspectResponse> inspected = inspect(runningPsResponses);
103103
for (DockerCliComposePsResponse psResponse : runningPsResponses) {
104104
DockerCliInspectResponse inspectResponse = inspectContainer(psResponse.id(), inspected);
105-
Assert.notNull(inspectResponse, () -> "Failed to inspect container '%s'".formatted(psResponse.id()));
105+
Assert.state(inspectResponse != null, () -> "Failed to inspect container '%s'".formatted(psResponse.id()));
106106
result.add(new DefaultRunningService(this.hostname, dockerComposeFile, psResponse, inspectResponse));
107107
}
108108
return Collections.unmodifiableList(result);

spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/DockerComposeFile.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -47,7 +47,7 @@ public final class DockerComposeFile {
4747
private final List<File> files;
4848

4949
private DockerComposeFile(List<File> files) {
50-
Assert.state(!files.isEmpty(), "Files must not be empty");
50+
Assert.isTrue(!files.isEmpty(), "'files' must not be empty");
5151
this.files = files.stream().map(DockerComposeFile::toCanonicalFile).toList();
5252
}
5353

@@ -112,7 +112,7 @@ public static DockerComposeFile find(File workingDirectory) {
112112
if (!base.exists()) {
113113
return null;
114114
}
115-
Assert.isTrue(base.isDirectory(), () -> "'%s' is not a directory".formatted(base));
115+
Assert.state(base.isDirectory(), () -> "'%s' is not a directory".formatted(base));
116116
Path basePath = base.toPath();
117117
for (String candidate : SEARCH_ORDER) {
118118
Path resolved = basePath.resolve(candidate);

spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/DockerComposeFileTests.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@
2727

2828
import static org.assertj.core.api.Assertions.assertThat;
2929
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
30+
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
3031

3132
/**
3233
* Tests for {@link DockerComposeFile}.
@@ -104,7 +105,7 @@ void findWhenWorkingDirectoryDoesNotExistReturnsNull() {
104105
@Test
105106
void findWhenWorkingDirectoryIsNotDirectoryThrowsException() throws Exception {
106107
File file = createTempFile("iamafile");
107-
assertThatIllegalArgumentException().isThrownBy(() -> DockerComposeFile.find(file))
108+
assertThatIllegalStateException().isThrownBy(() -> DockerComposeFile.find(file))
108109
.withMessageEndingWith("is not a directory");
109110
}
110111

0 commit comments

Comments
 (0)