From dd34629ba3d73013098da66b1784a3e1e30d2a2c Mon Sep 17 00:00:00 2001 From: KiruthikaJeyashankar Date: Tue, 5 Nov 2024 15:01:22 +0530 Subject: [PATCH] [INJIMOB-2160] add test for mdoc generator Signed-off-by: KiruthikaJeyashankar --- .../integration/mocks/MdocGeneratorTest.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 mock-certify-plugin/src/test/java/io/mosip/certify/mock/integration/mocks/MdocGeneratorTest.java diff --git a/mock-certify-plugin/src/test/java/io/mosip/certify/mock/integration/mocks/MdocGeneratorTest.java b/mock-certify-plugin/src/test/java/io/mosip/certify/mock/integration/mocks/MdocGeneratorTest.java new file mode 100644 index 0000000..3aa7a63 --- /dev/null +++ b/mock-certify-plugin/src/test/java/io/mosip/certify/mock/integration/mocks/MdocGeneratorTest.java @@ -0,0 +1,30 @@ +package io.mosip.certify.mock.integration.mocks; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import java.util.HashMap; +import java.util.Map; + + +public class MdocGeneratorTest { + @Test + void shouldGenerateMdocDataSuccessfully() { + Map data = new HashMap<>(); + data.put("family_name", "Mock"); + data.put("given_name", "User"); + data.put("birth_date", "2001-11-06"); + data.put("issuing_country", "MK"); + data.put("document_number", 1233); + data.put("driving_privileges", new HashMap<>() {{ + put("vehicle_category_code", "A"); + }}); + String generatedMdoc = new MdocGenerator().generate(data, + "did:jwk:eyJrdHkiOiJFQyIsInVzZSI6InNpZyIsImNydiI6IlAtMjU2Iiwia2lkIjoiZEp2UzIzOXkyQk5Jc3VJdzZ4dG12M0QtLVotbC1yaDlZZ1NQYmhhOGRVVSIsIngiOiI0eDJtTUFHRHRMV3drRUtCMExnUHBYYmZzbVQtZ2FFeVg4c2lkZlFJV2NZIiwieSI6IlBkeU5LVlhyU1piNENZUW1vSzZsWDdadXgwRElCY25oSjktX2E3WmxZdGMiLCJhbGciOiJFUzI1NiJ9", + "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwE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