Skip to content

Commit 767b894

Browse files
committed
Fix test
1 parent 99e9ada commit 767b894

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

server/src/test/java/org/elasticsearch/action/admin/indices/rollover/MetadataRolloverServiceTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
package org.elasticsearch.action.admin.indices.rollover;
1111

12+
import org.elasticsearch.ResourceNotFoundException;
1213
import org.elasticsearch.action.admin.indices.alias.Alias;
1314
import org.elasticsearch.action.admin.indices.create.CreateIndexClusterStateUpdateRequest;
1415
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
@@ -203,7 +204,7 @@ public void testAliasValidation() {
203204
ProjectMetadata metadata = metadataBuilder.build();
204205
CreateIndexRequest req = new CreateIndexRequest();
205206

206-
IllegalArgumentException exception = expectThrows(
207+
Exception exception = expectThrows(
207208
IllegalArgumentException.class,
208209
() -> MetadataRolloverService.validate(metadata, aliasWithNoWriteIndex, randomAlphaOfLength(5), req)
209210
);
@@ -215,7 +216,7 @@ public void testAliasValidation() {
215216
assertThat(exception.getMessage(), equalTo("rollover target is a [concrete index] but one of [alias,data_stream] was expected"));
216217
final String aliasName = randomAlphaOfLength(5);
217218
exception = expectThrows(
218-
IllegalArgumentException.class,
219+
ResourceNotFoundException.class,
219220
() -> MetadataRolloverService.validate(metadata, aliasName, randomAlphaOfLength(5), req)
220221
);
221222
assertThat(exception.getMessage(), equalTo("rollover target [" + aliasName + "] does not exist"));

0 commit comments

Comments
 (0)