From a5cb94ac2f1e695403c109320bccba3ac1dffc82 Mon Sep 17 00:00:00 2001 From: fluency03 Date: Wed, 2 May 2018 10:09:33 +0200 Subject: [PATCH] add longer time for Blockchain test MineNextBlock --- .../api/actors/BlockchainActorTest.scala | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/test/scala/com/fluency03/blockchain/api/actors/BlockchainActorTest.scala b/src/test/scala/com/fluency03/blockchain/api/actors/BlockchainActorTest.scala index efeacb9..0ca6c27 100644 --- a/src/test/scala/com/fluency03/blockchain/api/actors/BlockchainActorTest.scala +++ b/src/test/scala/com/fluency03/blockchain/api/actors/BlockchainActorTest.scala @@ -67,14 +67,16 @@ class BlockchainActorTest extends TestKit(ActorSystem("BlockchainActorTest")) wi blockchainActor ! CheckBlockchainValidity expectMsg(SuccessMsg("true")) - blockchainActor ! MineNextBlock("next", Seq.empty[String]) - val actualBlock = expectMsgType[Some[Block]].get - actualBlock.data shouldEqual "next" - actualBlock.transactions shouldEqual Seq.empty[Transaction] - actualBlock.difficulty shouldEqual blockchain.difficulty - actualBlock.index shouldEqual 1 - actualBlock.hasValidHash shouldEqual true - actualBlock.previousHash shouldEqual genesis.hash + within(15 seconds) { + blockchainActor ! MineNextBlock("next", Seq.empty[String]) + val actualBlock = expectMsgType[Some[Block]].get + actualBlock.data shouldEqual "next" + actualBlock.transactions shouldEqual Seq.empty[Transaction] + actualBlock.difficulty shouldEqual blockchain.difficulty + actualBlock.index shouldEqual 1 + actualBlock.hasValidHash shouldEqual true + actualBlock.previousHash shouldEqual genesis.hash + } blockchainActor ! DeleteBlockchain expectMsg(SuccessMsg("Blockchain deleted."))