Skip to content

Commit

Permalink
supdev 26OUm5kk - Add CVV to logging post test; Remove unnesasary 'if…
Browse files Browse the repository at this point in the history
…' clause; Add exception message to error logging test;
  • Loading branch information
braintreeps committed Feb 26, 2016
1 parent e566477 commit 2c7fdcb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/braintreegateway/util/Http.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private NodeWrapper httpRequest(RequestMethod requestMethod, String url, String
connection = buildConnection(requestMethod, url);

Logger logger = configuration.getLogger();
if (logger.getLevel().intValue() <= Level.FINE.intValue() && postBody != null) {
if (postBody != null) {
logger.log(Level.FINE, formatSanitizeBodyForLog(postBody));
}

Expand Down Expand Up @@ -126,7 +126,7 @@ private NodeWrapper httpRequest(RequestMethod requestMethod, String url, String
logger.log(Level.INFO, "[Braintree] [{0}]] {1} {2}", new Object[] { getCurrentTime(), requestMethod.toString(), url });
logger.log(Level.FINE, "[Braintree] [{0}] {1} {2} {3}", new Object[] { getCurrentTime(), requestMethod.toString(), url, connection.getResponseCode() });

if (logger.getLevel().intValue() <= Level.FINE.intValue() && xml != null) {
if (xml != null) {
logger.log(Level.FINE, formatSanitizeBodyForLog(xml));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public void smokeTestLogsFullRequestInDebugMode() {
assertTrue(capturedLog.contains("POST /merchants/integration_merchant_id/payment_methods"));
assertTrue(capturedLog.contains("<cardholder-name>John Doe</cardholder-name>"));
assertTrue(capturedLog.contains("<number>510510******5100</number>"));
assertTrue(capturedLog.contains("<cvv>***</cvv>"));
}

@Test
Expand All @@ -143,7 +144,7 @@ public void smokeTestLogsErrors() {
} catch (UnexpectedException e) {
} finally {
capturedLog = getTestCapturedLog();
assertTrue(capturedLog.contains("SEVERE: SSL Verification failed. Error message:"));
assertTrue(capturedLog.contains("SEVERE: SSL Verification failed. Error message: Missing input stream"));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public class MerchantIT extends IntegrationTest {
@Before
public void createGateway() {
this.gateway = new BraintreeGateway(
"client_id$development$integration_client_id",
"client_secret$development$integration_client_secret"
"client_id$development$integration_client_id",
"client_secret$development$integration_client_secret"
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import static org.junit.Assert.*;

public class WebhookNotificationIT extends IntegrationTest{
public class WebhookNotificationIT extends IntegrationTest {

@Test
public void createNotificationWithUnrecognizedKind() {
Expand Down

0 comments on commit 2c7fdcb

Please sign in to comment.