Skip to content

Commit 76aa1d5

Browse files
committed
Use new method in other test cases
1 parent 7c01622 commit 76aa1d5

File tree

1 file changed

+5
-28
lines changed

1 file changed

+5
-28
lines changed

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

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,14 +1864,7 @@ public void testConcreteWriteIndexSuccessful() {
18641864
)
18651865
.build();
18661866

1867-
String[] strings = indexNameExpressionResolver.indexAliases(
1868-
project,
1869-
"test-0",
1870-
x -> true,
1871-
(x, y) -> true,
1872-
true,
1873-
resolvedExpressionsSet("test-0", "test-alias")
1874-
);
1867+
String[] strings = indexNameExpressionResolver.allIndexAliases(project, "test-0", resolvedExpressionsSet("test-0", "test-alias"));
18751868
Arrays.sort(strings);
18761869
assertArrayEquals(new String[] { "test-alias" }, strings);
18771870
IndicesRequest request = new IndicesRequest() {
@@ -1943,12 +1936,9 @@ public void testConcreteWriteIndexWithWildcardExpansion() {
19431936
.putAlias(AliasMetadata.builder("test-alias").writeIndex(testZeroWriteIndex ? randomFrom(false, null) : true))
19441937
)
19451938
.build();
1946-
String[] strings = indexNameExpressionResolver.indexAliases(
1939+
String[] strings = indexNameExpressionResolver.allIndexAliases(
19471940
project,
19481941
"test-0",
1949-
x -> true,
1950-
(x, y) -> true,
1951-
true,
19521942
resolvedExpressionsSet("test-0", "test-1", "test-alias")
19531943
);
19541944
Arrays.sort(strings);
@@ -1981,14 +1971,7 @@ public void testConcreteWriteIndexWithNoWriteIndexWithSingleIndex() {
19811971
ProjectMetadata project = ProjectMetadata.builder(Metadata.DEFAULT_PROJECT_ID)
19821972
.put(indexBuilder("test-0").state(State.OPEN).putAlias(AliasMetadata.builder("test-alias").writeIndex(false)))
19831973
.build();
1984-
String[] strings = indexNameExpressionResolver.indexAliases(
1985-
project,
1986-
"test-0",
1987-
x -> true,
1988-
(x, y) -> true,
1989-
true,
1990-
resolvedExpressionsSet("test-0", "test-alias")
1991-
);
1974+
String[] strings = indexNameExpressionResolver.allIndexAliases(project, "test-0", resolvedExpressionsSet("test-0", "test-alias"));
19921975
Arrays.sort(strings);
19931976
assertArrayEquals(new String[] { "test-alias" }, strings);
19941977
DocWriteRequest<?> request = randomFrom(
@@ -2015,12 +1998,9 @@ public void testConcreteWriteIndexWithNoWriteIndexWithMultipleIndices() {
20151998
.put(indexBuilder("test-0").state(State.OPEN).putAlias(AliasMetadata.builder("test-alias").writeIndex(randomFrom(false, null))))
20161999
.put(indexBuilder("test-1").state(State.OPEN).putAlias(AliasMetadata.builder("test-alias").writeIndex(randomFrom(false, null))))
20172000
.build();
2018-
String[] strings = indexNameExpressionResolver.indexAliases(
2001+
String[] strings = indexNameExpressionResolver.allIndexAliases(
20192002
project,
20202003
"test-0",
2021-
x -> true,
2022-
(x, y) -> true,
2023-
true,
20242004
Set.of(new ResolvedExpression("test-0"), new ResolvedExpression("test-1"), new ResolvedExpression("test-alias"))
20252005
);
20262006
Arrays.sort(strings);
@@ -2056,12 +2036,9 @@ public void testAliasResolutionNotAllowingMultipleIndices() {
20562036
.putAlias(AliasMetadata.builder("test-alias").writeIndex(randomFrom(test0WriteIndex == false, null)))
20572037
)
20582038
.build();
2059-
String[] strings = indexNameExpressionResolver.indexAliases(
2039+
String[] strings = indexNameExpressionResolver.allIndexAliases(
20602040
project,
20612041
"test-0",
2062-
x -> true,
2063-
(x, y) -> true,
2064-
true,
20652042
resolvedExpressionsSet("test-0", "test-1", "test-alias")
20662043
);
20672044
Arrays.sort(strings);

0 commit comments

Comments
 (0)