Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing URLDecodeProcessorTests::testProcessor test #78690

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,14 @@ protected Class<?> expectedResultType() {

public void testProcessor() throws Exception {
IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random());
String fieldValue = RandomDocumentPicks.randomString(random());
String fieldName = RandomDocumentPicks.addRandomField(random(), ingestDocument, modifyInput(fieldValue));
String fieldValue;
String fieldName;
String modifiedFieldValue;
do {
fieldValue = RandomDocumentPicks.randomString(random());
modifiedFieldValue = modifyInput(fieldValue);
fieldName = RandomDocumentPicks.addRandomField(random(), ingestDocument, modifiedFieldValue);
} while (isSupportedValue(modifiedFieldValue) == false);
Processor processor = newProcessor(fieldName, randomBoolean(), fieldName);
processor.execute(ingestDocument);
assertThat(ingestDocument.getFieldValue(fieldName, expectedResultType()), equalTo(expectedResult(fieldValue)));
Expand All @@ -48,8 +54,13 @@ public void testProcessor() throws Exception {
List<String> fieldValueList = new ArrayList<>();
List<T> expectedList = new ArrayList<>();
for (int i = 0; i < numItems; i++) {
String randomString = RandomDocumentPicks.randomString(random());
fieldValueList.add(modifyInput(randomString));
String randomString;
String modifiedRandomString;
do {
randomString = RandomDocumentPicks.randomString(random());
modifiedRandomString = modifyInput(randomString);
} while (isSupportedValue(modifiedRandomString) == false);
fieldValueList.add(modifiedRandomString);
expectedList.add(expectedResult(randomString));
}
String multiValueFieldName = RandomDocumentPicks.addRandomField(random(), ingestDocument, fieldValueList);
Expand Down