From 234c38802f822d07f4423f55aabfd259ba2d7bf5 Mon Sep 17 00:00:00 2001 From: Koushik R Date: Mon, 27 Dec 2021 14:58:42 +0530 Subject: [PATCH] Removed the explicit constructor in ServiceNode --- .../ranger/client/AbstractRangerClient.java | 1 - .../ranger/client/AbstractRangerHubClient.java | 1 - .../client/AbstractRangerHubClientTest.java | 4 ---- .../stubs/TestSimpleUnshardedServiceFinder.java | 6 +++++- .../ranger/core/finder/ServiceFinder.java | 1 - .../serviceregistry/ListBasedServiceRegistry.java | 1 - .../core/healthcheck/HealthcheckResult.java | 1 - .../healthservice/ServiceHealthAggregator.java | 1 - .../monitor/sample/PingCheckMonitor.java | 1 - .../flipkart/ranger/core/model/ServiceNode.java | 15 ++++++--------- .../BaseServiceProviderBuilder.java | 3 +-- .../RoundRobinServiceNodeSelectorTest.java | 7 +++---- .../ranger/core/utils/RegistryTestUtils.java | 12 ++++++------ .../client/http/BaseRangerHttpClientTest.java | 2 +- .../client/http/ShardedRangerHttpClientTest.java | 2 -- .../client/http/SimpleRangerHttpClientTest.java | 1 - .../http/UnshardedRangerHttpClientTest.java | 1 - .../HttpShardedServiceFinderBuilderTest.java | 2 +- .../HttpShardedServiceProviderBuilderTest.java | 2 +- .../zk/server/bundle/RangerServerBundleTest.java | 2 -- .../ranger/common/server/ShardInfoTest.java | 1 - .../client/zk/ShardedZKRangerClientTest.java | 3 --- .../client/zk/SimpleRangerZKClientTest.java | 3 --- .../client/zk/UnshardedZKRangerClientTest.java | 3 --- .../model/ServiceProviderExtCuratorTest.java | 1 - .../zookeeper/model/ServiceProviderTest.java | 1 - .../model/SimpleServiceProviderTest.java | 1 - 27 files changed, 24 insertions(+), 55 deletions(-) diff --git a/ranger-client/src/main/java/com/flipkart/ranger/client/AbstractRangerClient.java b/ranger-client/src/main/java/com/flipkart/ranger/client/AbstractRangerClient.java index 5cc792c3..16845096 100644 --- a/ranger-client/src/main/java/com/flipkart/ranger/client/AbstractRangerClient.java +++ b/ranger-client/src/main/java/com/flipkart/ranger/client/AbstractRangerClient.java @@ -19,7 +19,6 @@ import com.flipkart.ranger.core.finder.ServiceFinder; import com.flipkart.ranger.core.model.ServiceNode; import com.flipkart.ranger.core.model.ServiceRegistry; -import lombok.val; import java.util.List; import java.util.Optional; diff --git a/ranger-client/src/main/java/com/flipkart/ranger/client/AbstractRangerHubClient.java b/ranger-client/src/main/java/com/flipkart/ranger/client/AbstractRangerHubClient.java index 0330685a..fdffd781 100644 --- a/ranger-client/src/main/java/com/flipkart/ranger/client/AbstractRangerHubClient.java +++ b/ranger-client/src/main/java/com/flipkart/ranger/client/AbstractRangerHubClient.java @@ -27,7 +27,6 @@ import com.google.common.base.Preconditions; import lombok.Getter; import lombok.extern.slf4j.Slf4j; -import lombok.val; import java.util.Collection; import java.util.Collections; diff --git a/ranger-client/src/test/java/com/flipkart/ranger/client/AbstractRangerHubClientTest.java b/ranger-client/src/test/java/com/flipkart/ranger/client/AbstractRangerHubClientTest.java index f359a8d9..c1091316 100644 --- a/ranger-client/src/test/java/com/flipkart/ranger/client/AbstractRangerHubClientTest.java +++ b/ranger-client/src/test/java/com/flipkart/ranger/client/AbstractRangerHubClientTest.java @@ -17,8 +17,6 @@ import com.flipkart.ranger.client.utils.RangerHubTestUtils; import com.flipkart.ranger.core.model.Service; -import com.flipkart.ranger.core.model.ServiceNode; -import com.flipkart.ranger.core.units.TestNodeData; import com.flipkart.ranger.core.utils.RangerTestUtils; import com.flipkart.ranger.core.utils.TestUtils; import lombok.extern.slf4j.Slf4j; @@ -27,8 +25,6 @@ import org.junit.Assert; import org.junit.Test; -import java.util.Optional; - @Slf4j public class AbstractRangerHubClientTest { diff --git a/ranger-client/src/test/java/com/flipkart/ranger/client/stubs/TestSimpleUnshardedServiceFinder.java b/ranger-client/src/test/java/com/flipkart/ranger/client/stubs/TestSimpleUnshardedServiceFinder.java index 7d1d77a5..cbf0064a 100644 --- a/ranger-client/src/test/java/com/flipkart/ranger/client/stubs/TestSimpleUnshardedServiceFinder.java +++ b/ranger-client/src/test/java/com/flipkart/ranger/client/stubs/TestSimpleUnshardedServiceFinder.java @@ -46,7 +46,11 @@ static class TestDataSource implements NodeDataSource> refresh(Deserializer deserializer) { return Collections.singletonList( - new ServiceNode<>("localhost", 9200, TestNodeData.builder().shardId(1).build()) + ServiceNode.builder() + .host("localhost") + .port(9200) + .nodeData(TestNodeData.builder().shardId(1).build()) + .build() ); } diff --git a/ranger-core/src/main/java/com/flipkart/ranger/core/finder/ServiceFinder.java b/ranger-core/src/main/java/com/flipkart/ranger/core/finder/ServiceFinder.java index 553f741b..7ded56ce 100644 --- a/ranger-core/src/main/java/com/flipkart/ranger/core/finder/ServiceFinder.java +++ b/ranger-core/src/main/java/com/flipkart/ranger/core/finder/ServiceFinder.java @@ -25,7 +25,6 @@ import lombok.extern.slf4j.Slf4j; import lombok.var; -import javax.swing.text.html.Option; import java.util.Collections; import java.util.List; import java.util.Optional; diff --git a/ranger-core/src/main/java/com/flipkart/ranger/core/finder/serviceregistry/ListBasedServiceRegistry.java b/ranger-core/src/main/java/com/flipkart/ranger/core/finder/serviceregistry/ListBasedServiceRegistry.java index 5a02014b..66e2123f 100644 --- a/ranger-core/src/main/java/com/flipkart/ranger/core/finder/serviceregistry/ListBasedServiceRegistry.java +++ b/ranger-core/src/main/java/com/flipkart/ranger/core/finder/serviceregistry/ListBasedServiceRegistry.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableList; import lombok.val; -import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.concurrent.atomic.AtomicReference; diff --git a/ranger-core/src/main/java/com/flipkart/ranger/core/healthcheck/HealthcheckResult.java b/ranger-core/src/main/java/com/flipkart/ranger/core/healthcheck/HealthcheckResult.java index 65d0cfe4..6d7c2697 100644 --- a/ranger-core/src/main/java/com/flipkart/ranger/core/healthcheck/HealthcheckResult.java +++ b/ranger-core/src/main/java/com/flipkart/ranger/core/healthcheck/HealthcheckResult.java @@ -16,7 +16,6 @@ package com.flipkart.ranger.core.healthcheck; import lombok.Builder; -import lombok.Data; import lombok.Value; /** diff --git a/ranger-core/src/main/java/com/flipkart/ranger/core/healthservice/ServiceHealthAggregator.java b/ranger-core/src/main/java/com/flipkart/ranger/core/healthservice/ServiceHealthAggregator.java index 30eae894..ad9a838e 100644 --- a/ranger-core/src/main/java/com/flipkart/ranger/core/healthservice/ServiceHealthAggregator.java +++ b/ranger-core/src/main/java/com/flipkart/ranger/core/healthservice/ServiceHealthAggregator.java @@ -27,7 +27,6 @@ import java.util.Date; import java.util.List; import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; diff --git a/ranger-core/src/main/java/com/flipkart/ranger/core/healthservice/monitor/sample/PingCheckMonitor.java b/ranger-core/src/main/java/com/flipkart/ranger/core/healthservice/monitor/sample/PingCheckMonitor.java index db754bc3..7b879961 100644 --- a/ranger-core/src/main/java/com/flipkart/ranger/core/healthservice/monitor/sample/PingCheckMonitor.java +++ b/ranger-core/src/main/java/com/flipkart/ranger/core/healthservice/monitor/sample/PingCheckMonitor.java @@ -24,7 +24,6 @@ import org.apache.http.HttpHost; import org.apache.http.HttpRequest; import org.apache.http.HttpStatus; -import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.conn.routing.HttpRoute; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; diff --git a/ranger-core/src/main/java/com/flipkart/ranger/core/model/ServiceNode.java b/ranger-core/src/main/java/com/flipkart/ranger/core/model/ServiceNode.java index 383c6a36..e6ae8871 100644 --- a/ranger-core/src/main/java/com/flipkart/ranger/core/model/ServiceNode.java +++ b/ranger-core/src/main/java/com/flipkart/ranger/core/model/ServiceNode.java @@ -17,9 +17,15 @@ package com.flipkart.ranger.core.model; import com.flipkart.ranger.core.healthcheck.HealthcheckStatus; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; @Data +@NoArgsConstructor +@AllArgsConstructor +@Builder public class ServiceNode { private String host; private int port; @@ -27,15 +33,6 @@ public class ServiceNode { private HealthcheckStatus healthcheckStatus = HealthcheckStatus.healthy; private long lastUpdatedTimeStamp = Long.MIN_VALUE; - public ServiceNode() { - } - - public ServiceNode(String host, int port, T nodeData) { - this.host = host; - this.port = port; - this.nodeData = nodeData; - } - public String representation() { return String.format("%s:%d", host, port); } diff --git a/ranger-core/src/main/java/com/flipkart/ranger/core/serviceprovider/BaseServiceProviderBuilder.java b/ranger-core/src/main/java/com/flipkart/ranger/core/serviceprovider/BaseServiceProviderBuilder.java index 0025063e..48a2ed6a 100644 --- a/ranger-core/src/main/java/com/flipkart/ranger/core/serviceprovider/BaseServiceProviderBuilder.java +++ b/ranger-core/src/main/java/com/flipkart/ranger/core/serviceprovider/BaseServiceProviderBuilder.java @@ -197,8 +197,7 @@ protected final ServiceProvider buildProvider() { .add(healthcheckUpdateSignalGenerator) .addAll(additionalRefreshSignals) .build(); - val serviceProvider = new ServiceProvider<>(service, - new ServiceNode<>(hostname, port, nodeData), + val serviceProvider = new ServiceProvider<>(service, ServiceNode.builder().host(hostname).port(port).nodeData(nodeData).build(), serializer, usableNodeDataSource, signalGenerators); diff --git a/ranger-core/src/test/java/com/flipkart/ranger/core/finder/nodeselector/RoundRobinServiceNodeSelectorTest.java b/ranger-core/src/test/java/com/flipkart/ranger/core/finder/nodeselector/RoundRobinServiceNodeSelectorTest.java index 15960ae3..273ff997 100644 --- a/ranger-core/src/test/java/com/flipkart/ranger/core/finder/nodeselector/RoundRobinServiceNodeSelectorTest.java +++ b/ranger-core/src/test/java/com/flipkart/ranger/core/finder/nodeselector/RoundRobinServiceNodeSelectorTest.java @@ -18,7 +18,6 @@ import com.flipkart.ranger.core.model.ServiceNode; import com.flipkart.ranger.core.units.TestNodeData; import lombok.val; -import lombok.var; import org.junit.Assert; import org.junit.Test; @@ -29,9 +28,9 @@ public class RoundRobinServiceNodeSelectorTest { public void testRandomNodeSelector(){ val roundRobinSelector = new RoundRobinServiceNodeSelector(); val serviceNodes = new ArrayList>(); - serviceNodes.add(new ServiceNode<>("localhost-1", 9000, TestNodeData.builder().shardId(1).build())); - serviceNodes.add(new ServiceNode<>("localhost-2", 9001, TestNodeData.builder().shardId(2).build())); - serviceNodes.add(new ServiceNode<>("localhost-3", 9002, TestNodeData.builder().shardId(3).build())); + serviceNodes.add(ServiceNode.builder().host("localhost-1").port(9000).nodeData(TestNodeData.builder().shardId(1).build()).build()); + serviceNodes.add(ServiceNode.builder().host("localhost-2").port(9001).nodeData(TestNodeData.builder().shardId(2).build()).build()); + serviceNodes.add(ServiceNode.builder().host("localhost-3").port(9002).nodeData(TestNodeData.builder().shardId(3).build()).build()); Assert.assertEquals("localhost-2", roundRobinSelector.select(serviceNodes).getHost()); Assert.assertEquals("localhost-3", roundRobinSelector.select(serviceNodes).getHost()); Assert.assertEquals("localhost-1", roundRobinSelector.select(serviceNodes).getHost()); diff --git a/ranger-core/src/test/java/com/flipkart/ranger/core/utils/RegistryTestUtils.java b/ranger-core/src/test/java/com/flipkart/ranger/core/utils/RegistryTestUtils.java index 759a946c..4f1620e7 100644 --- a/ranger-core/src/test/java/com/flipkart/ranger/core/utils/RegistryTestUtils.java +++ b/ranger-core/src/test/java/com/flipkart/ranger/core/utils/RegistryTestUtils.java @@ -30,9 +30,9 @@ public static MapBasedServiceRegistry getServiceRegistry(){ val service = RangerTestUtils.getService(); val serviceRegistry = new MapBasedServiceRegistry(service); val serviceNodes = ImmutableList.of( - new ServiceNode<>("localhost-1", 9000, TestNodeData.builder().shardId(1).build()), - new ServiceNode<>("localhost-2", 9001, TestNodeData.builder().shardId(2).build()), - new ServiceNode<>("localhost-3", 9002, TestNodeData.builder().shardId(3).build()) + ServiceNode.builder().host("localhost-1").port(9000).nodeData(TestNodeData.builder().shardId(1).build()).build(), + ServiceNode.builder().host("localhost-2").port(9001).nodeData(TestNodeData.builder().shardId(2).build()).build(), + ServiceNode.builder().host("localhost-3").port(9002).nodeData(TestNodeData.builder().shardId(3).build()).build() ); serviceRegistry.updateNodes(serviceNodes); return serviceRegistry; @@ -42,9 +42,9 @@ public static ListBasedServiceRegistry getUnshardedRegistry(){ val service = RangerTestUtils.getService(); val serviceRegistry = new ListBasedServiceRegistry(service); val serviceNodes = ImmutableList.of( - new ServiceNode<>("localhost-1", 9000, TestNodeData.builder().shardId(1).build()), - new ServiceNode<>("localhost-2", 9001, TestNodeData.builder().shardId(2).build()), - new ServiceNode<>("localhost-3", 9002, TestNodeData.builder().shardId(3).build()) + ServiceNode.builder().host("localhost-1").port(9000).nodeData(TestNodeData.builder().shardId(1).build()).build(), + ServiceNode.builder().host("localhost-2").port(9001).nodeData(TestNodeData.builder().shardId(2).build()).build(), + ServiceNode.builder().host("localhost-3").port(9002).nodeData(TestNodeData.builder().shardId(3).build()).build() ); serviceRegistry.updateNodes(serviceNodes); return serviceRegistry; diff --git a/ranger-http-client/src/test/java/com/flipkart/ranger/client/http/BaseRangerHttpClientTest.java b/ranger-http-client/src/test/java/com/flipkart/ranger/client/http/BaseRangerHttpClientTest.java index 3ed8d871..673f60e5 100644 --- a/ranger-http-client/src/test/java/com/flipkart/ranger/client/http/BaseRangerHttpClientTest.java +++ b/ranger-http-client/src/test/java/com/flipkart/ranger/client/http/BaseRangerHttpClientTest.java @@ -52,7 +52,7 @@ public abstract class BaseRangerHttpClientTest { @Before public void startTestCluster() throws Exception { val testNode = TestNodeData.builder().shardId(1).build(); - val node = new ServiceNode<>("127.0.0.1", 80, testNode); + val node = ServiceNode.builder().host("127.0.0.1").port(80).nodeData(testNode).build(); node.setHealthcheckStatus(HealthcheckStatus.healthy); node.setLastUpdatedTimeStamp(System.currentTimeMillis()); val payload = objectMapper.writeValueAsBytes( diff --git a/ranger-http-client/src/test/java/com/flipkart/ranger/client/http/ShardedRangerHttpClientTest.java b/ranger-http-client/src/test/java/com/flipkart/ranger/client/http/ShardedRangerHttpClientTest.java index 3e1d6499..62ca8c84 100644 --- a/ranger-http-client/src/test/java/com/flipkart/ranger/client/http/ShardedRangerHttpClientTest.java +++ b/ranger-http-client/src/test/java/com/flipkart/ranger/client/http/ShardedRangerHttpClientTest.java @@ -15,12 +15,10 @@ */ package com.flipkart.ranger.client.http; -import com.flipkart.ranger.core.model.ServiceNode; import com.flipkart.ranger.core.units.TestNodeData; import com.flipkart.ranger.core.utils.RangerTestUtils; import com.flipkart.ranger.core.utils.TestUtils; import lombok.val; -import lombok.var; import org.junit.Assert; import org.junit.Test; diff --git a/ranger-http-client/src/test/java/com/flipkart/ranger/client/http/SimpleRangerHttpClientTest.java b/ranger-http-client/src/test/java/com/flipkart/ranger/client/http/SimpleRangerHttpClientTest.java index 5fd9848c..37a4da2a 100644 --- a/ranger-http-client/src/test/java/com/flipkart/ranger/client/http/SimpleRangerHttpClientTest.java +++ b/ranger-http-client/src/test/java/com/flipkart/ranger/client/http/SimpleRangerHttpClientTest.java @@ -15,7 +15,6 @@ */ package com.flipkart.ranger.client.http; -import com.flipkart.ranger.core.model.ServiceNode; import com.flipkart.ranger.core.units.TestNodeData; import com.flipkart.ranger.core.utils.TestUtils; import lombok.val; diff --git a/ranger-http-client/src/test/java/com/flipkart/ranger/client/http/UnshardedRangerHttpClientTest.java b/ranger-http-client/src/test/java/com/flipkart/ranger/client/http/UnshardedRangerHttpClientTest.java index c89324e9..283dd268 100644 --- a/ranger-http-client/src/test/java/com/flipkart/ranger/client/http/UnshardedRangerHttpClientTest.java +++ b/ranger-http-client/src/test/java/com/flipkart/ranger/client/http/UnshardedRangerHttpClientTest.java @@ -15,7 +15,6 @@ */ package com.flipkart.ranger.client.http; -import com.flipkart.ranger.core.model.ServiceNode; import com.flipkart.ranger.core.units.TestNodeData; import com.flipkart.ranger.core.utils.RangerTestUtils; import com.flipkart.ranger.core.utils.TestUtils; diff --git a/ranger-http/src/test/java/com/flipkart/ranger/http/servicefinder/HttpShardedServiceFinderBuilderTest.java b/ranger-http/src/test/java/com/flipkart/ranger/http/servicefinder/HttpShardedServiceFinderBuilderTest.java index 4030e1ef..2b8ee723 100644 --- a/ranger-http/src/test/java/com/flipkart/ranger/http/servicefinder/HttpShardedServiceFinderBuilderTest.java +++ b/ranger-http/src/test/java/com/flipkart/ranger/http/servicefinder/HttpShardedServiceFinderBuilderTest.java @@ -58,7 +58,7 @@ public NodeData(@JsonProperty("name") String name) { @Test public void testFinder() throws Exception { val testNode = new NodeData("testNode"); - val node = new ServiceNode<>("127.0.0.1", 80, testNode); + val node = ServiceNode.builder().host("127.0.0.1").port(80).nodeData(testNode).build(); node.setHealthcheckStatus(HealthcheckStatus.healthy); node.setLastUpdatedTimeStamp(System.currentTimeMillis()); val payload = MAPPER.writeValueAsBytes( diff --git a/ranger-http/src/test/java/com/flipkart/ranger/http/serviceprovider/HttpShardedServiceProviderBuilderTest.java b/ranger-http/src/test/java/com/flipkart/ranger/http/serviceprovider/HttpShardedServiceProviderBuilderTest.java index a581a51a..dd5e3b0f 100644 --- a/ranger-http/src/test/java/com/flipkart/ranger/http/serviceprovider/HttpShardedServiceProviderBuilderTest.java +++ b/ranger-http/src/test/java/com/flipkart/ranger/http/serviceprovider/HttpShardedServiceProviderBuilderTest.java @@ -52,7 +52,7 @@ public TestNodeData(@JsonProperty("farmId") String farmId) { @Test public void testProvider() throws Exception { val farmNodeData = TestNodeData.builder().farmId("farm1").build(); - val testNode = new ServiceNode<>("localhost-1", 80, farmNodeData); + val testNode = ServiceNode.builder().host("127.0.0.1").port(80).nodeData(farmNodeData).build(); val response = MAPPER.writeValueAsBytes( GenericResponse.builder() .code(RangerResponseCode.SUCCESS) diff --git a/ranger-server-bundle/src/test/java/com/flipkart/ranger/zk/server/bundle/RangerServerBundleTest.java b/ranger-server-bundle/src/test/java/com/flipkart/ranger/zk/server/bundle/RangerServerBundleTest.java index 424a6cb9..b8e9fff0 100644 --- a/ranger-server-bundle/src/test/java/com/flipkart/ranger/zk/server/bundle/RangerServerBundleTest.java +++ b/ranger-server-bundle/src/test/java/com/flipkart/ranger/zk/server/bundle/RangerServerBundleTest.java @@ -20,7 +20,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.flipkart.ranger.client.RangerHubClient; import com.flipkart.ranger.client.utils.RangerHubTestUtils; -import com.flipkart.ranger.core.model.ServiceNode; import com.flipkart.ranger.core.units.TestNodeData; import com.flipkart.ranger.core.utils.RangerTestUtils; import com.flipkart.ranger.core.utils.TestUtils; @@ -42,7 +41,6 @@ import java.util.Collections; import java.util.List; -import java.util.Optional; import static com.flipkart.ranger.client.utils.RangerHubTestUtils.service; import static org.mockito.ArgumentMatchers.any; diff --git a/ranger-server-common/src/test/java/com/flipkart/ranger/common/server/ShardInfoTest.java b/ranger-server-common/src/test/java/com/flipkart/ranger/common/server/ShardInfoTest.java index 15c7e24e..33aa7de2 100644 --- a/ranger-server-common/src/test/java/com/flipkart/ranger/common/server/ShardInfoTest.java +++ b/ranger-server-common/src/test/java/com/flipkart/ranger/common/server/ShardInfoTest.java @@ -7,7 +7,6 @@ import org.junit.Test; import java.io.BufferedReader; -import java.io.InputStream; import java.io.InputStreamReader; import java.util.Arrays; import java.util.stream.Collectors; diff --git a/ranger-zk-client/src/test/java/com/flipkart/ranger/client/zk/ShardedZKRangerClientTest.java b/ranger-zk-client/src/test/java/com/flipkart/ranger/client/zk/ShardedZKRangerClientTest.java index d7b2287b..579bf905 100644 --- a/ranger-zk-client/src/test/java/com/flipkart/ranger/client/zk/ShardedZKRangerClientTest.java +++ b/ranger-zk-client/src/test/java/com/flipkart/ranger/client/zk/ShardedZKRangerClientTest.java @@ -15,7 +15,6 @@ */ package com.flipkart.ranger.client.zk; -import com.flipkart.ranger.core.model.ServiceNode; import com.flipkart.ranger.core.units.TestNodeData; import com.flipkart.ranger.core.utils.RangerTestUtils; import com.flipkart.ranger.core.utils.TestUtils; @@ -24,8 +23,6 @@ import org.junit.Assert; import org.junit.Test; -import java.util.Optional; - @Slf4j public class ShardedZKRangerClientTest extends BaseRangerZKClientTest { diff --git a/ranger-zk-client/src/test/java/com/flipkart/ranger/client/zk/SimpleRangerZKClientTest.java b/ranger-zk-client/src/test/java/com/flipkart/ranger/client/zk/SimpleRangerZKClientTest.java index 8ecd4c1b..5110fb6d 100644 --- a/ranger-zk-client/src/test/java/com/flipkart/ranger/client/zk/SimpleRangerZKClientTest.java +++ b/ranger-zk-client/src/test/java/com/flipkart/ranger/client/zk/SimpleRangerZKClientTest.java @@ -15,14 +15,11 @@ */ package com.flipkart.ranger.client.zk; -import com.flipkart.ranger.core.model.ServiceNode; import com.flipkart.ranger.core.units.TestNodeData; import lombok.val; import org.junit.Assert; import org.junit.Test; -import java.util.Optional; - public class SimpleRangerZKClientTest extends BaseRangerZKClientTest { @Test diff --git a/ranger-zk-client/src/test/java/com/flipkart/ranger/client/zk/UnshardedZKRangerClientTest.java b/ranger-zk-client/src/test/java/com/flipkart/ranger/client/zk/UnshardedZKRangerClientTest.java index 92c7c740..4f3a048f 100644 --- a/ranger-zk-client/src/test/java/com/flipkart/ranger/client/zk/UnshardedZKRangerClientTest.java +++ b/ranger-zk-client/src/test/java/com/flipkart/ranger/client/zk/UnshardedZKRangerClientTest.java @@ -15,7 +15,6 @@ */ package com.flipkart.ranger.client.zk; -import com.flipkart.ranger.core.model.ServiceNode; import com.flipkart.ranger.core.units.TestNodeData; import com.flipkart.ranger.core.utils.RangerTestUtils; import com.flipkart.ranger.core.utils.TestUtils; @@ -24,8 +23,6 @@ import org.junit.Assert; import org.junit.Test; -import java.util.Optional; - @Slf4j public class UnshardedZKRangerClientTest extends BaseRangerZKClientTest { diff --git a/ranger-zookeeper/src/test/java/com/flipkart/ranger/zookeeper/model/ServiceProviderExtCuratorTest.java b/ranger-zookeeper/src/test/java/com/flipkart/ranger/zookeeper/model/ServiceProviderExtCuratorTest.java index ea92e3b8..97e3fe59 100644 --- a/ranger-zookeeper/src/test/java/com/flipkart/ranger/zookeeper/model/ServiceProviderExtCuratorTest.java +++ b/ranger-zookeeper/src/test/java/com/flipkart/ranger/zookeeper/model/ServiceProviderExtCuratorTest.java @@ -29,7 +29,6 @@ import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import lombok.val; -import lombok.var; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.retry.ExponentialBackoffRetry; diff --git a/ranger-zookeeper/src/test/java/com/flipkart/ranger/zookeeper/model/ServiceProviderTest.java b/ranger-zookeeper/src/test/java/com/flipkart/ranger/zookeeper/model/ServiceProviderTest.java index 53c3a58c..1d1e15e4 100644 --- a/ranger-zookeeper/src/test/java/com/flipkart/ranger/zookeeper/model/ServiceProviderTest.java +++ b/ranger-zookeeper/src/test/java/com/flipkart/ranger/zookeeper/model/ServiceProviderTest.java @@ -31,7 +31,6 @@ import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import lombok.val; -import lombok.var; import org.apache.curator.test.TestingCluster; import org.junit.After; import org.junit.Assert; diff --git a/ranger-zookeeper/src/test/java/com/flipkart/ranger/zookeeper/model/SimpleServiceProviderTest.java b/ranger-zookeeper/src/test/java/com/flipkart/ranger/zookeeper/model/SimpleServiceProviderTest.java index 6e68fe8a..df41f08d 100644 --- a/ranger-zookeeper/src/test/java/com/flipkart/ranger/zookeeper/model/SimpleServiceProviderTest.java +++ b/ranger-zookeeper/src/test/java/com/flipkart/ranger/zookeeper/model/SimpleServiceProviderTest.java @@ -24,7 +24,6 @@ import com.flipkart.ranger.zookeeper.ServiceFinderBuilders; import com.flipkart.ranger.zookeeper.ServiceProviderBuilders; import com.google.common.collect.HashMultiset; -import com.google.common.collect.Multiset; import lombok.val; import org.apache.curator.test.TestingCluster; import org.junit.After;