Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
import org.eclipse.edc.identityhub.tests.fixtures.common.AbstractIdentityHub;
import org.eclipse.edc.identityhub.tests.fixtures.common.Endpoint;
import org.eclipse.edc.issuerservice.spi.holder.HolderService;
import org.eclipse.edc.issuerservice.spi.holder.model.Holder;
import org.eclipse.edc.issuerservice.spi.issuance.attestation.AttestationDefinitionService;
import org.eclipse.edc.issuerservice.spi.issuance.credentialdefinition.CredentialDefinitionService;
import org.eclipse.edc.issuerservice.spi.issuance.model.AttestationDefinition;
import org.eclipse.edc.issuerservice.spi.issuance.model.CredentialDefinition;
import org.eclipse.edc.issuerservice.spi.issuance.model.IssuanceProcess;
import org.eclipse.edc.issuerservice.spi.issuance.process.store.IssuanceProcessStore;
Expand Down Expand Up @@ -74,6 +76,11 @@ public Endpoint getIssuerApiEndpoint() {
return issuerApiEndpoint.get();
}

public void createAttestationDefinition(AttestationDefinition definition) {
attestationDefinitionService.createAttestation(definition)
.orElseThrow(f -> new RuntimeException(f.getFailureDetail()));
}

public void createCredentialDefinition(CredentialDefinition definition) {
credentialDefinitionService.createCredentialDefinition(definition)
.orElseThrow(f -> new RuntimeException(f.getFailureDetail()));
Expand Down Expand Up @@ -111,6 +118,19 @@ public JsonPath getHolderCredentials(String participantDid, String participantId
.body().jsonPath();
}

public void createHolder(String participantContextId, String holderId, String holderDid, String holderName) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally speaking, to make the e2e more effective, we should have this methods to hit the http endpoints, and eventually using them for the IH e2e tests so they won't be deleted by accident :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree we already started doing the shift to expose http client testing api to use in e2e tests

var holder = Holder.Builder.newInstance()
.holderId(holderId)
.did(holderDid)
.holderName(holderName)
.participantContextId(participantContextId)
.build();

holderService.createHolder(holder)
.orElseThrow((f) -> new RuntimeException(f.getFailureDetail()));

}

public List<IssuanceProcess> getIssuanceProcessesForParticipant(String participantContextId) {
return getIssuanceProcessesForParticipant(participantContextId, null);
}
Expand Down
Loading