@Test
public void testProvisionCluster_ExistingQuickLinkProfileIsOverwritten() throws Exception {

  expect(persistedState.getAllRequests()).andReturn(Collections.<ClusterTopology,
      List<LogicalRequest>>emptyMap()).anyTimes();
  // request has a quicklinks profile
  expect(request.getQuickLinksProfileJson()).andReturn(SAMPLE_QUICKLINKS_PROFILE_2).anyTimes();
  // existing quick links profile returned by dao
  final long timeStamp1 = System.currentTimeMillis();
  SettingEntity originalProfile = createQuickLinksSettingEntity(SAMPLE_QUICKLINKS_PROFILE_1, timeStamp1);
  expect(settingDAO.findByName(QuickLinksProfile.SETTING_NAME_QUICKLINKS_PROFILE)).andReturn(originalProfile);
  // expect that settingsDao overwrites the quick links profile with the new content
  mockStatic(System.class);
  final long timeStamp2 = timeStamp1 + 100;
  expect(System.currentTimeMillis()).andReturn(timeStamp2);
  PowerMock.replay(System.class);
  final SettingEntity newProfile = createQuickLinksSettingEntity(SAMPLE_QUICKLINKS_PROFILE_2, timeStamp2);
  expect(settingDAO.merge(newProfile)).andReturn(newProfile);
  replayAll();
  topologyManager.provisionCluster(request);
}