Skip to content

Commit

Permalink
added test for non match
Browse files Browse the repository at this point in the history
  • Loading branch information
mineme0110 committed Nov 6, 2023
1 parent 81c19fb commit 1abde0a
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import io.iohk.atala.mediator.db.AgentStub.{bobAgent, bobAgentLayer}
object DiscoverFeaturesExecuterSpec extends ZIOSpecDefault with DidAccountStubSetup with MessageSetup {

override def spec = suite("DiscoverFeaturesExecuterSpec")(
test("DiscoverFeatures Query message") {
test("DiscoverFeatures Query message should return the disclose message containing the matched protocols") {
val executer = DiscoverFeaturesExecuter
for {
agent <- ZIO.service[MediatorAgent]
Expand All @@ -41,10 +41,13 @@ object DiscoverFeaturesExecuterSpec extends ZIOSpecDefault with DidAccountStubSe
} yield {
val plainText = decryptedMessage.asInstanceOf[PlaintextMessage]
assertTrue(plainText.`type` == FeatureDisclose.piuri) &&
assertTrue(featureDisclose.disclosures.nonEmpty)
assertTrue(featureDisclose.disclosures.nonEmpty) &&
assertTrue(featureDisclose.disclosures.head.id.contains("routing"))
}
} @@ TestAspect.before(setupAndClean),
test("DiscoverFeatures Query message with no match") {
test(
"DiscoverFeatures Query message doesn't match regex pattern, it should yield a disclose message with an empty body"
) {
val executer = DiscoverFeaturesExecuter
for {
agent <- ZIO.service[MediatorAgent]
Expand Down

0 comments on commit 1abde0a

Please sign in to comment.