|
21 | 21 |
|
22 | 22 | import com.carrotsearch.randomizedtesting.generators.RandomPicks;
|
23 | 23 | import com.carrotsearch.randomizedtesting.generators.RandomStrings;
|
| 24 | + |
24 | 25 | import org.elasticsearch.ElasticsearchException;
|
25 | 26 | import org.elasticsearch.action.support.replication.ReplicationResponse.ShardInfo;
|
26 | 27 | import org.elasticsearch.action.support.replication.ReplicationResponse.ShardInfo.Failure;
|
27 | 28 | import org.elasticsearch.cluster.block.ClusterBlockException;
|
| 29 | +import org.elasticsearch.common.bytes.BytesArray; |
28 | 30 | import org.elasticsearch.common.bytes.BytesReference;
|
29 | 31 | import org.elasticsearch.common.collect.Tuple;
|
30 | 32 | import org.elasticsearch.common.xcontent.ToXContent;
|
@@ -127,14 +129,14 @@ public static Tuple<List<Object>, List<Object>> randomStoredFieldValues(Random r
|
127 | 129 | break;
|
128 | 130 | case 8:
|
129 | 131 | byte[] randomBytes = RandomStrings.randomUnicodeOfLengthBetween(random, 10, 50).getBytes(StandardCharsets.UTF_8);
|
| 132 | + BytesArray randomBytesArray = new BytesArray(randomBytes); |
| 133 | + originalValues.add(randomBytesArray); |
130 | 134 | if (xContentType == XContentType.JSON || xContentType == XContentType.YAML) {
|
131 | 135 | //JSON and YAML write the base64 format
|
132 | 136 | expectedParsedValues.add(Base64.getEncoder().encodeToString(randomBytes));
|
133 |
| - originalValues.add(Base64.getEncoder().encodeToString(randomBytes)); |
134 | 137 | } else {
|
135 | 138 | //SMILE and CBOR write the original bytes as they support binary format
|
136 |
| - expectedParsedValues.add(randomBytes); |
137 |
| - originalValues.add(randomBytes); |
| 139 | + expectedParsedValues.add(randomBytesArray); |
138 | 140 | }
|
139 | 141 | break;
|
140 | 142 | default:
|
|
0 commit comments