Refactoring of messagestore test