Skip to content

Commit b5ed4da

Browse files
committed
set sdjwt doc type
1 parent 3f7194b commit b5ed4da

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

wallet-core/src/main/java/eu/europa/ec/eudi/wallet/issue/openid4vci/DefaultOffer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ internal val CredentialConfiguration.name: String
6262
internal val CredentialConfiguration.docType: String
6363
@JvmSynthetic get() = when (this) {
6464
is MsoMdocCredential -> docType
65-
is SdJwtVcCredential -> docType
65+
is SdJwtVcCredential -> "eu.europa.ec.eudi.pid_jwt_vc_json"
6666
else -> "unknown"
6767
}

wallet-core/src/test/java/eu/europa/ec/eudi/wallet/issue/openid4vci/CredentialConfigurationFilterTest.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import io.mockk.every
2929
import io.mockk.mockk
3030
import org.junit.Assert.assertFalse
3131
import org.junit.Assert.assertTrue
32-
import org.junit.Test
32+
import org.junit.jupiter.api.Test
3333

3434
class CredentialConfigurationFilterTest {
3535

@@ -99,6 +99,16 @@ class CredentialConfigurationFilterTest {
9999
assertTrue(DocTypeFilter(docType).invoke(credentialConfiguration))
100100
}
101101

102+
103+
@Test
104+
fun `DocTypeFilterFactory returns true for matching docType 2`() {
105+
val docType = "testDocType"
106+
val credentialConfiguration = mockk<MsoMdocCredential>(relaxed = true)
107+
every { credentialConfiguration.docType } returns docType
108+
109+
assertTrue(DocTypeFilter(docType).invoke(credentialConfiguration))
110+
}
111+
102112
@Test
103113
fun `DocTypeFilterFactory returns false for non-matching docType`() {
104114
val docType = "testDocType"

0 commit comments

Comments
 (0)