Skip to content

Commit e9dc17f

Browse files
authored
[Test] Consistent datetime formatting for java and joda time (#66914) (#66925)
This PR fixes the test failure by ensuring consistent datetime formatting between java DateTimeFormatter and joda time.
1 parent cffc614 commit e9dc17f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,17 @@ public void testExpression_EscapeDateFormat() throws Exception {
113113
equalTo(".marvel-" + DateTimeFormat.forPattern("'{year}'yyyy").print(new DateTime(context.getStartTime(), UTC))));
114114
}
115115

116-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/pull/66914")
117116
public void testExpression_MixedArray() throws Exception {
118117
List<String> result = expressionResolver.resolve(context, Arrays.asList(
119-
"name1", "<.marvel-{now/d}>", "name2", "<.logstash-{now/M{YYYY.MM}}>"
118+
"name1", "<.marvel-{now/d}>", "name2", "<.logstash-{now/M{uuuu.MM}}>"
120119
));
121120
assertThat(result.size(), equalTo(4));
122121
assertThat(result.get(0), equalTo("name1"));
123122
assertThat(result.get(1),
124-
equalTo(".marvel-" + DateTimeFormat.forPattern("YYYY.MM.dd").print(new DateTime(context.getStartTime(), UTC))));
123+
equalTo(".marvel-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(new DateTime(context.getStartTime(), UTC))));
125124
assertThat(result.get(2), equalTo("name2"));
126125
assertThat(result.get(3), equalTo(".logstash-" +
127-
DateTimeFormat.forPattern("YYYY.MM").print(new DateTime(context.getStartTime(), UTC).withDayOfMonth(1))));
126+
DateTimeFormat.forPattern("yyyy.MM").print(new DateTime(context.getStartTime(), UTC).withDayOfMonth(1))));
128127
}
129128

130129
public void testExpression_CustomTimeZoneInIndexName() throws Exception {

0 commit comments

Comments
 (0)