@@ -149,7 +149,7 @@ public void testRegisterMissingConnectionString() {
149
149
150
150
@ Test
151
151
public void testRegisterMissingHubName () {
152
- when (mConfig .getString (KEY_REGISTRATION_CONNECTIONSTRING )).thenReturn (KEY_REGISTRATION_CONNECTIONSTRING );
152
+ when (mConfig .getString (KEY_REGISTRATION_CONNECTIONSTRING )).thenReturn ("Connection String" );
153
153
when (mConfig .getString (KEY_REGISTRATION_HUBNAME )).thenReturn (null );
154
154
155
155
mHubModule .register (mConfig , mPromise );
@@ -161,8 +161,8 @@ public void testRegisterMissingHubName() {
161
161
162
162
@ Test
163
163
public void testRegisterMissingSenderID () {
164
- when (mConfig .getString (KEY_REGISTRATION_CONNECTIONSTRING )).thenReturn (KEY_REGISTRATION_CONNECTIONSTRING );
165
- when (mConfig .getString (KEY_REGISTRATION_HUBNAME )).thenReturn (KEY_REGISTRATION_HUBNAME );
164
+ when (mConfig .getString (KEY_REGISTRATION_CONNECTIONSTRING )).thenReturn ("Connection String" );
165
+ when (mConfig .getString (KEY_REGISTRATION_HUBNAME )).thenReturn ("Hub Name" );
166
166
when (mConfig .getString (KEY_REGISTRATION_SENDERID )).thenReturn (null );
167
167
168
168
mHubModule .register (mConfig , mPromise );
@@ -176,9 +176,9 @@ public void testRegisterMissingSenderID() {
176
176
public void testRegisterHasChannelName () {
177
177
final String channelName = "Channel Name" ;
178
178
179
- when (mConfig .getString (KEY_REGISTRATION_CONNECTIONSTRING )).thenReturn (KEY_REGISTRATION_CONNECTIONSTRING );
180
- when (mConfig .getString (KEY_REGISTRATION_HUBNAME )).thenReturn (KEY_REGISTRATION_HUBNAME );
181
- when (mConfig .getString (KEY_REGISTRATION_SENDERID )).thenReturn (KEY_REGISTRATION_SENDERID );
179
+ when (mConfig .getString (KEY_REGISTRATION_CONNECTIONSTRING )).thenReturn ("Connection String" );
180
+ when (mConfig .getString (KEY_REGISTRATION_HUBNAME )).thenReturn ("Hub Name" );
181
+ when (mConfig .getString (KEY_REGISTRATION_SENDERID )).thenReturn ("Sender ID" );
182
182
when (mConfig .hasKey (KEY_REGISTRATION_CHANNELNAME )).thenReturn (true );
183
183
when (mConfig .getString (KEY_REGISTRATION_CHANNELNAME )).thenReturn (channelName );
184
184
@@ -195,8 +195,8 @@ public void testRegisterHasChannelImportance() {
195
195
when (mConfig .getString (KEY_REGISTRATION_CONNECTIONSTRING )).thenReturn (KEY_REGISTRATION_CONNECTIONSTRING );
196
196
when (mConfig .getString (KEY_REGISTRATION_HUBNAME )).thenReturn (KEY_REGISTRATION_HUBNAME );
197
197
when (mConfig .getString (KEY_REGISTRATION_SENDERID )).thenReturn (KEY_REGISTRATION_SENDERID );
198
- when (mConfig .hasKey ("channelImportance" )).thenReturn (true );
199
- when (mConfig .getInt ("channelImportance" )).thenReturn (channelImportance );
198
+ when (mConfig .hasKey (KEY_REGISTRATION_CHANNELIMPORTANCE )).thenReturn (true );
199
+ when (mConfig .getInt (KEY_REGISTRATION_CHANNELIMPORTANCE )).thenReturn (channelImportance );
200
200
201
201
mHubModule .register (mConfig , mPromise );
202
202
@@ -211,8 +211,8 @@ public void testRegisterHasChannelShowBadge() {
211
211
when (mConfig .getString (KEY_REGISTRATION_CONNECTIONSTRING )).thenReturn (KEY_REGISTRATION_CONNECTIONSTRING );
212
212
when (mConfig .getString (KEY_REGISTRATION_HUBNAME )).thenReturn (KEY_REGISTRATION_HUBNAME );
213
213
when (mConfig .getString (KEY_REGISTRATION_SENDERID )).thenReturn (KEY_REGISTRATION_SENDERID );
214
- when (mConfig .hasKey ("channelShowBadge" )).thenReturn (true );
215
- when (mConfig .getBoolean ("channelShowBadge" )).thenReturn (channelShowBadge );
214
+ when (mConfig .hasKey (KEY_REGISTRATION_CHANNELSHOWBADGE )).thenReturn (true );
215
+ when (mConfig .getBoolean (KEY_REGISTRATION_CHANNELSHOWBADGE )).thenReturn (channelShowBadge );
216
216
217
217
mHubModule .register (mConfig , mPromise );
218
218
@@ -227,8 +227,8 @@ public void testRegisterHasChannelEnableLights() {
227
227
when (mConfig .getString (KEY_REGISTRATION_CONNECTIONSTRING )).thenReturn (KEY_REGISTRATION_CONNECTIONSTRING );
228
228
when (mConfig .getString (KEY_REGISTRATION_HUBNAME )).thenReturn (KEY_REGISTRATION_HUBNAME );
229
229
when (mConfig .getString (KEY_REGISTRATION_SENDERID )).thenReturn (KEY_REGISTRATION_SENDERID );
230
- when (mConfig .hasKey ("channelEnableLights" )).thenReturn (true );
231
- when (mConfig .getBoolean ("channelEnableLights" )).thenReturn (channelEnableLights );
230
+ when (mConfig .hasKey (KEY_REGISTRATION_CHANNELENABLELIGHTS )).thenReturn (true );
231
+ when (mConfig .getBoolean (KEY_REGISTRATION_CHANNELENABLELIGHTS )).thenReturn (channelEnableLights );
232
232
233
233
mHubModule .register (mConfig , mPromise );
234
234
@@ -243,8 +243,8 @@ public void testRegisterHasChannelEnableVibration() {
243
243
when (mConfig .getString (KEY_REGISTRATION_CONNECTIONSTRING )).thenReturn (KEY_REGISTRATION_CONNECTIONSTRING );
244
244
when (mConfig .getString (KEY_REGISTRATION_HUBNAME )).thenReturn (KEY_REGISTRATION_HUBNAME );
245
245
when (mConfig .getString (KEY_REGISTRATION_SENDERID )).thenReturn (KEY_REGISTRATION_SENDERID );
246
- when (mConfig .hasKey ("channelEnableVibration" )).thenReturn (true );
247
- when (mConfig .getBoolean ("channelEnableVibration" )).thenReturn (channelEnableVibration );
246
+ when (mConfig .hasKey (KEY_REGISTRATION_CHANNELENABLEVIBRATION )).thenReturn (true );
247
+ when (mConfig .getBoolean (KEY_REGISTRATION_CHANNELENABLEVIBRATION )).thenReturn (channelEnableVibration );
248
248
249
249
mHubModule .register (mConfig , mPromise );
250
250
@@ -290,9 +290,9 @@ public void testRegisterSuccessfully() {
290
290
public void testRegisterFailed () {
291
291
final String [] tags = { "Tag" };
292
292
293
- when (mConfig .getString (KEY_REGISTRATION_CONNECTIONSTRING )).thenReturn (KEY_REGISTRATION_CONNECTIONSTRING );
294
- when (mConfig .getString (KEY_REGISTRATION_HUBNAME )).thenReturn (KEY_REGISTRATION_HUBNAME );
295
- when (mConfig .getString (KEY_REGISTRATION_SENDERID )).thenReturn (KEY_REGISTRATION_SENDERID );
293
+ when (mConfig .getString (KEY_REGISTRATION_CONNECTIONSTRING )).thenReturn ("Connection String" );
294
+ when (mConfig .getString (KEY_REGISTRATION_HUBNAME )).thenReturn ("Hub Name" );
295
+ when (mConfig .getString (KEY_REGISTRATION_SENDERID )).thenReturn ("Sender ID" );
296
296
when (mConfig .hasKey (KEY_REGISTRATION_TAGS )).thenReturn (true );
297
297
when (mConfig .isNull (KEY_REGISTRATION_TAGS )).thenReturn (false );
298
298
when (mConfig .getArray (KEY_REGISTRATION_TAGS )).thenReturn (mTags );
@@ -311,8 +311,8 @@ public void testRegisterFailed() {
311
311
312
312
@ Test
313
313
public void testUnregisterSuccessfully () throws Exception {
314
- when (mNotificationHubUtil .getConnectionString (any (ReactContext .class ))).thenReturn (KEY_REGISTRATION_CONNECTIONSTRING );
315
- when (mNotificationHubUtil .getHubName (any (ReactContext .class ))).thenReturn (KEY_REGISTRATION_HUBNAME );
314
+ when (mNotificationHubUtil .getConnectionString (any (ReactContext .class ))).thenReturn ("Connection String" );
315
+ when (mNotificationHubUtil .getHubName (any (ReactContext .class ))).thenReturn ("Hub Name" );
316
316
when (mNotificationHubUtil .getRegistrationID (any (ReactContext .class ))).thenReturn ("registrationId" );
317
317
when (ReactNativeUtil .createNotificationHub (
318
318
anyString (), anyString (), any (ReactContext .class ))).thenReturn (mNotificationHub );
@@ -327,8 +327,8 @@ public void testUnregisterSuccessfully() throws Exception {
327
327
328
328
@ Test
329
329
public void testUnregisterNoRegistration () throws Exception {
330
- when (mNotificationHubUtil .getConnectionString (any (ReactContext .class ))).thenReturn (KEY_REGISTRATION_CONNECTIONSTRING );
331
- when (mNotificationHubUtil .getHubName (any (ReactContext .class ))).thenReturn (KEY_REGISTRATION_HUBNAME );
330
+ when (mNotificationHubUtil .getConnectionString (any (ReactContext .class ))).thenReturn ("Connection String" );
331
+ when (mNotificationHubUtil .getHubName (any (ReactContext .class ))).thenReturn ("Hub Name" );
332
332
when (mNotificationHubUtil .getRegistrationID (any (ReactContext .class ))).thenReturn (null );
333
333
when (ReactNativeUtil .createNotificationHub (
334
334
anyString (), anyString (), any (ReactContext .class ))).thenReturn (mNotificationHub );
@@ -344,8 +344,8 @@ public void testUnregisterNoRegistration() throws Exception {
344
344
public void testUnregisterThrowException () throws Exception {
345
345
final Exception unhandledException = new Exception ("Unhandled exception" );
346
346
347
- when (mNotificationHubUtil .getConnectionString (any (ReactContext .class ))).thenReturn (KEY_REGISTRATION_CONNECTIONSTRING );
348
- when (mNotificationHubUtil .getHubName (any (ReactContext .class ))).thenReturn (KEY_REGISTRATION_HUBNAME );
347
+ when (mNotificationHubUtil .getConnectionString (any (ReactContext .class ))).thenReturn ("Connection String" );
348
+ when (mNotificationHubUtil .getHubName (any (ReactContext .class ))).thenReturn ("Hub Name" );
349
349
when (mNotificationHubUtil .getRegistrationID (any (ReactContext .class ))).thenReturn ("registrationId" );
350
350
when (ReactNativeUtil .createNotificationHub (
351
351
anyString (), anyString (), any (ReactContext .class ))).thenReturn (mNotificationHub );
0 commit comments