def setUp(self):
        super(VolumeEncryptionMetadataTest, self).setUp()
        self.controller = (
            volume_encryption_metadata.VolumeEncryptionMetadataController())
        self.stubs.Set(db.sqlalchemy.api, 'volume_type_encryption_get',
                       return_volume_type_encryption_metadata)

        self.ctxt = context.RequestContext('fake', 'fake')
        self.volume_id = self._create_volume(self.ctxt)
    def setUp(self):
        super(VolumeEncryptionMetadataTest, self).setUp()
        self.controller = (
            volume_encryption_metadata.VolumeEncryptionMetadataController())
        self.mock_object(db.sqlalchemy.api, 'volume_type_encryption_get',
                         return_volume_type_encryption_metadata)

        self.ctxt = context.RequestContext(fake.USER_ID, fake.PROJECT_ID)
        self.volume_id = self._create_volume(self.ctxt)
        self.addCleanup(db.volume_destroy, self.ctxt.elevated(),
                        self.volume_id)