server: add functional tests

Make test coverage >= 90%

#1019 
the test just wants to make sure that the corresponded function is called
i could let `storeRecorder` returns emptyEvent each time, but i cannot find a good reason for it.