How to use the fabric-ca-client/lib/AffiliationService.js function in fabric-ca-client

To help you get started, we’ve selected a few fabric-ca-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hyperledger / fabric-sdk-node / test / unit / affiliation-service.js View on Github external
test('AffiliationService: Test getAll() function', function (t) {
	let client = new FabricCAClient({protocol: 'http', hostname: '127.0.0.1', port: 7054});
	let affiliation = new AffiliationService(client);

	t.throws(()=> {
		affiliation.getAll();
	},
	/Missing required argument "registrar"/,
	'Must fail if missing registrar argument');

	t.throws(()=> {
		affiliation.getAll({});
	},
	/Argument "registrar" must be an instance of the class "User", but is found to be missing a method "getSigningIdentity/,
	'Must fail if registrar argument is not a User object');

	t.throws(()=> {
		affiliation.getAll({getSigningIdentity: function() {return;}});
	},
github hyperledger / fabric-sdk-node / test / unit / affiliation-service.js View on Github external
test('AffiliationService: Test delete() function', function (t) {
	let client = new FabricCAClient({protocol: 'http', hostname: '127.0.0.1', port: 7054});
	let affiliation = new AffiliationService(client);

	t.throws(()=> {
		affiliation.delete();
	},
	/Missing required argument "req"/,
	'Must fail if missing request argument');

	t.throws(()=> {
		affiliation.delete({name: null});
	},
	/Missing required argument "req.name", or argument "req.name" is not a valid string/,
	'Must fail if missing or invalid req.name argument');

	t.throws(()=> {
		affiliation.delete({name: 'name'});
	},
github hyperledger / fabric-sdk-node / test / unit / affiliation-service.js View on Github external
test('AffiliationService: Test create() function', function (t) {
	let client = new FabricCAClient({protocol: 'http', hostname: '127.0.0.1', port: 7054});
	let affiliation = new AffiliationService(client);

	t.throws(()=> {
		affiliation.create();
	},
	/Missing required argument "req"/,
	'Must fail if missing request argument');

	t.throws(()=> {
		affiliation.create({name: null});
	},
	/Missing required parameters. "req.name" is required./,
	'Must fail if missing req.name argument');

	t.throws(()=> {
		affiliation.create({name: 'name'});
	},
github hyperledger / fabric-sdk-node / test / unit / affiliation-service.js View on Github external
test('AffiliationService: Test getOne() function', function (t) {
	let client = new FabricCAClient({protocol: 'http', hostname: '127.0.0.1', port: 7054});
	let affiliation = new AffiliationService(client);

	t.throws(()=> {
		affiliation.getOne();
	},
	/Missing required argument "affiliation", or argument "affiliation" is not a valid string/,
	'Must fail if missing affiliation argument');

	t.throws(()=> {
		affiliation.getOne('affiliation');
	},
	/Missing required argument "registrar"/,
	'Must fail if missing registrar argument');

	t.throws(()=> {
		affiliation.getOne('affiliation', {});
	},
github hyperledger / fabric-sdk-node / test / unit / affiliation-service.js View on Github external
test('AffiliationService: Test update() function', function (t) {
	let client = new FabricCAClient({protocol: 'http', hostname: '127.0.0.1', port: 7054});
	let affiliation = new AffiliationService(client);

	t.throws(()=> {
		affiliation.update();
	},
	/Missing required argument "affiliation", or argument "affiliation" is not a valid string/,
	'Must fail if missing affiliation argument');

	t.throws(()=> {
		affiliation.update('affiliation');
	},
	/Missing required argument "req"/,
	'Must fail if missing request argument');

	t.throws(()=> {
		affiliation.update('affiliation', {name: null});
	},