99
1010package org .elasticsearch .action .admin .indices .rollover ;
1111
12+ import org .elasticsearch .ResourceNotFoundException ;
1213import org .elasticsearch .action .admin .indices .alias .Alias ;
1314import org .elasticsearch .action .admin .indices .create .CreateIndexClusterStateUpdateRequest ;
1415import 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