Skip to content

Commit

Permalink
formatting feedback, java7 (bunq#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
tubbynl committed Jun 19, 2018
1 parent 6b90696 commit 30d43ee
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
14 changes: 7 additions & 7 deletions src/main/java/com/bunq/sdk/http/BunqHeader.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ public enum BunqHeader {
clientEncryptionKey("X-Bunq-Client-Encryption-Key"),
clientRequestId("X-Bunq-Client-Request-Id"),
clientSignature("X-Bunq-Client-Signature"),
clientResponseId("X-Bunq-Client-Response-Id","Could not determine response id."),
geolocation("X-Bunq-Geolocation","0 0 0 0 000"),
language("X-Bunq-Language","en_US"),
region("X-Bunq-Region","nl_NL"),
clientResponseId("X-Bunq-Client-Response-Id", "Could not determine response id."),
geolocation("X-Bunq-Geolocation", "0 0 0 0 000"),
language("X-Bunq-Language", "en_US"),
region("X-Bunq-Region", "nl_NL"),
serverSignature("X-Bunq-Server-Signature"),
userAgent("User-Agent","bunq-sdk-java/0.13.1");
userAgent("User-Agent", "bunq-sdk-java/0.13.1");

private static final String PREFIX = "X-Bunq-";

Expand Down Expand Up @@ -77,8 +77,8 @@ public boolean isBunq() {
}

private String findKey(Collection<String> keys) {
for(String key:keys) {
if(this.equals(key)) {
for (String key:keys) {
if (this.equals(key)) {
return key;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/bunq/sdk/http/BunqRequestBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private void addToAllHeader(String name,String value) {
*/
@Override
public BunqRequestBuilder header(String name, String value) {
addToAllHeader(name,value);
addToAllHeader(name, value);

return (BunqRequestBuilder) super.header(name, value);
}
Expand All @@ -98,7 +98,7 @@ public BunqRequestBuilder header(String name, String value) {
*/
@Override
public BunqRequestBuilder addHeader(String name, String value) {
addToAllHeader(name,value);
addToAllHeader(name, value);

return (BunqRequestBuilder) super.addHeader(name, value);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/bunq/sdk/security/SecurityUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,9 @@ public static void validateResponseSignature(
response.headers()
);
Signature signature = getSignatureInstance();
BunqBasicHeader headerServerSignature = BunqBasicHeader.get(BunqHeader.serverSignature,response);
BunqBasicHeader serverSignature = BunqBasicHeader.get(BunqHeader.serverSignature,response);

byte[] serverSignatureBase64Bytes = headerServerSignature.getValue().getBytes();
byte[] serverSignatureBase64Bytes = serverSignature.getValue().getBytes();
byte[] serverSignatureDecoded = Base64.getDecoder().decode(serverSignatureBase64Bytes);
verifyDataSigned(signature, keyPublicServer, responseBytes, serverSignatureDecoded);
}
Expand Down
2 changes: 0 additions & 2 deletions src/test/java/com/bunq/sdk/http/BunqHeaderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import org.junit.Test;

import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static org.junit.Assert.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
Expand Down Expand Up @@ -37,11 +38,12 @@ private static byte[] getRequestBytes() {
}

private static String uploadFileAndGetUuid() {
HashMap<String, String> customHeaders = new HashMap<>();
BunqHeader.contentType.addTo(customHeaders,CONTENT_TYPE);
BunqHeader.attachmentDescription.addTo(customHeaders,ATTACHMENT_DESCRIPTION);
byte[] RequestBytes = getRequestBytes();
return AttachmentPublic.create(customHeaders, RequestBytes).getValue();
Map<String, String> customHeaders = new HashMap<>();

BunqHeader.contentType.addTo(customHeaders, CONTENT_TYPE);
BunqHeader.attachmentDescription.addTo(customHeaders, ATTACHMENT_DESCRIPTION);

return AttachmentPublic.create(customHeaders, getRequestBytes()).getValue();
}

/**
Expand Down

0 comments on commit 30d43ee

Please sign in to comment.