Skip to content

Commit

Permalink
Remove camelCase from ApiKey (#85)
Browse files Browse the repository at this point in the history
* fix(apikey): remove camel case from apikey

* fix(apikey): remove camel case from apikey

Co-authored-by: bwilloughby <bwilloughby@demark.com>
  • Loading branch information
byblakeorriver and byblakeorriver committed Jan 1, 2021
1 parent e9eddf6 commit 1c1d994
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
10 changes: 5 additions & 5 deletions data-api/java-websocket/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -191,19 +191,19 @@
<version>1.9.3</version>
</dependency>
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-client-api</artifactId>
<version>1.1</version>
<groupId>jakarta.websocket</groupId>
<artifactId>jakarta.websocket-api</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.tyrus.ext</groupId>
<artifactId>tyrus-client-java8</artifactId>
<version>1.17</version>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-container-grizzly-client</artifactId>
<version>1.17</version>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -21,8 +21,8 @@ public String getType() {
return type;
}

public String getApiKey() {
return apiKey;
public String getApikey() {
return apikey;
}

public Boolean getHeartbeat() {
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions data-api/java-websocket/src/test/java/CoinAPISDKTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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;
}
Expand Down

0 comments on commit 1c1d994

Please sign in to comment.