Skip to content

Commit ac14000

Browse files
committed
Merge project builders
1 parent 962c09d commit ac14000

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/template/IndexTemplateRegistryTests.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -881,13 +881,6 @@ private ClusterState createClusterState(
881881
// ------------- functionality unit test --------
882882

883883
public void testFindRolloverTargetDataStreams() {
884-
ProjectMetadata project = ProjectMetadata.builder(randomProjectIdOrDefault())
885-
.put(DataStreamTestHelper.newInstance("ds1", Collections.singletonList(new Index(".ds-ds1-000001", "ds1i"))))
886-
.put(DataStreamTestHelper.newInstance("ds2", Collections.singletonList(new Index(".ds-ds2-000001", "ds2i"))))
887-
.put(DataStreamTestHelper.newInstance("ds3", Collections.singletonList(new Index(".ds-ds3-000001", "ds3i"))))
888-
.put(DataStreamTestHelper.newInstance("ds4", Collections.singletonList(new Index(".ds-ds4-000001", "ds4i"))))
889-
.build();
890-
891884
ComposableIndexTemplate it1 = ComposableIndexTemplate.builder()
892885
.indexPatterns(List.of("ds1*", "ds2*", "ds3*"))
893886
.priority(100L)
@@ -906,7 +899,15 @@ public void testFindRolloverTargetDataStreams() {
906899
.dataStreamTemplate(new ComposableIndexTemplate.DataStreamTemplate())
907900
.build();
908901

909-
project = ProjectMetadata.builder(project).put("it1", it1).put("it2", it2).put("it5", it5).build();
902+
ProjectMetadata project = ProjectMetadata.builder(randomProjectIdOrDefault())
903+
.put(DataStreamTestHelper.newInstance("ds1", Collections.singletonList(new Index(".ds-ds1-000001", "ds1i"))))
904+
.put(DataStreamTestHelper.newInstance("ds2", Collections.singletonList(new Index(".ds-ds2-000001", "ds2i"))))
905+
.put(DataStreamTestHelper.newInstance("ds3", Collections.singletonList(new Index(".ds-ds3-000001", "ds3i"))))
906+
.put(DataStreamTestHelper.newInstance("ds4", Collections.singletonList(new Index(".ds-ds4-000001", "ds4i"))))
907+
.put("it1", it1)
908+
.put("it2", it2)
909+
.put("it5", it5)
910+
.build();
910911

911912
assertThat(IndexTemplateRegistry.findRolloverTargetDataStreams(project, "it1", it1), containsInAnyOrder("ds1", "ds3"));
912913
assertThat(IndexTemplateRegistry.findRolloverTargetDataStreams(project, "it2", it2), contains("ds2"));

0 commit comments

Comments
 (0)