From 89cb821c97b799de396e1a0d59a0eb8a6abd9e31 Mon Sep 17 00:00:00 2001 From: Chris Eager Date: Thu, 28 Mar 2024 10:56:07 -0500 Subject: [PATCH] Remove vavr dependency --- pom.xml | 6 ------ service/pom.xml | 4 ---- .../textsecuregcm/controllers/ProfileController.java | 6 +++--- .../textsecuregcm/calls/routing/CallRoutingTableTest.java | 7 +++---- 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 592aeb3d1..1d20949ce 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,6 @@ 2.0.9 23.10.0 2.2.17 - 0.10.4 2d00f6910282a7a20ae7747b8f5e2371f7d55f06daed6bf60a323fcc7eaa3da8 @@ -196,11 +195,6 @@ lettuce-core ${lettuce.version} - - io.vavr - vavr - ${vavr.version} - javax.xml.bind jaxb-api diff --git a/service/pom.xml b/service/pom.xml index acc3eae2e..f545852c0 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -418,10 +418,6 @@ io.projectreactor reactor-core-micrometer - - io.vavr - vavr - org.junit.jupiter diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProfileController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProfileController.java index f061c8756..010d96f29 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProfileController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProfileController.java @@ -13,7 +13,6 @@ import io.micrometer.core.instrument.Counter; import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Tags; import io.swagger.v3.oas.annotations.tags.Tag; -import io.vavr.Tuple; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.time.Clock; @@ -351,8 +350,9 @@ public class ProfileController { }, batchIdentityCheckExecutor); } - return Tuple.of(futures, responseElements); - }).thenCompose(tuple2 -> CompletableFuture.allOf(tuple2._1).thenApply((ignored) -> new BatchIdentityCheckResponse(tuple2._2))); + return new Pair<>(futures, responseElements); + }).thenCompose(futuresAndResponseElements -> CompletableFuture.allOf(futuresAndResponseElements.first()) + .thenApply((ignored) -> new BatchIdentityCheckResponse(futuresAndResponseElements.second()))); } private void checkFingerprintAndAdd(BatchIdentityCheckRequest.Element element, diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/calls/routing/CallRoutingTableTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/calls/routing/CallRoutingTableTest.java index f381411f7..0f601f7f0 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/calls/routing/CallRoutingTableTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/calls/routing/CallRoutingTableTest.java @@ -5,16 +5,15 @@ package org.whispersystems.textsecuregcm.calls.routing; -import io.vavr.Tuple2; -import org.junit.jupiter.api.Test; +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; + import java.net.Inet4Address; import java.net.Inet6Address; import java.net.UnknownHostException; import java.util.List; import java.util.Map; import java.util.Optional; - -import static org.assertj.core.api.AssertionsForClassTypes.assertThat; +import org.junit.jupiter.api.Test; public class CallRoutingTableTest {