Compare commits

...

1 Commits

Author SHA1 Message Date
Bennett Buchanan dc9130ae46 FT: Add objectMD setters for replicationInfo 2018-10-15 09:09:13 -07:00
2 changed files with 28 additions and 0 deletions

View File

@ -775,6 +775,16 @@ class ObjectMD {
return undefined;
}
setReplicationBackends(backends) {
this._data.replicationInfo.backends = backends;
return this;
}
setReplicationStorageClass(storageClass) {
this._data.replicationInfo.storageClass = storageClass;
return this;
}
getReplicationDataStoreVersionId() {
return this._data.replicationInfo.dataStoreVersionId;
}

View File

@ -136,6 +136,24 @@ describe('ObjectMD class setters/getters', () => {
}]);
});
it('ObjectMD::setReplicationBackends', () => {
md.setReplicationBackends([{
site: 'a',
status: 'b',
dataStoreVersionId: 'c',
}]);
assert.deepStrictEqual(md.getReplicationBackends(), [{
site: 'a',
status: 'b',
dataStoreVersionId: 'c',
}]);
});
it('ObjectMD::setReplicationStorageClass', () => {
md.setReplicationStorageClass('a');
assert.strictEqual(md.getReplicationStorageClass(), 'a');
});
it('ObjectMD::getReplicationSiteStatus', () => {
md.setReplicationInfo({
backends: [{