[server][testUnifiedDataStore] Extract lines as a template function so that other tests can use it.