Skip to content

Commit 09ee42e

Browse files
committed
Tests: Fix convert error tests to use fixed value (#32415)
The error tests for hex values previously used a random string of digits, but this could be a valid hex value. This commit changes these tests to use a fixed invalid hex value. closes #32370
1 parent 339b0b3 commit 09ee42e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/ConvertProcessorTests.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,9 @@ public void testConvertIntLeadingZero() throws Exception {
6767
assertThat(ingestDocument.getFieldValue(fieldName, Integer.class), equalTo(10));
6868
}
6969

70-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/32370")
7170
public void testConvertIntHexError() {
7271
IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random());
73-
String value = "0x" + randomAlphaOfLengthBetween(1, 10);
72+
String value = "0xnotanumber";
7473
String fieldName = RandomDocumentPicks.addRandomField(random(), ingestDocument, value);
7574
Processor processor = new ConvertProcessor(randomAlphaOfLength(10), fieldName, fieldName, Type.INTEGER, false);
7675
IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> processor.execute(ingestDocument));
@@ -138,10 +137,9 @@ public void testConvertLongLeadingZero() throws Exception {
138137
assertThat(ingestDocument.getFieldValue(fieldName, Long.class), equalTo(10L));
139138
}
140139

141-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/32370")
142140
public void testConvertLongHexError() {
143141
IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random());
144-
String value = "0x" + randomAlphaOfLengthBetween(1, 10);
142+
String value = "0xnotanumber";
145143
String fieldName = RandomDocumentPicks.addRandomField(random(), ingestDocument, value);
146144
Processor processor = new ConvertProcessor(randomAlphaOfLength(10), fieldName, fieldName, Type.LONG, false);
147145
IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> processor.execute(ingestDocument));

0 commit comments

Comments
 (0)