aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/node/test
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-09-30 14:22:54 -0700
committerGravatar murgatroid99 <mlumish@google.com>2015-09-30 14:26:29 -0700
commit5f709ca2a43e63c0fc069112b53acb2f84211ff0 (patch)
tree2af7e5778bbf4eb5f99efed4557493f4c7dc0a9f /src/node/test
parent8610dde89dabfc891440fabb206bbf9acaeb25c2 (diff)
Split Credentials into two types
Diffstat (limited to 'src/node/test')
-rw-r--r--src/node/test/call_test.js2
-rw-r--r--src/node/test/channel_test.js2
-rw-r--r--src/node/test/credentials_test.js20
-rw-r--r--src/node/test/end_to_end_test.js2
4 files changed, 23 insertions, 3 deletions
diff --git a/src/node/test/call_test.js b/src/node/test/call_test.js
index e7f071bcd5..bb292cb261 100644
--- a/src/node/test/call_test.js
+++ b/src/node/test/call_test.js
@@ -48,7 +48,7 @@ function getDeadline(timeout_secs) {
return deadline;
}
-var insecureCreds = grpc.Credentials.createInsecure();
+var insecureCreds = grpc.ChannelCredentials.createInsecure();
describe('call', function() {
var channel;
diff --git a/src/node/test/channel_test.js b/src/node/test/channel_test.js
index 2e436222d1..da7aa8d746 100644
--- a/src/node/test/channel_test.js
+++ b/src/node/test/channel_test.js
@@ -56,7 +56,7 @@ function multiDone(done, count) {
}
};
}
-var insecureCreds = grpc.Credentials.createInsecure();
+var insecureCreds = grpc.ChannelCredentials.createInsecure();
describe('channel', function() {
describe('constructor', function() {
diff --git a/src/node/test/credentials_test.js b/src/node/test/credentials_test.js
index e84ade681f..8eb91ee69e 100644
--- a/src/node/test/credentials_test.js
+++ b/src/node/test/credentials_test.js
@@ -219,5 +219,25 @@ describe('client credentials', function() {
});
call.end();
});
+ it('should be able to use multiple plugin credentials', function(done) {
+ var altMetadataUpdater = function(service_url, callback) {
+ var metadata = new grpc.Metadata();
+ metadata.set('other_plugin_key', 'other_plugin_value');
+ callback(null, metadata);
+ };
+ var alt_updater_creds = grpc.credentials.createFromMetadataGenerator(
+ altMetadataUpdater);
+ var combined_updater = grpc.credentials.combineCallCredentials(
+ updater_creds, alt_updater_creds);
+ var call = client.unary({}, function(err, data) {
+ assert.ifError(err);
+ }, null, {credentials: updater_creds});
+ call.on('metadata', function(metadata) {
+ assert.deepEqual(metadata.get('plugin_key'), ['plugin_value']);
+ assert.deepEqual(metadata.get('other_plugin_key'),
+ ['other_plugin_value']);
+ done();
+ });
+ });
});
});
diff --git a/src/node/test/end_to_end_test.js b/src/node/test/end_to_end_test.js
index 4b8da3bfb1..78a99fba42 100644
--- a/src/node/test/end_to_end_test.js
+++ b/src/node/test/end_to_end_test.js
@@ -57,7 +57,7 @@ function multiDone(done, count) {
};
}
-var insecureCreds = grpc.Credentials.createInsecure();
+var insecureCreds = grpc.ChannelCredentials.createInsecure();
describe('end-to-end', function() {
var server;