From 112c3220f108b98353f37e670e7b398ef54f6043 Mon Sep 17 00:00:00 2001 From: Blake Willoughby Date: Fri, 1 Jan 2021 02:45:33 -0700 Subject: [PATCH] Remove camelCase from ApiKey (#85) * fix(apikey): remove camel case from apikey * fix(apikey): remove camel case from apikey Co-authored-by: bwilloughby --- data-api/java-websocket/pom.xml | 10 +++++----- .../io/coinapi/websocket/CoinAPIWebSocketImpl.java | 9 +++++---- .../main/java/io/coinapi/websocket/model/Hello.java | 10 +++++----- .../java-websocket/src/test/java/CoinAPISDKTest.java | 6 +++--- .../src/test/java/MessageInjectableCoinAPISDKTest.java | 6 +++--- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/data-api/java-websocket/pom.xml b/data-api/java-websocket/pom.xml index d72ba498a4..bafdd43eea 100644 --- a/data-api/java-websocket/pom.xml +++ b/data-api/java-websocket/pom.xml @@ -191,19 +191,19 @@ 1.9.3 - javax.websocket - javax.websocket-client-api - 1.1 + jakarta.websocket + jakarta.websocket-api + 2.0.0 org.glassfish.tyrus.ext tyrus-client-java8 - 1.17 + 2.0.0 org.glassfish.tyrus tyrus-container-grizzly-client - 1.17 + 2.0.0 junit diff --git a/data-api/java-websocket/src/main/java/io/coinapi/websocket/CoinAPIWebSocketImpl.java b/data-api/java-websocket/src/main/java/io/coinapi/websocket/CoinAPIWebSocketImpl.java index c8bfc3b59f..30675d5e19 100644 --- a/data-api/java-websocket/src/main/java/io/coinapi/websocket/CoinAPIWebSocketImpl.java +++ b/data-api/java-websocket/src/main/java/io/coinapi/websocket/CoinAPIWebSocketImpl.java @@ -7,7 +7,7 @@ import io.coinapi.websocket.model.Error; import org.glassfish.tyrus.client.ClientManager; -import javax.websocket.*; +import jakarta.websocket.*; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -113,8 +113,7 @@ public void sendHelloMessage(Hello hello) throws IOException { final ClientEndpointConfig cec = ClientEndpointConfig.Builder.create().build(); - connection = Optional.ofNullable(client.connectToServer(new Endpoint() { - + Endpoint endpoint = new Endpoint() { @Override public void onOpen(Session session, EndpointConfig config) { try { @@ -136,7 +135,9 @@ public void onMessage(String message) { public void onClose(Session session, CloseReason closeReason) { super.onClose(session, closeReason); } - }, cec, new URI(isSandbox ? sandboxUrl : noSandboxUrl))); + }; + + connection = Optional.ofNullable(client.connectToServer(endpoint, cec, new URI(isSandbox ? sandboxUrl : noSandboxUrl))); latch.await(100, TimeUnit.SECONDS); } catch (Exception e) { e.printStackTrace(); diff --git a/data-api/java-websocket/src/main/java/io/coinapi/websocket/model/Hello.java b/data-api/java-websocket/src/main/java/io/coinapi/websocket/model/Hello.java index 8770a4fde6..99c9c42f28 100644 --- a/data-api/java-websocket/src/main/java/io/coinapi/websocket/model/Hello.java +++ b/data-api/java-websocket/src/main/java/io/coinapi/websocket/model/Hello.java @@ -7,7 +7,7 @@ public class Hello { private String type = "hello"; - private String apiKey; + private String apikey; private Boolean heartbeat = true; private String[] subscribeDataType; private String[] subscribeFilterSymbolId; @@ -21,8 +21,8 @@ public String getType() { return type; } - public String getApiKey() { - return apiKey; + public String getApikey() { + return apikey; } public Boolean getHeartbeat() { @@ -64,8 +64,8 @@ public Integer getSubscribeUpdateLimitMsBookSnapshot() { return subscribeUpdateLimitMsBookSnapshot; } - public void setApiKey(String apiKey) { - this.apiKey = apiKey; + public void setApikey(String apikey) { + this.apikey = apikey; } public void setHeartbeat(Boolean heartbeat) { diff --git a/data-api/java-websocket/src/test/java/CoinAPISDKTest.java b/data-api/java-websocket/src/test/java/CoinAPISDKTest.java index 807755b6b4..f456f7230a 100644 --- a/data-api/java-websocket/src/test/java/CoinAPISDKTest.java +++ b/data-api/java-websocket/src/test/java/CoinAPISDKTest.java @@ -7,19 +7,19 @@ public abstract class CoinAPISDKTest { - protected String apiKey; + protected String apikey; protected CoinAPIWebSocket coinAPIWebSocket; @Before public void configuration() throws IOException { Config config = new Config(); - apiKey = config.getPropValues("coinapi_key"); + apikey = config.getPropValues("coinapi_key"); coinAPIWebSocket = new CoinAPIWebSocketImpl(true); } public Hello createHello(String type) { Hello hello = new Hello(); - hello.setApiKey(apiKey); + hello.setApikey(apikey); hello.setSubscribeDataType(new String[]{type}); return hello; } diff --git a/data-api/java-websocket/src/test/java/MessageInjectableCoinAPISDKTest.java b/data-api/java-websocket/src/test/java/MessageInjectableCoinAPISDKTest.java index 728bae9255..8a028eb31a 100644 --- a/data-api/java-websocket/src/test/java/MessageInjectableCoinAPISDKTest.java +++ b/data-api/java-websocket/src/test/java/MessageInjectableCoinAPISDKTest.java @@ -8,14 +8,14 @@ import java.util.concurrent.LinkedBlockingDeque; public abstract class MessageInjectableCoinAPISDKTest { - protected String apiKey; + protected String apikey; protected CoinAPIWebSocketImpl coinAPIWebSocket; protected Queue messagesQueue; @Before public void configuration() throws IOException, NoSuchFieldException, IllegalAccessException { Config config = new Config(); - apiKey = config.getPropValues("coinapi_key"); + apikey = config.getPropValues("coinapi_key"); //make private messagesQueue variable accessible for injecting messages during testing Field messagesQueueField = CoinAPIWebSocketImpl.class.getDeclaredField("messagesQueue"); @@ -32,7 +32,7 @@ public void configuration() throws IOException, NoSuchFieldException, IllegalAcc public Hello createHello(String type) { Hello hello = new Hello(); - hello.setApiKey(apiKey); + hello.setApikey(apikey); hello.setSubscribeDataType(new String[]{type}); return hello; }