diff --git a/sunbird-rc-esignet-integration-impl/src/test/java/io/mosip/esignet/sunbirdrc/integration/service/SunbirdRCVCIssuancePluginTest.java b/sunbird-rc-esignet-integration-impl/src/test/java/io/mosip/esignet/sunbirdrc/integration/service/SunbirdRCVCIssuancePluginTest.java index 7f842b2..1548f8a 100644 --- a/sunbird-rc-esignet-integration-impl/src/test/java/io/mosip/esignet/sunbirdrc/integration/service/SunbirdRCVCIssuancePluginTest.java +++ b/sunbird-rc-esignet-integration-impl/src/test/java/io/mosip/esignet/sunbirdrc/integration/service/SunbirdRCVCIssuancePluginTest.java @@ -27,6 +27,7 @@ import org.springframework.web.client.RestTemplate; import java.io.File; +import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -261,12 +262,16 @@ public void getVerifiableCredentialWithLinkedDataProof_InValidCredentialDetails_ @Test public void initialize_ValidDetails_ThenPass() throws VCIExchangeException { - File file = new File("src/test/resources/InsuranceCredential.json"); - String credentialPath = "file:/" + file.getAbsolutePath(); + URL credentialUrl = getClass().getClassLoader().getResource("InsuranceCredential.json"); + if (credentialUrl == null) { + throw new VCIExchangeException("InsuranceCredential.json not found in classpath"); + } + String credentialPath = credentialUrl.toString(); Mockito.when(environment.getProperty(Mockito.anyString())).thenReturn(credentialPath); sunbirdRCVCIssuancePlugin.initialize(); } + @Test public void initialize_InValidPropertyDetails_ThenPass() {