'A configuration that was saved can be loaded from a new service.'

@validate_logging(assertHasMessage, _LOG_STARTUP, fields=dict(configuration=LATEST_TEST_DEPLOYMENT))
def test_persist_across_restarts(self, logger):

    path = FilePath(self.mktemp())
    service = ConfigurationPersistenceService(reactor, path)
    service.startService()
    d = service.save(LATEST_TEST_DEPLOYMENT)
    d.addCallback((lambda _: service.stopService()))
    def retrieve_in_new_service(_):
        new_service = self.service(path, logger)
        self.assertEqual(new_service.get(), LATEST_TEST_DEPLOYMENT)
    d.addCallback(retrieve_in_new_service)
    return d
