From 57ad9bbabb0f7f648d95a76b19f4499dc3744b19 Mon Sep 17 00:00:00 2001 From: Bassam Riman Date: Tue, 30 Apr 2024 12:31:10 -0400 Subject: [PATCH] ATL-6775: integration test Signed-off-by: Bassam Riman --- .../client/models/DateTimeParameter.kt | 34 ------------------- .../identus/client/models/DidParameter.kt | 34 ------------------- .../client/models/VcVerificationParameter.kt | 7 ++-- tests/integration-tests/build.gradle.kts | 2 +- .../src/test/kotlin/IntegrationTestsRunner.kt | 2 +- .../steps/verification/VcVerificationSteps.kt | 6 ++-- .../verification/vc_verification.feature | 7 ++++ 7 files changed, 14 insertions(+), 78 deletions(-) delete mode 100644 cloud-agent/client/kotlin/src/main/kotlin/org/hyperledger/identus/client/models/DateTimeParameter.kt delete mode 100644 cloud-agent/client/kotlin/src/main/kotlin/org/hyperledger/identus/client/models/DidParameter.kt create mode 100644 tests/integration-tests/src/test/resources/features/verification/vc_verification.feature diff --git a/cloud-agent/client/kotlin/src/main/kotlin/org/hyperledger/identus/client/models/DateTimeParameter.kt b/cloud-agent/client/kotlin/src/main/kotlin/org/hyperledger/identus/client/models/DateTimeParameter.kt deleted file mode 100644 index 8016c0640d..0000000000 --- a/cloud-agent/client/kotlin/src/main/kotlin/org/hyperledger/identus/client/models/DateTimeParameter.kt +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.hyperledger.identus.client.models - - -import com.google.gson.annotations.SerializedName - -/** - * - * - * @param dateTime - */ - - -data class DateTimeParameter : VcVerificationParameter(dateTime, null) ( - - @SerializedName("dateTime") - val dateTime: java.time.OffsetDateTime - -) - diff --git a/cloud-agent/client/kotlin/src/main/kotlin/org/hyperledger/identus/client/models/DidParameter.kt b/cloud-agent/client/kotlin/src/main/kotlin/org/hyperledger/identus/client/models/DidParameter.kt deleted file mode 100644 index 180525d147..0000000000 --- a/cloud-agent/client/kotlin/src/main/kotlin/org/hyperledger/identus/client/models/DidParameter.kt +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.hyperledger.identus.client.models - - -import com.google.gson.annotations.SerializedName - -/** - * - * - * @param aud - */ - - -data class DidParameter : VcVerificationParameter(null, aud)( - - @SerializedName("aud") - val aud: kotlin.String - -) - diff --git a/cloud-agent/client/kotlin/src/main/kotlin/org/hyperledger/identus/client/models/VcVerificationParameter.kt b/cloud-agent/client/kotlin/src/main/kotlin/org/hyperledger/identus/client/models/VcVerificationParameter.kt index fbf9ea3860..5b70b9f611 100644 --- a/cloud-agent/client/kotlin/src/main/kotlin/org/hyperledger/identus/client/models/VcVerificationParameter.kt +++ b/cloud-agent/client/kotlin/src/main/kotlin/org/hyperledger/identus/client/models/VcVerificationParameter.kt @@ -15,9 +15,6 @@ package org.hyperledger.identus.client.models -import org.hyperledger.identus.client.models.DateTimeParameter -import org.hyperledger.identus.client.models.DidParameter - import com.google.gson.annotations.SerializedName /** @@ -28,10 +25,10 @@ import com.google.gson.annotations.SerializedName */ -open class VcVerificationParameter ( + data class VcVerificationParameter ( @SerializedName("dateTime") - val dateTime: java.time.OffsetDateTime? = null, + var dateTime: java.time.OffsetDateTime? = null, @SerializedName("aud") val aud: kotlin.String? = null diff --git a/tests/integration-tests/build.gradle.kts b/tests/integration-tests/build.gradle.kts index f9a96b0d99..18e7c04848 100644 --- a/tests/integration-tests/build.gradle.kts +++ b/tests/integration-tests/build.gradle.kts @@ -33,7 +33,7 @@ dependencies { testImplementation("io.ktor:ktor-server-netty:2.3.0") testImplementation("io.ktor:ktor-client-apache:2.3.0") // RestAPI client - testImplementation("org.hyperledger.identus:cloud-agent-client-kotlin:1.32.0") + testImplementation("org.hyperledger.identus:cloud-agent-client-kotlin:1.32.0-SNAPSHOT") // Test helpers library testImplementation("io.iohk.atala:atala-automation:0.3.2") // Hoplite for configuration diff --git a/tests/integration-tests/src/test/kotlin/IntegrationTestsRunner.kt b/tests/integration-tests/src/test/kotlin/IntegrationTestsRunner.kt index c7890cb725..8ff5d4e1bd 100644 --- a/tests/integration-tests/src/test/kotlin/IntegrationTestsRunner.kt +++ b/tests/integration-tests/src/test/kotlin/IntegrationTestsRunner.kt @@ -3,7 +3,7 @@ import net.serenitybdd.cucumber.CucumberWithSerenity import org.junit.runner.RunWith @CucumberOptions( - features = ["src/test/resources/features"], + features = ["src/test/resources/features/verification"], snippets = CucumberOptions.SnippetType.CAMELCASE, plugin = ["pretty"], ) diff --git a/tests/integration-tests/src/test/kotlin/steps/verification/VcVerificationSteps.kt b/tests/integration-tests/src/test/kotlin/steps/verification/VcVerificationSteps.kt index a2ea92e969..10253e77e6 100644 --- a/tests/integration-tests/src/test/kotlin/steps/verification/VcVerificationSteps.kt +++ b/tests/integration-tests/src/test/kotlin/steps/verification/VcVerificationSteps.kt @@ -24,11 +24,11 @@ class VcVerificationSteps { ParameterizableVcVerification(VcVerification.SIGNATURE_VERIFICATION), ParameterizableVcVerification( VcVerification.NOT_BEFORE_CHECK, - DateTimeParameter(OffsetDateTime.now()), + VcVerificationParameter(dateTime = OffsetDateTime.now()), ), ParameterizableVcVerification( VcVerification.EXPIRATION_CHECK, - DateTimeParameter(OffsetDateTime.now()), + VcVerificationParameter(dateTime = OffsetDateTime.now()), ), ), ), @@ -37,7 +37,7 @@ class VcVerificationSteps { listOf( ParameterizableVcVerification( VcVerification.AUDIENCE_CHECK, - DidParameter("did:prism:verifier") as VcVerificationParameter, + VcVerificationParameter(aud = "did:prism:verifier"), ), ), ), diff --git a/tests/integration-tests/src/test/resources/features/verification/vc_verification.feature b/tests/integration-tests/src/test/resources/features/verification/vc_verification.feature new file mode 100644 index 0000000000..62db3d1611 --- /dev/null +++ b/tests/integration-tests/src/test/resources/features/verification/vc_verification.feature @@ -0,0 +1,7 @@ +Feature: Vc Verification schemas + + Background: + When Issuer creates unpublished DID + + Scenario: Successful Verifies VcVerificationRequest + When Issuer verifies VcVerificationRequest