This PR fixes the test failure by ensuring consistent datetime formatting between java DateTimeFormatter and joda time.
This commit is contained in:
parent
dae36e45ca
commit
cb041c747d
|
@ -115,15 +115,15 @@ public class DateMathExpressionResolverTests extends ESTestCase {
|
|||
|
||||
public void testExpression_MixedArray() throws Exception {
|
||||
List<String> result = expressionResolver.resolve(context, Arrays.asList(
|
||||
"name1", "<.marvel-{now/d}>", "name2", "<.logstash-{now/M{YYYY.MM}}>"
|
||||
"name1", "<.marvel-{now/d}>", "name2", "<.logstash-{now/M{uuuu.MM}}>"
|
||||
));
|
||||
assertThat(result.size(), equalTo(4));
|
||||
assertThat(result.get(0), equalTo("name1"));
|
||||
assertThat(result.get(1),
|
||||
equalTo(".marvel-" + DateTimeFormat.forPattern("YYYY.MM.dd").print(new DateTime(context.getStartTime(), UTC))));
|
||||
equalTo(".marvel-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(new DateTime(context.getStartTime(), UTC))));
|
||||
assertThat(result.get(2), equalTo("name2"));
|
||||
assertThat(result.get(3), equalTo(".logstash-" +
|
||||
DateTimeFormat.forPattern("YYYY.MM").print(new DateTime(context.getStartTime(), UTC).withDayOfMonth(1))));
|
||||
DateTimeFormat.forPattern("yyyy.MM").print(new DateTime(context.getStartTime(), UTC).withDayOfMonth(1))));
|
||||
}
|
||||
|
||||
public void testExpression_CustomTimeZoneInIndexName() throws Exception {
|
||||
|
|
Loading…
Reference in New Issue