Skip to content

Commit c993176

Browse files
authored
Asserting a deprecation log exists at the correct level (elastic#79514)
As elastic#79492 of the ESTestCase assertWarnings methods now check that the log level is of the expected type. This commit puts in the correct expected log level. Relates elastic#79492
1 parent 077769c commit c993176

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/src/test/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexServiceTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
1212

13+
import org.apache.logging.log4j.Level;
1314
import org.elasticsearch.ExceptionsHelper;
1415
import org.elasticsearch.ResourceAlreadyExistsException;
1516
import org.elasticsearch.Version;
@@ -1011,8 +1012,9 @@ null, Settings.EMPTY, IndexScopedSettings.DEFAULT_SCOPED_SETTINGS, randomShardLi
10111012
return Optional.of(aggregatedIndexSettings.get(DataTier.TIER_PREFERENCE));
10121013
} else {
10131014
if (clusterState != ClusterState.EMPTY_STATE) {
1014-
assertWarnings("[" + request.index() + "] creating index with " +
1015-
"an empty [" + DataTier.TIER_PREFERENCE + "] setting, in 8.0 this setting will be required for all indices");
1015+
assertWarnings(true, new DeprecationWarning(Level.WARN, "[" + request.index() +
1016+
"] creating index with an empty [" + DataTier.TIER_PREFERENCE + "] setting, in 8.0 this setting will be required for " +
1017+
"all indices"));
10161018
}
10171019

10181020
return Optional.empty();

0 commit comments

Comments
 (0)