@@ -149,7 +149,7 @@ public void testRegisterMissingConnectionString() {
149149
150150 @ Test
151151 public void testRegisterMissingHubName () {
152- when (mConfig .getString (KEY_REGISTRATION_CONNECTIONSTRING )).thenReturn (KEY_REGISTRATION_CONNECTIONSTRING );
152+ when (mConfig .getString (KEY_REGISTRATION_CONNECTIONSTRING )).thenReturn ("Connection String" );
153153 when (mConfig .getString (KEY_REGISTRATION_HUBNAME )).thenReturn (null );
154154
155155 mHubModule .register (mConfig , mPromise );
@@ -161,8 +161,8 @@ public void testRegisterMissingHubName() {
161161
162162 @ Test
163163 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" );
166166 when (mConfig .getString (KEY_REGISTRATION_SENDERID )).thenReturn (null );
167167
168168 mHubModule .register (mConfig , mPromise );
@@ -176,9 +176,9 @@ public void testRegisterMissingSenderID() {
176176 public void testRegisterHasChannelName () {
177177 final String channelName = "Channel Name" ;
178178
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" );
182182 when (mConfig .hasKey (KEY_REGISTRATION_CHANNELNAME )).thenReturn (true );
183183 when (mConfig .getString (KEY_REGISTRATION_CHANNELNAME )).thenReturn (channelName );
184184
@@ -195,8 +195,8 @@ public void testRegisterHasChannelImportance() {
195195 when (mConfig .getString (KEY_REGISTRATION_CONNECTIONSTRING )).thenReturn (KEY_REGISTRATION_CONNECTIONSTRING );
196196 when (mConfig .getString (KEY_REGISTRATION_HUBNAME )).thenReturn (KEY_REGISTRATION_HUBNAME );
197197 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 );
200200
201201 mHubModule .register (mConfig , mPromise );
202202
@@ -211,8 +211,8 @@ public void testRegisterHasChannelShowBadge() {
211211 when (mConfig .getString (KEY_REGISTRATION_CONNECTIONSTRING )).thenReturn (KEY_REGISTRATION_CONNECTIONSTRING );
212212 when (mConfig .getString (KEY_REGISTRATION_HUBNAME )).thenReturn (KEY_REGISTRATION_HUBNAME );
213213 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 );
216216
217217 mHubModule .register (mConfig , mPromise );
218218
@@ -227,8 +227,8 @@ public void testRegisterHasChannelEnableLights() {
227227 when (mConfig .getString (KEY_REGISTRATION_CONNECTIONSTRING )).thenReturn (KEY_REGISTRATION_CONNECTIONSTRING );
228228 when (mConfig .getString (KEY_REGISTRATION_HUBNAME )).thenReturn (KEY_REGISTRATION_HUBNAME );
229229 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 );
232232
233233 mHubModule .register (mConfig , mPromise );
234234
@@ -243,8 +243,8 @@ public void testRegisterHasChannelEnableVibration() {
243243 when (mConfig .getString (KEY_REGISTRATION_CONNECTIONSTRING )).thenReturn (KEY_REGISTRATION_CONNECTIONSTRING );
244244 when (mConfig .getString (KEY_REGISTRATION_HUBNAME )).thenReturn (KEY_REGISTRATION_HUBNAME );
245245 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 );
248248
249249 mHubModule .register (mConfig , mPromise );
250250
@@ -290,9 +290,9 @@ public void testRegisterSuccessfully() {
290290 public void testRegisterFailed () {
291291 final String [] tags = { "Tag" };
292292
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" );
296296 when (mConfig .hasKey (KEY_REGISTRATION_TAGS )).thenReturn (true );
297297 when (mConfig .isNull (KEY_REGISTRATION_TAGS )).thenReturn (false );
298298 when (mConfig .getArray (KEY_REGISTRATION_TAGS )).thenReturn (mTags );
@@ -311,8 +311,8 @@ public void testRegisterFailed() {
311311
312312 @ Test
313313 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" );
316316 when (mNotificationHubUtil .getRegistrationID (any (ReactContext .class ))).thenReturn ("registrationId" );
317317 when (ReactNativeUtil .createNotificationHub (
318318 anyString (), anyString (), any (ReactContext .class ))).thenReturn (mNotificationHub );
@@ -327,8 +327,8 @@ public void testUnregisterSuccessfully() throws Exception {
327327
328328 @ Test
329329 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" );
332332 when (mNotificationHubUtil .getRegistrationID (any (ReactContext .class ))).thenReturn (null );
333333 when (ReactNativeUtil .createNotificationHub (
334334 anyString (), anyString (), any (ReactContext .class ))).thenReturn (mNotificationHub );
@@ -344,8 +344,8 @@ public void testUnregisterNoRegistration() throws Exception {
344344 public void testUnregisterThrowException () throws Exception {
345345 final Exception unhandledException = new Exception ("Unhandled exception" );
346346
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" );
349349 when (mNotificationHubUtil .getRegistrationID (any (ReactContext .class ))).thenReturn ("registrationId" );
350350 when (ReactNativeUtil .createNotificationHub (
351351 anyString (), anyString (), any (ReactContext .class ))).thenReturn (mNotificationHub );
0 commit comments