Skip to content

Commit 0536aa6

Browse files
committed
fix test
1 parent 6ae858d commit 0536aa6

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

server/src/internalClusterTest/java/org/elasticsearch/plugins/internal/XContentMeteringParserDecoratorIT.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
package org.elasticsearch.plugins.internal;
1111

1212
import org.elasticsearch.action.index.IndexRequest;
13+
import org.elasticsearch.index.Index;
1314
import org.elasticsearch.index.IndexSettings;
1415
import org.elasticsearch.index.engine.EngineFactory;
1516
import org.elasticsearch.index.engine.InternalEngine;
@@ -131,22 +132,22 @@ public <T> XContentMeteringParserDecorator newMeteringParserDecorator(IndexReque
131132

132133
@Override
133134
public DocumentSizeReporter newDocumentSizeReporter(
134-
String indexName,
135+
Index index,
135136
MapperService mapperService,
136137
DocumentSizeAccumulator documentSizeAccumulator
137138
) {
138-
return new TestDocumentSizeReporter(indexName);
139+
return new TestDocumentSizeReporter(index);
139140
}
140141
};
141142
}
142143
}
143144

144145
public static class TestDocumentSizeReporter implements DocumentSizeReporter {
145146

146-
private final String indexName;
147+
private final Index index;
147148

148-
public TestDocumentSizeReporter(String indexName) {
149-
this.indexName = indexName;
149+
public TestDocumentSizeReporter(Index index) {
150+
this.index = index;
150151
}
151152

152153
@Override
@@ -155,7 +156,7 @@ public void onIndexingCompleted(ParsedDocument parsedDocument) {
155156
if (delta > XContentMeteringParserDecorator.UNKNOWN_SIZE) {
156157
COUNTER.addAndGet(delta);
157158
}
158-
assertThat(indexName, equalTo(TEST_INDEX_NAME));
159+
assertThat(index.getName(), equalTo(TEST_INDEX_NAME));
159160
}
160161
}
161162

0 commit comments

Comments
 (0)