[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] 01/02: fix test
From: |
gnunet |
Subject: |
[libeufin] 01/02: fix test |
Date: |
Mon, 20 Apr 2020 21:24:43 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository libeufin.
commit 3eb59a3e6e9505fd6786310dd4e6eb5810ae7091
Author: Marcello Stanisci <address@hidden>
AuthorDate: Fri Apr 17 17:18:19 2020 +0200
fix test
---
nexus/src/test/kotlin/authentication.kt | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/nexus/src/test/kotlin/authentication.kt
b/nexus/src/test/kotlin/authentication.kt
index 60a88e3..e4dd3da 100644
--- a/nexus/src/test/kotlin/authentication.kt
+++ b/nexus/src/test/kotlin/authentication.kt
@@ -5,18 +5,14 @@ import org.jetbrains.exposed.sql.Database
import org.jetbrains.exposed.sql.SchemaUtils
import org.jetbrains.exposed.sql.and
import org.jetbrains.exposed.sql.transactions.transaction
-import org.junit.Before
import org.junit.Test
import tech.libeufin.util.CryptoUtil
-import tech.libeufin.util.toByteArray
-import tech.libeufin.util.toHexString
-import java.sql.Blob
import javax.sql.rowset.serial.SerialBlob
class AuthenticationTest {
- @Before
- fun connectAndMakeTables() {
+ @Test
+ fun dbInvolvingTest() {
Database.connect("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", driver =
"org.h2.Driver")
transaction {
SchemaUtils.create(EbicsSubscribersTable)
@@ -32,10 +28,6 @@ class AuthenticationTest {
encryptionPrivateKey =
SerialBlob("encryptionPrivateKey".toByteArray())
}
}
- }
-
- @Test
- fun manualMethod() {
// base64 of "username:password" == "dXNlcm5hbWU6cGFzc3dvcmQ="
val (username: String, hashedPass: ByteArray) =
extractUserAndHashedPassword("Basic dXNlcm5hbWU6cGFzc3dvcmQ=")
val result = transaction {
@@ -47,7 +39,7 @@ class AuthenticationTest {
}
@Test
- fun testExtractor() {
+ fun basicAuthHeaderTest() {
val (username: String, hashedPass: ByteArray) =
extractUserAndHashedPassword("Basic dXNlcm5hbWU6cGFzc3dvcmQ=")
assert(CryptoUtil.hashStringSHA256("password").contentEquals(hashedPass))
}
--
To stop receiving notification emails like this one, please contact
address@hidden.