rchain / rchain

Blockchain (smart contract) platform using CBC-Casper proof of stake + Rholang for concurrent execution.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Refactor API tests using mocks

tgrospic opened this issue · comments

Overview

Tests for block API are written as unit tests, but for all dependencies like RuntineManager, BlockDagStorage or BlockStore the real implementation is used.
casper/src/test/scala/coop/rchain/casper/api

This is especially problematic with API methods involving Rholang execution like BlockQueryResponseAPITest for which the whole genesis block is created.

Solution

Remove any dependency to real implementations and use only mocks using Mockito library.