From 6dfe29a3fd240cdb935e3048b2734c13663f3edd Mon Sep 17 00:00:00 2001 From: ZP-AlwaysWin Date: Thu, 22 Aug 2019 10:47:52 +0800 Subject: [PATCH] fix java code style --- .../src/main/java/io/k8s/cassandra/GoInterface.java | 10 +++++----- .../io/k8s/cassandra/KubernetesSeedProviderTest.java | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cassandra/java/src/main/java/io/k8s/cassandra/GoInterface.java b/cassandra/java/src/main/java/io/k8s/cassandra/GoInterface.java index 17d9b4e08..a062ad1f6 100644 --- a/cassandra/java/src/main/java/io/k8s/cassandra/GoInterface.java +++ b/cassandra/java/src/main/java/io/k8s/cassandra/GoInterface.java @@ -25,9 +25,9 @@ import com.sun.jna.Structure; public interface GoInterface extends Library { - public String GetEndpoints(String namespace, String service, String seeds); + String GetEndpoints(String namespace, String service, String seeds); - public class GoSlice extends Structure { + class GoSlice extends Structure { public static class ByValue extends GoSlice implements Structure.ByValue { } @@ -36,11 +36,11 @@ public static class ByValue extends GoSlice implements Structure.ByValue { public long cap; protected List getFieldOrder() { - return Arrays.asList(new String[] { "data", "len", "cap" }); + return Arrays.asList("data", "len", "cap" ); } } - public class GoString extends Structure { + class GoString extends Structure { public static class ByValue extends GoString implements Structure.ByValue { } @@ -48,7 +48,7 @@ public static class ByValue extends GoString implements Structure.ByValue { public long n; protected List getFieldOrder() { - return Arrays.asList(new String[] { "p", "n" }); + return Arrays.asList("p", "n" ); } } } \ No newline at end of file diff --git a/cassandra/java/src/test/java/io/k8s/cassandra/KubernetesSeedProviderTest.java b/cassandra/java/src/test/java/io/k8s/cassandra/KubernetesSeedProviderTest.java index 2ef3c3135..d719e2728 100644 --- a/cassandra/java/src/test/java/io/k8s/cassandra/KubernetesSeedProviderTest.java +++ b/cassandra/java/src/test/java/io/k8s/cassandra/KubernetesSeedProviderTest.java @@ -20,8 +20,10 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; import java.net.InetAddress; +import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -36,12 +38,12 @@ public class KubernetesSeedProviderTest { private static final Logger logger = LoggerFactory.getLogger(KubernetesSeedProviderTest.class); @Test - @Ignore("has to be run inside of a kube cluster") + @Ignore("has to be run inside of a kubernetes cluster") public void getSeeds() throws Exception { SeedProvider provider = new KubernetesSeedProvider(new HashMap()); List seeds = provider.getSeeds(); - assertThat(seeds, is(not(empty()))); + assertThat(seeds, not(empty())); } } \ No newline at end of file