Skip to content

Commit cdc9329

Browse files
committed
Added phones to identity map batch test
1 parent 4adfb12 commit cdc9329

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/test/java/suite/operator/TestData.java

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -328,22 +328,29 @@ public static Set<Arguments> identityMapBatchEmailArgs() {
328328
}
329329

330330
public static Set<Arguments> identityMapBigBatchArgs() throws JsonProcessingException {
331+
ObjectMapper mapper = new ObjectMapper();
332+
Random random = new Random();
331333
Set<Operator> operators = AppsMap.getApps(Operator.class);
332334

333-
List<String> emails = IntStream.range(0, 10_000)
334-
.mapToObj(i -> "email_" + i + "_" + UUID.randomUUID() + "@example.com")
335-
.collect(Collectors.toList());
335+
List<String> emails = new ArrayList<>();
336+
List<String> phones = new ArrayList<>();
337+
for (int i = 0; i < 10_000; i++) {
338+
emails.add("email_" + Math.abs(random.nextLong()) + "@example.com");
336339

337-
ObjectMapper mapper = new ObjectMapper();
338-
ObjectNode root = mapper.createObjectNode();
339-
root.putPOJO("email", emails);
340-
root.put("policy", 1);
340+
// Phone numbers with 15 digits are technically valid but are not used in any country
341+
phones.add("+" + String.format("%015d", Math.abs(random.nextLong() % 1_000_000_000_000_000L)));
342+
}
343+
344+
var emailsJson = mapper.createObjectNode().putPOJO("email", emails).put("policy", 1);
345+
String emailsPayload = mapper.writeValueAsString(emailsJson);
341346

342-
String emailsPayload = mapper.writeValueAsString(root);
347+
var phonesJson = mapper.createObjectNode().putPOJO("phone", phones).put("policy", 1);
348+
String phonesPayload = mapper.writeValueAsString(phonesJson);
343349

344350
Set<Arguments> args = new HashSet<>();
345351
for (Operator operator : operators) {
346352
args.add(Arguments.of("10k emails", operator, operator.getName(), emailsPayload, emails));
353+
args.add(Arguments.of("10k phones", operator, operator.getName(), phonesPayload, phones));
347354
}
348355
return args;
349356
}

0 commit comments

Comments
 (0)