From 3b8e42423293bcb15a1d15f15c768b78e42d2c27 Mon Sep 17 00:00:00 2001 From: Sebastian Gerske Date: Wed, 19 Dec 2018 12:34:07 +0100 Subject: [PATCH] added test for failed service agreements --- test/ocean/ServiceAgreement.test.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/ocean/ServiceAgreement.test.ts b/test/ocean/ServiceAgreement.test.ts index 715b874..3cec4eb 100644 --- a/test/ocean/ServiceAgreement.test.ts +++ b/test/ocean/ServiceAgreement.test.ts @@ -96,6 +96,21 @@ describe("ServiceAgreement", () => { assert(serviceDefinitionId) assert(serviceDefinitionId !== did.getId()) }) + + it("should throw on invalid sig", (done) => { + + const ddo = new DDO({id: did.getDid(), service: [accessService]}) + const serviceAgreementId: string = IdGenerator.generateId() + + // @ts-ignore + WebServiceConnectorProvider.setConnector(new WebServiceConnectorMock(ddo)) + + ServiceAgreement.executeServiceAgreement(did, ddo, accessService.serviceDefinitionId, + serviceAgreementId, "0x00", consumerAccount, publisherAccount) + .catch((err) => { + done() + }) + }) }) describe("#getStatus()", () => {