This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from Nike-Inc/feature/add_client_version_heade…
…r_to_all_calls Add client version header to all HTTP calls
- Loading branch information
Showing
4 changed files
with
48 additions
and
6 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
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
29 changes: 29 additions & 0 deletions
29
src/test/java/com/nike/cerberus/client/DefaultCerberusClientFactoryTest.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,29 @@ | ||
package com.nike.cerberus.client; | ||
|
||
import com.nike.vault.client.VaultClient; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
/** | ||
* Tests the DefaultCerberusClientFactory class | ||
*/ | ||
public class DefaultCerberusClientFactoryTest { | ||
|
||
@Test | ||
public void test_that_getClient_adds_client_version_as_a_default_header() { | ||
VaultClient result = DefaultCerberusClientFactory.getClient(); | ||
assertEquals( | ||
ClientVersion.getClientHeaderValue(), | ||
result.getDefaultHeaders().get(ClientVersion.CERBERUS_CLIENT_HEADER)); | ||
} | ||
|
||
@Test | ||
public void test_that_getClientForLambda_adds_client_version_as_a_default_header() { | ||
VaultClient result = DefaultCerberusClientFactory.getClientForLambda("arn:aws:lambda:us-west-2:000000000000:function:name:qualifier"); | ||
assertEquals( | ||
ClientVersion.getClientHeaderValue(), | ||
result.getDefaultHeaders().get(ClientVersion.CERBERUS_CLIENT_HEADER)); | ||
} | ||
|
||
} |