server: add unit tests

Make test coverage >= 90%

#1019 
can you add a comment for this? why you want to create a two nodes raft cluster?