@@ -235,7 +235,7 @@ it('should create and get an iam policy', async () => {
235235} ) ;
236236
237237it ( 'should create and delete a registry' , async ( ) => {
238- const createRegistryId = registryName + ' create' ;
238+ const createRegistryId = ` ${ registryName } - create` ;
239239
240240 let output = await tools . runAsync ( `${ cmd } setupIotTopic ${ topicName } ` , cwd ) ;
241241 output = await tools . runAsync (
@@ -252,21 +252,23 @@ it('should create and delete a registry', async () => {
252252
253253it ( 'should send command message to device' , async ( ) => {
254254 const deviceId = 'test-device-command' ;
255- const commandMessage = 'rotate 180 degrees ' ;
255+ const commandMessage = 'rotate:180_degrees ' ;
256256
257257 await tools . runAsync (
258258 `${ cmd } createRsa256Device ${ deviceId } ${ registryName } ${ rsaPublicCert } ` ,
259259 cwd
260260 ) ;
261261
262262 tools . runAsync (
263- `node cloudiot_mqtt_example_nodejs.js mqttDeviceDemo --deviceId=${ deviceId } --registryId=${ registryName } --privateKeyFile=${ rsaPrivateKey } --algorithm=RS256 --numMessages=20 --mqttBridgePort=8883` ,
263+ `node cloudiot_mqtt_example_nodejs.js mqttDeviceDemo --deviceId=${ deviceId } --registryId=${ registryName } \
264+ --privateKeyFile=${ rsaPrivateKey } --algorithm=RS256 --numMessages=20 --mqttBridgePort=8883` ,
264265 path . join ( __dirname , '../../mqtt_example' )
265266 ) ;
266267
267268 const output = await tools . runAsync (
268269 `${ cmd } sendCommand ${ deviceId } ${ registryName } ${ commandMessage } `
269270 ) ;
271+ console . log ( output ) ;
270272 assert . ok ( output . includes ( 'Sent command' ) ) ;
271273
272274 await tools . runAsync ( `${ cmd } deleteDevice ${ deviceId } ${ registryName } ` , cwd ) ;
@@ -275,7 +277,8 @@ it('should send command message to device', async () => {
275277it ( 'should create a new gateway' , async ( ) => {
276278 const gatewayId = `nodejs-test-gateway-iot-${ uuid . v4 ( ) } ` ;
277279 const gatewayOut = await tools . runAsync (
278- `${ cmd } createGateway ${ registryName } ${ gatewayId } RSA_X509_PEM ${ rsaPublicCert } `
280+ `${ cmd } createGateway --registryId=${ registryName } --gatewayId=${ gatewayId } \
281+ --format=RSA_X509_PEM --key=${ rsaPublicCert } `
279282 ) ;
280283
281284 // test no error on create gateway.
@@ -289,7 +292,8 @@ it('should create a new gateway', async () => {
289292it ( 'should list gateways' , async ( ) => {
290293 const gatewayId = `nodejs-test-gateway-iot-${ uuid . v4 ( ) } ` ;
291294 await tools . runAsync (
292- `${ cmd } createGateway ${ registryName } ${ gatewayId } RSA_X509_PEM ${ rsaPublicCert } `
295+ `${ cmd } createGateway --registryId=${ registryName } --gatewayId=${ gatewayId } \
296+ --format=RSA_X509_PEM --key=${ rsaPublicCert } `
293297 ) ;
294298
295299 // look for output in list gateway
@@ -304,7 +308,8 @@ it('should list gateways', async () => {
304308it ( 'should bind existing device to gateway' , async ( ) => {
305309 const gatewayId = `nodejs-test-gateway-iot-${ uuid . v4 ( ) } ` ;
306310 await tools . runAsync (
307- `${ cmd } createGateway ${ registryName } ${ gatewayId } RSA_X509_PEM ${ rsaPublicCert } `
311+ `${ cmd } createGateway --registryId=${ registryName } --gatewayId=${ gatewayId } \
312+ --format=RSA_X509_PEM --key=${ rsaPublicCert } `
308313 ) ;
309314
310315 // create device
@@ -342,7 +347,8 @@ it('should bind existing device to gateway', async () => {
342347it ( 'should list devices bound to gateway' , async ( ) => {
343348 const gatewayId = `nodejs-test-gateway-iot-${ uuid . v4 ( ) } ` ;
344349 await tools . runAsync (
345- `${ cmd } createGateway ${ registryName } ${ gatewayId } RSA_X509_PEM ${ rsaPublicCert } `
350+ `${ cmd } createGateway --registryId=${ registryName } --gatewayId=${ gatewayId } \
351+ --format=RSA_X509_PEM --key=${ rsaPublicCert } `
346352 ) ;
347353
348354 const deviceId = `nodejs-test-device-iot-${ uuid . v4 ( ) } ` ;
@@ -384,7 +390,8 @@ it('should list devices bound to gateway', async () => {
384390it ( 'should list gateways for bound device' , async ( ) => {
385391 const gatewayId = `nodejs-test-gateway-iot-${ uuid . v4 ( ) } ` ;
386392 await tools . runAsync (
387- `${ cmd } createGateway ${ registryName } ${ gatewayId } RSA_X509_PEM ${ rsaPublicCert } `
393+ `${ cmd } createGateway --registryId=${ registryName } --gatewayId=${ gatewayId } \
394+ --format=RSA_X509_PEM --key=${ rsaPublicCert } `
388395 ) ;
389396
390397 // create device
0 commit comments