Skip to content

Commit

Permalink
fix: integration test (#1011)
Browse files Browse the repository at this point in the history
Signed-off-by: Bassam Riman <[email protected]>
Signed-off-by: Yurii Shynbuiev - IOHK <[email protected]>
Co-authored-by: Yurii Shynbuiev - IOHK <[email protected]>
  • Loading branch information
CryptoKnightIOG and yshyn-iohk authored May 7, 2024
1 parent 3b17c34 commit d674f31
Show file tree
Hide file tree
Showing 21 changed files with 103 additions and 68 deletions.
4 changes: 2 additions & 2 deletions tests/integration-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ 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.1")
// Test helpers library
testImplementation("io.iohk.atala:atala-automation:0.3.2")
testImplementation("io.iohk.atala:atala-automation:0.4.0")
// Hoplite for configuration
testImplementation("com.sksamuel.hoplite:hoplite-core:2.7.5")
testImplementation("com.sksamuel.hoplite:hoplite-hocon:2.7.5")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ open class ListenToEvents(
) : Ability, HasTeardown {

private val server: ApplicationEngine
private val gson = GsonBuilder()
.registerTypeAdapter(OffsetDateTime::class.java, CustomGsonObjectMapperFactory.OffsetDateTimeDeserializer())
.create()
private val gson = GsonBuilder().registerTypeAdapter(OffsetDateTime::class.java, CustomGsonObjectMapperFactory.OffsetDateTimeTypeAdapter()).create()

var connectionEvents: MutableList<ConnectionEvent> = mutableListOf()
var credentialEvents: MutableList<CredentialEvent> = mutableListOf()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package common

import org.hyperledger.identus.client.models.CredentialSchemaInput
import models.JsonSchema
import models.JsonSchemaProperty
import org.hyperledger.identus.client.models.CredentialSchemaInput
import java.util.UUID

enum class CredentialSchema {
Expand Down
4 changes: 2 additions & 2 deletions tests/integration-tests/src/test/kotlin/steps/Setup.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import config.AgentRole
import config.Config
import io.cucumber.java.AfterAll
import io.cucumber.java.BeforeAll
import org.hyperledger.identus.client.models.CreateWalletRequest
import org.hyperledger.identus.client.models.CreateWebhookNotification
import io.restassured.RestAssured
import io.restassured.builder.RequestSpecBuilder
import net.serenitybdd.screenplay.Actor
import net.serenitybdd.screenplay.actors.Cast
import net.serenitybdd.screenplay.actors.OnStage
import net.serenitybdd.screenplay.rest.abilities.CallAnApi
import org.apache.http.HttpStatus
import org.hyperledger.identus.client.models.CreateWalletRequest
import org.hyperledger.identus.client.models.CreateWebhookNotification
import java.util.UUID

object Setup {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import io.cucumber.java.ParameterType
import io.cucumber.java.en.Given
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import org.hyperledger.identus.client.models.Connection
import org.hyperledger.identus.client.models.ConnectionsPage
import org.hyperledger.identus.client.models.IssueCredentialRecord
import org.hyperledger.identus.client.models.IssueCredentialRecordPage
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import net.serenitybdd.screenplay.actors.OnStage
import org.apache.http.HttpStatus
import org.hyperledger.identus.client.models.Connection
import org.hyperledger.identus.client.models.ConnectionsPage
import org.hyperledger.identus.client.models.IssueCredentialRecord
import org.hyperledger.identus.client.models.IssueCredentialRecordPage
import steps.connection.ConnectionSteps
import steps.credentials.IssueCredentialsSteps
import steps.did.PublishDidSteps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import io.cucumber.java.en.Then
import io.cucumber.java.en.When
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import org.hyperledger.identus.client.models.AcceptConnectionInvitationRequest
import org.hyperledger.identus.client.models.Connection
import org.hyperledger.identus.client.models.CreateConnectionRequest
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus.SC_CREATED
import org.apache.http.HttpStatus.SC_OK
import org.assertj.core.api.Assertions.assertThat
import org.hyperledger.identus.client.models.AcceptConnectionInvitationRequest
import org.hyperledger.identus.client.models.Connection
import org.hyperledger.identus.client.models.CreateConnectionRequest

class ConnectionSteps {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import io.cucumber.java.en.Then
import io.cucumber.java.en.When
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import org.hyperledger.identus.client.models.*
import models.AnoncredsSchema
import models.CredentialEvent
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import net.serenitybdd.screenplay.rest.abilities.CallAnApi
import org.apache.http.HttpStatus.*
import org.hyperledger.identus.client.models.*
import java.util.UUID

class IssueCredentialsSteps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import io.cucumber.java.en.Then
import io.cucumber.java.en.When
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import org.hyperledger.identus.client.models.DIDOperationResponse
import org.hyperledger.identus.client.models.DIDResolutionResult
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus
import org.hyperledger.identus.client.models.DIDOperationResponse
import org.hyperledger.identus.client.models.DIDResolutionResult

class DeactivateDidSteps {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import io.cucumber.java.en.Then
import io.cucumber.java.en.When
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus.SC_CREATED
import org.hyperledger.identus.client.models.CreateManagedDidRequest
import org.hyperledger.identus.client.models.CreateManagedDidRequestDocumentTemplate
import org.hyperledger.identus.client.models.Json
Expand All @@ -15,9 +18,6 @@ import org.hyperledger.identus.client.models.ManagedDIDKeyTemplate
import org.hyperledger.identus.client.models.ManagedDIDPage
import org.hyperledger.identus.client.models.Purpose
import org.hyperledger.identus.client.models.Service
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus.SC_CREATED

class ManageDidSteps {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import io.cucumber.java.en.Then
import io.cucumber.java.en.When
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import org.hyperledger.identus.client.models.*
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus
import org.apache.http.HttpStatus.SC_CREATED
import org.apache.http.HttpStatus.SC_OK
import org.hyperledger.identus.client.models.*

class PublishDidSteps {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import io.cucumber.java.en.Then
import io.cucumber.java.en.When
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus
import org.hyperledger.identus.client.models.ActionType
import org.hyperledger.identus.client.models.DIDOperationResponse
import org.hyperledger.identus.client.models.DIDResolutionResult
Expand All @@ -19,9 +22,6 @@ import org.hyperledger.identus.client.models.Service
import org.hyperledger.identus.client.models.UpdateManagedDIDRequest
import org.hyperledger.identus.client.models.UpdateManagedDIDRequestAction
import org.hyperledger.identus.client.models.UpdateManagedDIDServiceAction
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus

class UpdateDidSteps {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package steps.multitenancy
import interactions.Post
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import org.hyperledger.identus.client.models.ApiKeyAuthenticationRequest
import org.hyperledger.identus.client.models.CreateEntityRequest
import org.hyperledger.identus.client.models.EntityResponse
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus.SC_CREATED
import org.hyperledger.identus.client.models.ApiKeyAuthenticationRequest
import org.hyperledger.identus.client.models.CreateEntityRequest
import org.hyperledger.identus.client.models.EntityResponse
import java.util.*

class EntitySteps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package steps.multitenancy

import interactions.Post
import io.iohk.atala.automation.serenity.ensure.Ensure
import org.hyperledger.identus.client.models.CreateWebhookNotification
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus
import org.hyperledger.identus.client.models.CreateWebhookNotification

class EventsSteps {
fun registerNewWebhook(actor: Actor, webhookUrl: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import io.cucumber.java.en.Then
import io.cucumber.java.en.When
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import org.hyperledger.identus.client.models.CreateWalletRequest
import org.hyperledger.identus.client.models.WalletDetail
import org.hyperledger.identus.client.models.WalletDetailPage
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus.*
import org.hyperledger.identus.client.models.CreateWalletRequest
import org.hyperledger.identus.client.models.WalletDetail
import org.hyperledger.identus.client.models.WalletDetailPage
import java.util.*
import kotlin.random.Random

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import interactions.Post
import io.cucumber.java.en.When
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import org.hyperledger.identus.client.models.*
import models.PresentationEvent
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import net.serenitybdd.screenplay.rest.abilities.CallAnApi
import org.apache.http.HttpStatus.SC_CREATED
import org.hyperledger.identus.client.models.*

class AnoncredsPresentProofSteps {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import io.cucumber.java.en.Then
import io.cucumber.java.en.When
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import org.hyperledger.identus.client.models.*
import models.PresentationEvent
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus.SC_CREATED
import org.hyperledger.identus.client.models.*

class PresentProofSteps {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import io.cucumber.java.en.Then
import io.cucumber.java.en.When
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import org.hyperledger.identus.client.models.CredentialSchemaInput
import org.hyperledger.identus.client.models.CredentialSchemaResponse
import models.JsonSchema
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus.*
import org.hyperledger.identus.client.models.CredentialSchemaInput
import org.hyperledger.identus.client.models.CredentialSchemaResponse
import java.util.UUID

class CredentialSchemasSteps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import io.cucumber.java.en.Then
import io.cucumber.java.en.When
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.serenity.ensure.Ensure
import org.hyperledger.identus.client.models.HealthInfo
import net.serenitybdd.rest.SerenityRest
import net.serenitybdd.screenplay.Actor
import org.apache.http.HttpStatus
import org.hyperledger.identus.client.models.HealthInfo

class SystemSteps {
@When("{actor} makes a request to the health endpoint")
Expand Down
Loading

0 comments on commit d674f31

Please sign in to comment.