MetainfoDAO metainfoDAO = createMock(MetainfoDAO.class);
MetainfoEntity metainfoEntity = new MetainfoEntity();
String serverVersion = ambariMetaInfo.getServerVersion();
metainfoEntity.setMetainfoName(Configuration.SERVER_VERSION_KEY);
metainfoEntity.setMetainfoValue(serverVersion);
expect(metainfoDAO.findByKey(Configuration.SERVER_VERSION_KEY)).
andReturn(metainfoEntity);
replay(metainfoDAO);
AmbariServer ambariServer = new AmbariServer();
ambariServer.metainfoDAO = metainfoDAO;
ambariServer.ambariMetaInfo = ambariMetaInfo;