-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4afccde
commit fcaf479
Showing
10 changed files
with
78 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...in/java/com/mastercard/developer/interceptors/OkHttp2FieldLevelEncryptionInterceptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/test/java/com/mastercard/developer/utils/HttpHelpers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.mastercard.developer.utils; | ||
|
||
import feign.Request; | ||
import feign.Response; | ||
|
||
import java.nio.charset.StandardCharsets; | ||
import java.util.Collection; | ||
import java.util.HashMap; | ||
|
||
public class HttpHelpers { | ||
|
||
public static Response buildResponse(String payload) { | ||
Response response = Response.builder() | ||
.status(200) | ||
.headers(new HashMap<String, Collection<String>>()) | ||
.body(payload, StandardCharsets.UTF_8) | ||
.request(buildDummyRequest(payload)) | ||
.build(); | ||
return response; | ||
} | ||
|
||
public static Response buildResponse(String payload, HashMap<String, Collection<String>> headers) { | ||
Response response = Response.builder() | ||
.status(200) | ||
.headers(headers) | ||
.body(payload, StandardCharsets.UTF_8) | ||
.request(buildDummyRequest(payload)) | ||
.build(); | ||
return response; | ||
} | ||
public static Request buildDummyRequest(String payload) { | ||
return Request.create(Request.HttpMethod.GET, "http://example.com", new HashMap<>(), payload.getBytes(),StandardCharsets.UTF_8); | ||
} | ||
} | ||
|