From 75e7f1e0f02b3c50e017c6029a823839cfffe5bc Mon Sep 17 00:00:00 2001 From: Pablo Arteaga Date: Thu, 30 Nov 2023 17:54:18 +0000 Subject: [PATCH] Make utility classes final --- .../trino/plugin/opa/FilteringTestHelpers.java | 2 +- .../io/trino/plugin/opa/FunctionalHelpers.java | 17 +---------------- .../io/trino/plugin/opa/HttpClientUtils.java | 4 ++-- .../trino/plugin/opa/RequestTestUtilities.java | 2 +- .../java/io/trino/plugin/opa/TestHelpers.java | 2 +- 5 files changed, 6 insertions(+), 21 deletions(-) diff --git a/plugin/trino-opa/src/test/java/io/trino/plugin/opa/FilteringTestHelpers.java b/plugin/trino-opa/src/test/java/io/trino/plugin/opa/FilteringTestHelpers.java index 75c9b628aa5e..a3f24e155441 100644 --- a/plugin/trino-opa/src/test/java/io/trino/plugin/opa/FilteringTestHelpers.java +++ b/plugin/trino-opa/src/test/java/io/trino/plugin/opa/FilteringTestHelpers.java @@ -29,7 +29,7 @@ import static io.trino.plugin.opa.TestHelpers.createIllegalResponseTestCases; -public class FilteringTestHelpers +public final class FilteringTestHelpers { private FilteringTestHelpers() {} diff --git a/plugin/trino-opa/src/test/java/io/trino/plugin/opa/FunctionalHelpers.java b/plugin/trino-opa/src/test/java/io/trino/plugin/opa/FunctionalHelpers.java index e3fbdc2c78a3..25354b717685 100644 --- a/plugin/trino-opa/src/test/java/io/trino/plugin/opa/FunctionalHelpers.java +++ b/plugin/trino-opa/src/test/java/io/trino/plugin/opa/FunctionalHelpers.java @@ -13,33 +13,18 @@ */ package io.trino.plugin.opa; -public class FunctionalHelpers +public final class FunctionalHelpers { public interface Consumer3 { void accept(T1 t1, T2 t2, T3 t3); } - public interface Function3 - { - R apply(T1 t1, T2 t2, T3 t3); - } - public interface Consumer4 { void accept(T1 t1, T2 t2, T3 t3, T4 t4); } - public interface Consumer5 - { - void accept(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5); - } - - public interface Consumer6 - { - void accept(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6); - } - public record Pair(T first, U second) { public static Pair of(T first, U second) diff --git a/plugin/trino-opa/src/test/java/io/trino/plugin/opa/HttpClientUtils.java b/plugin/trino-opa/src/test/java/io/trino/plugin/opa/HttpClientUtils.java index 1d21b70e7adf..83ae8c57331f 100644 --- a/plugin/trino-opa/src/test/java/io/trino/plugin/opa/HttpClientUtils.java +++ b/plugin/trino-opa/src/test/java/io/trino/plugin/opa/HttpClientUtils.java @@ -36,7 +36,7 @@ import static com.google.common.net.MediaType.JSON_UTF_8; import static java.util.Objects.requireNonNull; -public class HttpClientUtils +public final class HttpClientUtils { private HttpClientUtils() {} @@ -93,7 +93,7 @@ public List getRequests() } } - public static class InstrumentedHttpClient + public static final class InstrumentedHttpClient extends TestingHttpClient { private final RecordingHttpProcessor httpProcessor; diff --git a/plugin/trino-opa/src/test/java/io/trino/plugin/opa/RequestTestUtilities.java b/plugin/trino-opa/src/test/java/io/trino/plugin/opa/RequestTestUtilities.java index b15a585501a9..7bf683b5d79c 100644 --- a/plugin/trino-opa/src/test/java/io/trino/plugin/opa/RequestTestUtilities.java +++ b/plugin/trino-opa/src/test/java/io/trino/plugin/opa/RequestTestUtilities.java @@ -28,7 +28,7 @@ import static io.trino.plugin.opa.TestHelpers.SYSTEM_ACCESS_CONTROL_CONTEXT; import static org.assertj.core.api.Assertions.assertThat; -public class RequestTestUtilities +public final class RequestTestUtilities { private RequestTestUtilities() {} diff --git a/plugin/trino-opa/src/test/java/io/trino/plugin/opa/TestHelpers.java b/plugin/trino-opa/src/test/java/io/trino/plugin/opa/TestHelpers.java index eb3c6b5e3b10..d47e2a4280d8 100644 --- a/plugin/trino-opa/src/test/java/io/trino/plugin/opa/TestHelpers.java +++ b/plugin/trino-opa/src/test/java/io/trino/plugin/opa/TestHelpers.java @@ -39,7 +39,7 @@ import static com.google.common.collect.ImmutableSet.toImmutableSet; import static com.google.common.net.MediaType.JSON_UTF_8; -public class TestHelpers +public final class TestHelpers { private TestHelpers() {}