Skip to content

Commit

Permalink
Added override constructor to ClientSSLSecurityPFX class (#1184)
Browse files Browse the repository at this point in the history
* Added override constructor to ClientSSLSecurityPFX class

Added test for additional ClientSSLSecurityPFX constructor

Fixed failing test of ClientSSLSecurityPFX

* Disabling test using and removing files PurchasingRequestService due to 404 links
  • Loading branch information
willemruys authored Jun 6, 2022
1 parent 56c7942 commit e4f7106
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1,253 deletions.
1 change: 1 addition & 0 deletions src/security/ClientSSLSecurityPFX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class ClientSSLSecurityPFX implements ISecurity {
private passphrase: string;

constructor(pfx: string | Buffer, defaults?: any);
constructor(pfx: string | Buffer, passphrase: string, defaults?: any);
constructor(pfx: string | Buffer, passphrase: string, defaults?: any) {
if (typeof passphrase === 'object') {
defaults = passphrase;
Expand Down
2 changes: 1 addition & 1 deletion test/client-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ it('should create async client without options', function (done) {
});
});

it('should add namespace to array of objects', function (done) {
xit('should add namespace to array of objects', function (done) {
soap.createClientAsync(__dirname + '/wsdl/PurchaseRequestService.wsdl').then(function (client) {
const input = {
errorProcessingLevel: "ALL",
Expand Down
8 changes: 8 additions & 0 deletions test/security/ClientSSLSecurityPFX.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ describe('ClientSSLSecurityPFX', function() {
instance.addOptions(options);
options.should.have.property("foo", 5);
});

it('should be accepted as the third param', function() {
var pfkBuffer = fs.readFileSync(join(__dirname, '..', 'certs', 'client-password.pfx')),
instance;

instance = new ClientSSLSecurityPFX(pfkBuffer, 'test2est', { foo: 5});
instance.should.have.property("defaults", { foo: 5 })
})
});

it('should throw if invalid pfk file is given', function () {
Expand Down
Loading

0 comments on commit e4f7106

Please sign in to comment.