-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔒 : encrypt Azure & Google credentials
- Loading branch information
Showing
4 changed files
with
143 additions
and
32 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
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,27 @@ | ||
package io.gaia_app.credentials | ||
|
||
import org.assertj.core.api.Assertions.assertThat | ||
import org.junit.jupiter.api.Test | ||
|
||
import org.junit.jupiter.api.Assertions.* | ||
|
||
internal class CredentialsTest { | ||
|
||
@Test | ||
fun `toEnv() for AWSCredentials should return AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY`() { | ||
assertThat(AWSCredentials("access", "secret").toEnv()) | ||
.containsExactly("AWS_ACCESS_KEY_ID=access", "AWS_SECRET_ACCESS_KEY=secret") | ||
} | ||
|
||
@Test | ||
fun `toEnv() for AzureRMCredentials should return ARM_CLIENT_ID and ARM_CLIENT_SECRET`() { | ||
assertThat(AzureRMCredentials("clientId", "secret").toEnv()) | ||
.containsExactly("ARM_CLIENT_ID=clientId", "ARM_CLIENT_SECRET=secret") | ||
} | ||
|
||
@Test | ||
fun `toEnv() for GoogleCredentials should return GOOGLE_CREDENTIALS`() { | ||
assertThat(GoogleCredentials("jsonContent").toEnv()) | ||
.containsExactly("GOOGLE_CREDENTIALS=jsonContent") | ||
} | ||
} |