From a6d9d34fe3b2758b7791878cce5df75ea215fdf2 Mon Sep 17 00:00:00 2001 From: Simon Detheridge Date: Sat, 4 Jan 2020 17:00:04 +0000 Subject: [PATCH] Configure PersistorManager to use the new S3 manager for 'aws-sdk' --- services/filestore/app/js/PersistorManager.js | 2 -- services/filestore/test/unit/js/PersistorManagerTests.js | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/services/filestore/app/js/PersistorManager.js b/services/filestore/app/js/PersistorManager.js index 8124d66101..cca0cf0f36 100644 --- a/services/filestore/app/js/PersistorManager.js +++ b/services/filestore/app/js/PersistorManager.js @@ -13,8 +13,6 @@ if (!settings.filestore.backend) { switch (settings.filestore.backend) { case 'aws-sdk': - module.exports = require('./AWSSDKPersistorManager') - break case 's3': module.exports = require('./S3PersistorManager') break diff --git a/services/filestore/test/unit/js/PersistorManagerTests.js b/services/filestore/test/unit/js/PersistorManagerTests.js index d8fd887265..0ecbb22078 100644 --- a/services/filestore/test/unit/js/PersistorManagerTests.js +++ b/services/filestore/test/unit/js/PersistorManagerTests.js @@ -43,6 +43,14 @@ describe('PersistorManager', function() { expect(PersistorManager.wrappedMethod()).to.equal('S3PersistorManager') }) + it("should implement the S3 wrapped method when 'aws-sdk' is configured", function() { + settings.filestore.backend = 'aws-sdk' + PersistorManager = SandboxedModule.require(modulePath, { requires }) + + expect(PersistorManager).to.respondTo('wrappedMethod') + expect(PersistorManager.wrappedMethod()).to.equal('S3PersistorManager') + }) + it('should implement the FS wrapped method when FS is configured', function() { settings.filestore.backend = 'fs' PersistorManager = SandboxedModule.require(modulePath, { requires })