|
3 | 3 | import app.AppsMap; |
4 | 4 | import app.component.App; |
5 | 5 | import app.component.Operator; |
| 6 | +import com.fasterxml.jackson.core.JsonProcessingException; |
| 7 | +import com.fasterxml.jackson.databind.ObjectMapper; |
| 8 | +import com.fasterxml.jackson.databind.node.ObjectNode; |
6 | 9 | import com.uid2.client.DecryptionStatus; |
7 | 10 | import org.junit.jupiter.params.provider.Arguments; |
8 | 11 |
|
9 | | -import java.util.HashSet; |
10 | | -import java.util.List; |
11 | | -import java.util.Optional; |
12 | | -import java.util.Set; |
| 12 | +import java.util.*; |
13 | 13 | import java.util.stream.Collectors; |
| 14 | +import java.util.stream.IntStream; |
14 | 15 | import java.util.stream.Stream; |
15 | 16 |
|
16 | 17 | import static org.junit.jupiter.api.Named.named; |
@@ -326,6 +327,27 @@ public static Set<Arguments> identityMapBatchEmailArgs() { |
326 | 327 | return args; |
327 | 328 | } |
328 | 329 |
|
| 330 | + public static Set<Arguments> identityMapBigBatchArgs() throws JsonProcessingException { |
| 331 | + Set<Operator> operators = AppsMap.getApps(Operator.class); |
| 332 | + |
| 333 | + List<String> emails = IntStream.range(0, 10_000) |
| 334 | + .mapToObj(i -> "email_" + i + "_" + UUID.randomUUID() + "@example.com") |
| 335 | + .collect(Collectors.toList()); |
| 336 | + |
| 337 | + ObjectMapper mapper = new ObjectMapper(); |
| 338 | + ObjectNode root = mapper.createObjectNode(); |
| 339 | + root.putPOJO("email", emails); |
| 340 | + root.put("policy", 1); |
| 341 | + |
| 342 | + String emailsPayload = mapper.writeValueAsString(root); |
| 343 | + |
| 344 | + Set<Arguments> args = new HashSet<>(); |
| 345 | + for (Operator operator : operators) { |
| 346 | + args.add(Arguments.of("10k emails", operator, operator.getName(), emailsPayload, emails)); |
| 347 | + } |
| 348 | + return args; |
| 349 | + } |
| 350 | + |
329 | 351 | public static Set<Arguments> identityMapBatchEmailArgsBadPolicy() { |
330 | 352 | Set<Operator> operators = getPublicOperators(); |
331 | 353 | Set<List<String>> inputs = Set.of( |
|
0 commit comments