Skip to content

Commit

Permalink
code fix
Browse files Browse the repository at this point in the history
Signed-off-by: Venkata Saidurga Polamraju <[email protected]>
  • Loading branch information
pvsaidurga committed Apr 12, 2024
1 parent 2ba2528 commit 306d8aa
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import foundation.identity.jsonld.JsonLDObject;
import io.mosip.authentication.esignet.integration.dto.IdaError;
import io.mosip.authentication.esignet.integration.dto.IdaResponseWrapper;
import io.mosip.authentication.esignet.integration.dto.IdaVcExchangeRequest;
import io.mosip.authentication.esignet.integration.dto.IdaVcExchangeResponse;
Expand Down Expand Up @@ -220,18 +219,12 @@ public void getVerifiableCredentialWithLinkedDataProof_withInValidDetails_thenFa
oidcTransaction.setAuthTransactionId("authTransactionId");
oidcTransaction.setRelyingPartyId("relyingPartyId");
oidcTransaction.setClaimsLocales(new String[]{"en-US", "en", "en-CA", "fr-FR", "fr-CA"});

IdaResponseWrapper<IdaVcExchangeResponse<JsonLDObject>> mockResponseWrapper = new IdaResponseWrapper<>();
mockResponseWrapper.setErrors(Collections.singletonList(new IdaError()));
ParameterizedTypeReference<IdaResponseWrapper<IdaVcExchangeResponse<JsonLDObject>>> responseType =
new ParameterizedTypeReference<IdaResponseWrapper<IdaVcExchangeResponse<JsonLDObject>>>() {
};

Mockito.when(vciTransactionHelper.getOAuthTransaction(Mockito.any())).thenThrow(new VCIExchangeException("IDA-VCI-003"));
try {
idaVCIssuancePlugin.getVerifiableCredentialWithLinkedDataProof(vcRequestDto, "holderId", Map.of("accessTokenHash", "ACCESS_TOKEN_HASH", "client_id", "CLIENT_ID"));
Assert.fail();
} catch (VCIExchangeException e) {
Assert.assertEquals("vci_exchange_failed", e.getErrorCode());
Assert.assertEquals("IDA-VCI-003", e.getErrorCode());
}
}

Expand Down

0 comments on commit 306d8aa

Please sign in to comment.