-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INJICERT-434] only fetch SVG template if VC 2.0 is requested
Signed-off-by: Harsh Vardhan <[email protected]>
- Loading branch information
Showing
4 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
certify-core/src/main/java/io/mosip/certify/core/constants/VCDM1Constants.java
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package io.mosip.certify.core.constants; | ||
|
||
public class VCDM1Constants { | ||
public static final String URL = "https://www.w3.org/2018/credentials/v1"; | ||
public static final String ISSUANCE_DATE = "issuanceDate"; | ||
public static final String EXPIRATION_DATE = "expirationDate"; | ||
} |
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
19 changes: 19 additions & 0 deletions
19
certify-service/src/test/java/io/mosip/certify/services/SVGRenderUtilsTest.java
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,19 @@ | ||
package io.mosip.certify.services; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class SVGRenderUtilsTest { | ||
|
||
@Test | ||
void getDigestMultibase() { | ||
String svg = """ | ||
<svg viewBox=".5 .5 3 4" fill="none" stroke="#20b2a" stroke-linecap="round"> <path d=" M1 4h-.001 V1h2v.001 M1 2.6 h1v.001"/> </svg> | ||
"""; | ||
String actual = SVGRenderUtils.getDigestMultibase(svg); | ||
String expected = "z4po9QkJj1fhMt6cxHSnDnAUat4PEVrerUGGsPHLxJnK5"; | ||
assertEquals(expected, actual); | ||
} | ||
|
||
} |