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 70563099..cb00c712 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 @@ -27,15 +27,15 @@ public class RoundRobinServiceNodeSelectorTest { @Test public void testRandomNodeSelector(){ final RoundRobinServiceNodeSelector roundRobinSelector = new RoundRobinServiceNodeSelector(); - List> serviceNodes = Lists.newArrayList(); + final List> serviceNodes = Lists.newArrayList(); serviceNodes.add(new ServiceNode<>("localhost-1", 9000, TestNodeData.builder().nodeId(1).build())); serviceNodes.add(new ServiceNode<>("localhost-2", 9001, TestNodeData.builder().nodeId(2).build())); serviceNodes.add(new ServiceNode<>("localhost-3", 9002, TestNodeData.builder().nodeId(3).build())); ServiceNode select = roundRobinSelector.select(serviceNodes); - Assert.assertTrue(select.getHost().equalsIgnoreCase("localhost-2")); + Assert.assertEquals("localhost-2", select.getHost()); select = roundRobinSelector.select(serviceNodes); - Assert.assertTrue(select.getHost().equalsIgnoreCase("localhost-3")); + Assert.assertEquals("localhost-3", select.getHost()); select = roundRobinSelector.select(serviceNodes); - Assert.assertTrue(select.getHost().equalsIgnoreCase("localhost-1")); + Assert.assertEquals("localhost-1", select.getHost()); } } diff --git a/ranger-core/src/test/java/com/flipkart/ranger/core/finder/shardselector/ListShardSelectorTest.java b/ranger-core/src/test/java/com/flipkart/ranger/core/finder/shardselector/ListShardSelectorTest.java index 1f747c24..614c493b 100644 --- a/ranger-core/src/test/java/com/flipkart/ranger/core/finder/shardselector/ListShardSelectorTest.java +++ b/ranger-core/src/test/java/com/flipkart/ranger/core/finder/shardselector/ListShardSelectorTest.java @@ -30,7 +30,7 @@ public class ListShardSelectorTest { @Test public void testNoOpShardSelector(){ - final ListBasedServiceRegistry serviceRegistry = RegistryTestUtils.getUnshardedRegistry(); + final ListBasedServiceRegistry serviceRegistry = RegistryTestUtils.getUnshardedRegistry(); final ListShardSelector> shardSelector = new ListShardSelector<>(); final List> nodes = shardSelector.nodes(CriteriaUtils.getCriteria(1), serviceRegistry); Assert.assertFalse(nodes.isEmpty()); diff --git a/ranger-http/src/main/java/com/flipkart/ranger/http/common/HttpNodeDataStoreConnector.java b/ranger-http/src/main/java/com/flipkart/ranger/http/common/HttpNodeDataStoreConnector.java index 4cb3bd7e..bbaf51a3 100644 --- a/ranger-http/src/main/java/com/flipkart/ranger/http/common/HttpNodeDataStoreConnector.java +++ b/ranger-http/src/main/java/com/flipkart/ranger/http/common/HttpNodeDataStoreConnector.java @@ -48,7 +48,7 @@ public HttpNodeDataStoreConnector( .connectionPool(new ConnectionPool(1, 30, TimeUnit.SECONDS)) .build(); this.config = config; - this.mapper = null != mapper ? mapper : new ObjectMapper(); + this.mapper = mapper; } diff --git a/ranger-http/src/test/java/com/flipkart/ranger/http/common/HttpNodeDataStoreConnectorTest.java b/ranger-http/src/test/java/com/flipkart/ranger/http/common/HttpNodeDataStoreConnectorTest.java index caf6d5fc..71e2916e 100644 --- a/ranger-http/src/test/java/com/flipkart/ranger/http/common/HttpNodeDataStoreConnectorTest.java +++ b/ranger-http/src/test/java/com/flipkart/ranger/http/common/HttpNodeDataStoreConnectorTest.java @@ -1,4 +1,4 @@ -/** +/* * Copyright 2015 Flipkart Internet Pvt. Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,6 +16,7 @@ package com.flipkart.ranger.http.common; import com.fasterxml.jackson.databind.ObjectMapper; +import com.flipkart.ranger.core.units.TestNodeData; import com.flipkart.ranger.http.config.HttpClientConfig; import org.junit.Assert; import org.junit.Test; diff --git a/ranger-http/src/test/java/com/flipkart/ranger/http/config/HttpClientConfigTest.java b/ranger-http/src/test/java/com/flipkart/ranger/http/config/HttpClientConfigTest.java index 336fb925..b1b0f68f 100644 --- a/ranger-http/src/test/java/com/flipkart/ranger/http/config/HttpClientConfigTest.java +++ b/ranger-http/src/test/java/com/flipkart/ranger/http/config/HttpClientConfigTest.java @@ -1,4 +1,4 @@ -/** +/* * Copyright 2015 Flipkart Internet Pvt. Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ranger-http/src/test/java/com/flipkart/ranger/http/model/ServiceNodeResponseTest.java b/ranger-http/src/test/java/com/flipkart/ranger/http/model/ServiceNodeResponseTest.java index 8c1f6f40..c3887954 100644 --- a/ranger-http/src/test/java/com/flipkart/ranger/http/model/ServiceNodeResponseTest.java +++ b/ranger-http/src/test/java/com/flipkart/ranger/http/model/ServiceNodeResponseTest.java @@ -1,4 +1,4 @@ -/** +/* * Copyright 2015 Flipkart Internet Pvt. Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ranger-http/src/test/java/com/flipkart/ranger/http/model/ServiceRegistrationResponseTest.java b/ranger-http/src/test/java/com/flipkart/ranger/http/model/ServiceRegistrationResponseTest.java index 42025c66..9949a859 100644 --- a/ranger-http/src/test/java/com/flipkart/ranger/http/model/ServiceRegistrationResponseTest.java +++ b/ranger-http/src/test/java/com/flipkart/ranger/http/model/ServiceRegistrationResponseTest.java @@ -1,4 +1,4 @@ -/** +/* * Copyright 2015 Flipkart Internet Pvt. Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); 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 e01acac9..368c8549 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 @@ -1,4 +1,4 @@ -/** +/* * Copyright 2015 Flipkart Internet Pvt. Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ranger-http/src/test/java/com/flipkart/ranger/http/servicefinderhub/HttpServiceDataSourceTest.java b/ranger-http/src/test/java/com/flipkart/ranger/http/servicefinderhub/HttpServiceDataSourceTest.java index d5420f68..49a081a4 100644 --- a/ranger-http/src/test/java/com/flipkart/ranger/http/servicefinderhub/HttpServiceDataSourceTest.java +++ b/ranger-http/src/test/java/com/flipkart/ranger/http/servicefinderhub/HttpServiceDataSourceTest.java @@ -1,4 +1,4 @@ -/** +/* * Copyright 2015 Flipkart Internet Pvt. Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); 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 3c325024..16c48fce 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 @@ -1,4 +1,4 @@ -/** +/* * Copyright 2015 Flipkart Internet Pvt. Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -51,8 +51,8 @@ public TestNodeData(@JsonProperty("farmId") String farmId) { @Test public void testProvider() throws Exception { - TestNodeData nm5NodeData = TestNodeData.builder().farmId("nm5").build(); - ServiceNode testNode = new ServiceNode<>("localhost-1", 80, nm5NodeData); + val nm5NodeData = TestNodeData.builder().farmId("nm5").build(); + val testNode = new ServiceNode<>("localhost-1", 80, nm5NodeData); val response = MAPPER.writeValueAsBytes( ServiceRegistrationResponse.builder() .success(true) @@ -69,7 +69,7 @@ public void testProvider() throws Exception { .connectionTimeoutMs(30_000) .operationTimeoutMs(30_000) .build(); - ServiceProvider> serviceProvider = new HttpShardedServiceProviderBuilder() + val serviceProvider = new HttpShardedServiceProviderBuilder() .withNamespace("testns") .withServiceName("test") .withHostname("localhost-1")