Skip to content

Commit

Permalink
chore: move packages
Browse files Browse the repository at this point in the history
Signed-off-by: Allain Magyar <allain.magyar@iohk.io>
  • Loading branch information
amagyar-iohk committed Jun 4, 2024
1 parent c110b23 commit 4cde3d5
Show file tree
Hide file tree
Showing 15 changed files with 59 additions and 52 deletions.
4 changes: 2 additions & 2 deletions tests/end-to-end/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
id("net.serenity-bdd.serenity-gradle-plugin") version "4.0.1"
}

group = "io.iohk.atala.prism"
group = "org.hyperledger.identus"
version = "1.0-SNAPSHOT"

repositories {
Expand All @@ -28,7 +28,7 @@ repositories {
}

dependencies {
testImplementation("io.iohk.atala.prism.walletsdk:atala-prism-sdk:3.0.0-zkp")
testImplementation("org.hyperledger.identus:edge-agent-sdk:3.0.0-zkp2")
testImplementation("io.iohk.atala.prism:prism-kotlin-client:1.31.0")
testImplementation("io.iohk.atala:atala-automation:0.3.2")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.identus
package org.hyperledger.identus.walletsdk

import io.cucumber.junit.CucumberOptions
import net.serenitybdd.cucumber.CucumberWithSerenity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
package org.hyperledger.identus.abilities
package org.hyperledger.identus.walletsdk.abilities

import com.jayway.jsonpath.JsonPath
import io.iohk.atala.automation.utils.Logger
import org.hyperledger.identus.configuration.Environment
import io.iohk.atala.prism.walletsdk.apollo.ApolloImpl
import io.iohk.atala.prism.walletsdk.castor.CastorImpl
import io.iohk.atala.prism.walletsdk.domain.models.ApiImpl
import io.iohk.atala.prism.walletsdk.domain.models.DID
import io.iohk.atala.prism.walletsdk.domain.models.Message
import io.iohk.atala.prism.walletsdk.domain.models.httpClient
import io.iohk.atala.prism.walletsdk.mercury.MercuryImpl
import io.iohk.atala.prism.walletsdk.mercury.resolvers.DIDCommWrapper
import io.iohk.atala.prism.walletsdk.pluto.PlutoImpl
import io.iohk.atala.prism.walletsdk.pluto.data.DbConnection
import io.iohk.atala.prism.walletsdk.pollux.PolluxImpl
import io.iohk.atala.prism.walletsdk.prismagent.PrismAgent
import io.iohk.atala.prism.walletsdk.prismagent.mediation.BasicMediatorHandler
import io.iohk.atala.prism.walletsdk.prismagent.protocols.ProtocolType
import org.hyperledger.identus.workflow.EdgeAgentWorkflow
import org.hyperledger.identus.walletsdk.configuration.Environment

import org.hyperledger.identus.walletsdk.workflow.EdgeAgentWorkflow
import io.restassured.RestAssured
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
Expand All @@ -27,6 +14,20 @@ import net.serenitybdd.screenplay.Ability
import net.serenitybdd.screenplay.Actor
import net.serenitybdd.screenplay.Question
import net.serenitybdd.screenplay.SilentInteraction
import org.hyperledger.identus.walletsdk.apollo.ApolloImpl
import org.hyperledger.identus.walletsdk.castor.CastorImpl
import org.hyperledger.identus.walletsdk.domain.models.ApiImpl
import org.hyperledger.identus.walletsdk.domain.models.DID
import org.hyperledger.identus.walletsdk.domain.models.Message
import org.hyperledger.identus.walletsdk.domain.models.httpClient
import org.hyperledger.identus.walletsdk.edgeagent.EdgeAgent
import org.hyperledger.identus.walletsdk.edgeagent.mediation.BasicMediatorHandler
import org.hyperledger.identus.walletsdk.edgeagent.protocols.ProtocolType
import org.hyperledger.identus.walletsdk.mercury.MercuryImpl
import org.hyperledger.identus.walletsdk.mercury.resolvers.DIDCommWrapper
import org.hyperledger.identus.walletsdk.pluto.PlutoImpl
import org.hyperledger.identus.walletsdk.pluto.data.DbConnection
import org.hyperledger.identus.walletsdk.pollux.PolluxImpl
import java.util.*


Expand Down Expand Up @@ -98,7 +99,7 @@ class UseWalletSdk : Ability {
val handler = BasicMediatorHandler(mediatorDid, mercury, store)
val seed = apollo.createRandomSeed().seed

val sdk = PrismAgent(
val sdk = EdgeAgent(
apollo,
castor,
pluto,
Expand Down Expand Up @@ -146,7 +147,7 @@ class UseWalletSdk : Ability {
}

data class SdkContext(
val sdk: PrismAgent,
val sdk: EdgeAgent,
val credentialOfferStack: MutableList<Message> = Collections.synchronizedList(mutableListOf()),
val proofRequestStack: MutableList<Message> = Collections.synchronizedList(mutableListOf()),
val issuedCredentialStack: MutableList<Message> = Collections.synchronizedList(mutableListOf())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package org.hyperledger.identus.configuration
package org.hyperledger.identus.walletsdk.configuration

import io.iohk.atala.automation.utils.Wait
import io.iohk.atala.prism.models.*
import org.hyperledger.identus.utils.Notes
import org.hyperledger.identus.walletsdk.utils.Notes
import io.restassured.RestAssured
import io.restassured.builder.RequestSpecBuilder
import io.restassured.response.Response
import net.serenitybdd.rest.SerenityRest
import org.apache.http.HttpStatus
import org.assertj.core.api.Assertions.assertThat
import org.hyperledger.identus.models.AnoncredSchema
import org.hyperledger.identus.models.JwtSchema
import org.hyperledger.identus.models.JwtSchemaProperty
import org.hyperledger.identus.walletsdk.models.AnoncredSchema
import org.hyperledger.identus.walletsdk.models.JwtSchema
import org.hyperledger.identus.walletsdk.models.JwtSchemaProperty
import java.io.File
import java.util.*
import kotlin.time.Duration.Companion.seconds
Expand Down Expand Up @@ -71,7 +71,7 @@ object Environment {
private fun getSdkVersion(): String {
val file = File("build.gradle.kts")
val input = file.readText()
val regex = Regex("prism-sdk:(.*)(?=\")")
val regex = Regex("edge-agent-sdk:(.*)(?=\")")
return regex.find(input)!!.groups[1]!!.value
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.hyperledger.identus.configuration
package org.hyperledger.identus.walletsdk.configuration

import io.cucumber.java.Before
import io.cucumber.java.BeforeAll
import io.cucumber.java.ParameterType
import org.hyperledger.identus.abilities.UseWalletSdk
import org.hyperledger.identus.walletsdk.abilities.UseWalletSdk
import net.serenitybdd.screenplay.Actor
import net.serenitybdd.screenplay.actors.Cast
import net.serenitybdd.screenplay.actors.OnStage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.identus.models
package org.hyperledger.identus.walletsdk.models

import com.google.gson.annotations.SerializedName

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.identus.models
package org.hyperledger.identus.walletsdk.models

import com.google.gson.annotations.SerializedName

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.identus.models
package org.hyperledger.identus.walletsdk.models

import com.google.gson.annotations.SerializedName

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.hyperledger.identus.steps
package org.hyperledger.identus.walletsdk.steps

import io.cucumber.java.en.Given
import io.cucumber.java.en.Then
import io.cucumber.java.en.When
import org.hyperledger.identus.workflow.CloudAgentWorkflow
import org.hyperledger.identus.workflow.EdgeAgentWorkflow
import org.hyperledger.identus.walletsdk.workflow.CloudAgentWorkflow
import org.hyperledger.identus.walletsdk.workflow.EdgeAgentWorkflow
import net.serenitybdd.screenplay.Actor
import javax.inject.Inject

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.hyperledger.identus.steps
package org.hyperledger.identus.walletsdk.steps

import io.cucumber.java.After
import io.cucumber.java.en.Then
import io.cucumber.java.en.When
import org.hyperledger.identus.abilities.UseWalletSdk
import org.hyperledger.identus.workflow.CloudAgentWorkflow
import org.hyperledger.identus.workflow.EdgeAgentWorkflow
import org.hyperledger.identus.walletsdk.abilities.UseWalletSdk
import org.hyperledger.identus.walletsdk.workflow.CloudAgentWorkflow
import org.hyperledger.identus.walletsdk.workflow.EdgeAgentWorkflow
import net.serenitybdd.screenplay.Actor
import net.serenitybdd.screenplay.actors.OnStage
import javax.inject.Inject
Expand Down Expand Up @@ -119,6 +119,11 @@ class EdgeAgentSteps {
edgeAgentWorkflow.processIssuedCredential(edgeAgent, numberOfCredentials)
}

@Then("{actor} should have {} credentials")
fun `Edge Agent should have N credential`(actor: Actor, numberOfCredentials: Int) {
// edgeAgentWorkflow.creden
}

@After
fun stopAgent() {
OnStage.theActor("Edge Agent").attemptsTo(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.identus.utils
package org.hyperledger.identus.walletsdk.utils

import io.iohk.atala.automation.utils.Logger
import java.io.File
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.identus.utils
package org.hyperledger.identus.walletsdk.utils

import java.security.SecureRandom

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.hyperledger.identus.workflow
package org.hyperledger.identus.walletsdk.workflow

import io.iohk.atala.automation.extensions.body
import io.iohk.atala.automation.extensions.get
import io.iohk.atala.automation.matchers.RestAssuredJsonProperty
import io.iohk.atala.automation.serenity.ensure.Ensure
import io.iohk.atala.automation.serenity.interactions.PollingWait
import io.iohk.atala.automation.serenity.questions.HttpRequest
import org.hyperledger.identus.configuration.Environment
import org.hyperledger.identus.walletsdk.configuration.Environment
import io.iohk.atala.prism.models.AnoncredPresentationRequestV1
import io.iohk.atala.prism.models.AnoncredRequestedAttributeV1
import io.iohk.atala.prism.models.AnoncredRequestedPredicateV1
Expand All @@ -15,7 +15,7 @@ import io.iohk.atala.prism.models.CreateIssueCredentialRecordRequest
import io.iohk.atala.prism.models.Options
import io.iohk.atala.prism.models.ProofRequestAux
import io.iohk.atala.prism.models.RequestPresentationInput
import org.hyperledger.identus.utils.Utils
import org.hyperledger.identus.walletsdk.utils.Utils
import net.serenitybdd.rest.SerenityRest.lastResponse
import net.serenitybdd.screenplay.Actor
import net.serenitybdd.screenplay.rest.interactions.Post
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package org.hyperledger.identus.workflow
package org.hyperledger.identus.walletsdk.workflow

import com.google.gson.GsonBuilder
import io.iohk.atala.automation.serenity.interactions.PollingWait
import io.iohk.atala.automation.utils.Logger
import org.hyperledger.identus.abilities.UseWalletSdk
import io.iohk.atala.prism.walletsdk.domain.models.CastorError
import io.iohk.atala.prism.walletsdk.prismagent.protocols.issueCredential.IssueCredential
import io.iohk.atala.prism.walletsdk.prismagent.protocols.issueCredential.OfferCredential
import io.iohk.atala.prism.walletsdk.prismagent.protocols.outOfBand.OutOfBandInvitation
import io.iohk.atala.prism.walletsdk.prismagent.protocols.proofOfPresentation.RequestPresentation
import org.hyperledger.identus.walletsdk.abilities.UseWalletSdk
import kotlinx.coroutines.flow.first
import net.serenitybdd.screenplay.Actor
import org.hamcrest.CoreMatchers.equalTo
import org.hyperledger.identus.walletsdk.domain.models.CastorError
import org.hyperledger.identus.walletsdk.edgeagent.protocols.issueCredential.IssueCredential
import org.hyperledger.identus.walletsdk.edgeagent.protocols.issueCredential.OfferCredential
import org.hyperledger.identus.walletsdk.edgeagent.protocols.outOfBand.OutOfBandInvitation
import org.hyperledger.identus.walletsdk.edgeagent.protocols.proofOfPresentation.RequestPresentation

class EdgeAgentWorkflow {
private val logger = Logger.get<EdgeAgentWorkflow>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Feature: Receive verifiable credential
And Cloud Agent should see the credential was accepted
Then Edge Agent wait to receive 1 issued credentials
And Edge Agent process 1 issued credentials
And Edge Agent should have 1 credentials

Scenario: Receive multiple verifiable credentials sequentially
Given Cloud Agent is connected to Edge Agent
Expand Down

0 comments on commit 4cde3d5

Please sign in to comment.