Skip to content

Commit

Permalink
Fixing a unit test (#79470)
Browse files Browse the repository at this point in the history
As #79107 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 #79107 #78921
  • Loading branch information
masseyke authored Oct 19, 2021
1 parent d5249ce commit 9bec026
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.elasticsearch.index.mapper;

import org.apache.logging.log4j.Level;
import org.apache.lucene.index.DocValuesType;
import org.apache.lucene.index.IndexableField;
import org.elasticsearch.Version;
Expand Down Expand Up @@ -148,9 +149,9 @@ public void testResolutionLossDeprecation() throws Exception {

ParsedDocument doc = mapper.parse(source(b -> b.field("field", "2018-10-03T14:42:44.123456+0000")));

assertWarnings("You are attempting to store a nanosecond resolution " +
assertWarnings(true, new DeprecationWarning(Level.WARN, "You are attempting to store a nanosecond resolution " +
"on a field [field] of type date on index [index]. " +
"The nanosecond part was lost. Use date_nanos field type.");
"The nanosecond part was lost. Use date_nanos field type."));
}

private void testIgnoreMalformedForValue(String value, String expectedCause, String dateFormat) throws IOException {
Expand Down

0 comments on commit 9bec026

Please sign in to comment.