creator instead of factory, as it does registration and authentication
This commit is contained in:
parent
3c5e73d644
commit
48d95c228a
2 changed files with 4 additions and 4 deletions
|
@ -19,7 +19,7 @@ const exec = util.promisify(require('child_process').exec);
|
||||||
const request = require('request-promise-native');
|
const request = require('request-promise-native');
|
||||||
const RestSession = require('./session');
|
const RestSession = require('./session');
|
||||||
|
|
||||||
module.exports = class RestSessionFactory {
|
module.exports = class RestSessionCreator {
|
||||||
constructor(synapseSubdir, hsUrl, cwd) {
|
constructor(synapseSubdir, hsUrl, cwd) {
|
||||||
this.synapseSubdir = synapseSubdir;
|
this.synapseSubdir = synapseSubdir;
|
||||||
this.hsUrl = hsUrl;
|
this.hsUrl = hsUrl;
|
6
start.js
6
start.js
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const RiotSession = require('./src/session');
|
const RiotSession = require('./src/session');
|
||||||
const scenario = require('./src/scenario');
|
const scenario = require('./src/scenario');
|
||||||
const RestSessionFactory = require('./src/rest/factory');
|
const RestSessionCreator = require('./src/rest/creator');
|
||||||
|
|
||||||
const program = require('commander');
|
const program = require('commander');
|
||||||
program
|
program
|
||||||
|
@ -41,14 +41,14 @@ async function runTests() {
|
||||||
options.executablePath = path;
|
options.executablePath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
const restFactory = new RestSessionFactory(
|
const restCreator = new RestSessionCreator(
|
||||||
'synapse/installations/consent',
|
'synapse/installations/consent',
|
||||||
'http://localhost:5005',
|
'http://localhost:5005',
|
||||||
__dirname
|
__dirname
|
||||||
);
|
);
|
||||||
|
|
||||||
function createRestSession(username, password) {
|
function createRestSession(username, password) {
|
||||||
return restFactory.createSession(username, password);
|
return restCreator.createSession(username, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createSession(username) {
|
async function createSession(username) {
|
||||||
|
|
Loading…
Reference in a new issue