From 03c5d71c1236c057592c8b2a74cf5955e105f7f8 Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Tue, 1 Nov 2016 09:02:39 +0100 Subject: [PATCH] remove hard coded dates from testDateMathExpressionsCanBeAuthorized Original commit: elastic/x-pack-elasticsearch@d7fac0b9a025f6e63b7f866c88488ac1acaf2bc5 --- .../integration/DateMathExpressionIntegTests.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/elasticsearch/src/test/java/org/elasticsearch/integration/DateMathExpressionIntegTests.java b/elasticsearch/src/test/java/org/elasticsearch/integration/DateMathExpressionIntegTests.java index 44a139ab276..a01079392ce 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/integration/DateMathExpressionIntegTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/integration/DateMathExpressionIntegTests.java @@ -18,9 +18,9 @@ import org.elasticsearch.client.Client; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.query.QueryBuilders; +import org.elasticsearch.test.SecurityIntegTestCase; import org.elasticsearch.xpack.security.authc.support.Hasher; import org.elasticsearch.xpack.security.authc.support.SecuredString; -import org.elasticsearch.test.SecurityIntegTestCase; import java.util.Collections; @@ -97,7 +97,7 @@ public class DateMathExpressionIntegTests extends SecurityIntegTestCase { } GetResponse getResponse = client.prepareGet(expression, "type", response.getId()).setFetchSource(true).get(); assertThat(getResponse.isExists(), is(true)); - assertEquals("datemath-2016.10.01", getResponse.getIndex()); + assertEquals(expectedIndexName, getResponse.getIndex()); assertThat(getResponse.getSourceAsMap().get("foo").toString(), is("bar")); assertThat(getResponse.getSourceAsMap().get("new").toString(), is("field")); @@ -107,7 +107,7 @@ public class DateMathExpressionIntegTests extends SecurityIntegTestCase { .get(); assertFalse(multiGetResponse.getResponses()[0].isFailed()); assertTrue(multiGetResponse.getResponses()[0].getResponse().isExists()); - assertEquals("datemath-2016.10.01", multiGetResponse.getResponses()[0].getResponse().getIndex()); + assertEquals(expectedIndexName, multiGetResponse.getResponses()[0].getResponse().getIndex()); DeleteIndexResponse deleteIndexResponse = client.admin().indices().prepareDelete(expression).get();