authelia/server/test/mocks/notifiers/MailSenderBuilderStub.ts
Clement Michaud 78f6028c1b Improve logging format for clarity
Previously, logs were not very friendly and it was hard to track
a request because of the lack of request ID.
Now every log message comes with a header containing: method, path
request ID, session ID, IP of the user, date.

Moreover, the configurations displayed in the logs have their secrets
hidden from this commit.
2017-10-08 22:33:50 +02:00

25 lines
854 B
TypeScript

import { IMailSenderBuilder } from "../../../src/lib/notifiers/IMailSenderBuilder";
import BluebirdPromise = require("bluebird");
import Nodemailer = require("nodemailer");
import Sinon = require("sinon");
import { IMailSender } from "../../../src/lib/notifiers/IMailSender";
import { SmtpNotifierConfiguration, GmailNotifierConfiguration } from "../../../src/lib/configuration/Configuration";
export class MailSenderBuilderStub implements IMailSenderBuilder {
buildGmailStub: Sinon.SinonStub;
buildSmtpStub: Sinon.SinonStub;
constructor() {
this.buildGmailStub = Sinon.stub();
this.buildSmtpStub = Sinon.stub();
}
buildGmail(options: GmailNotifierConfiguration): IMailSender {
return this.buildGmailStub(options);
}
buildSmtp(options: SmtpNotifierConfiguration): IMailSender {
return this.buildSmtpStub(options);
}
}