-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unite test coverage
- Loading branch information
Showing
14 changed files
with
68 additions
and
50 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
5 changes: 2 additions & 3 deletions
5
...adapter/local/BouncyCastleKeyDecrypter.kt → .../adapter/java/JavaSecurityKeyDecrypter.kt
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: 2 additions & 2 deletions
4
...adapter/local/BouncyCastleKeyGenerator.kt → .../adapter/java/JavaSecurityKeyGenerator.kt
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
2 changes: 1 addition & 1 deletion
2
...r/server/keys/adapter/local/KeyInitJob.kt → ...or/server/keys/adapter/java/KeyInitJob.kt
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
33 changes: 33 additions & 0 deletions
33
src/test/kotlin/com/vauthenticator/server/keys/adapter/java/JavaSecurityKeyDecrypterTest.kt
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,33 @@ | ||
package com.vauthenticator.server.keys.adapter.java | ||
|
||
import com.vauthenticator.server.extentions.encoder | ||
import com.vauthenticator.server.keys.domain.MasterKid | ||
import io.mockk.every | ||
import io.mockk.impl.annotations.MockK | ||
import io.mockk.junit5.MockKExtension | ||
import org.junit.jupiter.api.Assertions | ||
import org.junit.jupiter.api.Test | ||
import org.junit.jupiter.api.extension.ExtendWith | ||
|
||
@ExtendWith(MockKExtension::class) | ||
class JavaSecurityKeyDecrypterTest { | ||
|
||
@MockK | ||
lateinit var keyCryptographicOperations: KeyCryptographicOperations | ||
|
||
@Test | ||
fun `happy path`() { | ||
val encrypted = "AN_ENCRYPTED_VALUE" | ||
val decrypted = "AN_UNENCRYPTED_VALUE".toByteArray() | ||
val maserKid = "A_MASTER_KEY" | ||
|
||
val uut = JavaSecurityKeyDecrypter(maserKid, keyCryptographicOperations) | ||
|
||
every { keyCryptographicOperations.decryptKeyWith(MasterKid(maserKid), encrypted.toByteArray()) } returns decrypted | ||
|
||
val actual = uut.decryptKey(encrypted) | ||
val expected = encoder.encode(decrypted).decodeToString() | ||
|
||
Assertions.assertEquals(expected, actual) | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/test/kotlin/com/vauthenticator/server/keys/adapter/java/JavaSecurityKeyGeneratorTest.kt
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,4 @@ | ||
package com.vauthenticator.server.keys.adapter.java | ||
|
||
//todo | ||
class JavaSecurityKeyGeneratorTest |
4 changes: 4 additions & 0 deletions
4
...test/kotlin/com/vauthenticator/server/keys/adapter/java/KeyCryptographicOperationsTest.kt
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,4 @@ | ||
package com.vauthenticator.server.keys.adapter.java | ||
|
||
//todo | ||
class KeyCryptographicOperationsTest |
4 changes: 4 additions & 0 deletions
4
...kotlin/com/vauthenticator/server/keys/adapter/java/KeyGeneratorMasterKeyRepositoryTest.kt
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,4 @@ | ||
package com.vauthenticator.server.keys.adapter.java | ||
|
||
//todo | ||
class KeyGeneratorMasterKeyRepositoryTest |
8 changes: 0 additions & 8 deletions
8
src/test/kotlin/com/vauthenticator/server/keys/adapter/local/BouncyCastleKeyDecrypterTest.kt
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
...uthenticator/server/keys/adapter/local/BouncyCastleKeyGeneratorMasterKeyRepositoryTest.kt
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
src/test/kotlin/com/vauthenticator/server/keys/adapter/local/BouncyCastleKeyGeneratorTest.kt
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
...est/kotlin/com/vauthenticator/server/keys/adapter/local/KeyCryptographicOperationsTest.kt
This file was deleted.
Oops, something went wrong.