RNInstabugRepliesModule extends ReactContextBaseJavaModule { @ReactMethod public void setInAppNotificationEnabled(final boolean isChatNotificationEnable) { MainThreadHandler.runOnMainThread(new Runnable() { @Override public void run() { try { Replies.setInAppNotificationEnabled(isChatNotificationEnable); } catch (Exception e) { e.printStackTrace(); } } }); } RNInstabugRepliesModule(ReactApplicationContext reactApplicationContext); @Nonnull @Override String getName(); @ReactMethod void setEnabled(final boolean isEnabled); @ReactMethod void hasChats(final Callback callback); @ReactMethod void show(); @ReactMethod void setInAppNotificationSound(final boolean shouldPlaySound); @ReactMethod void getUnreadRepliesCount(final Callback messageCountCallback); @ReactMethod void setInAppNotificationEnabled(final boolean isChatNotificationEnable); @ReactMethod void setOnNewReplyReceivedHandler(final Callback onNewReplyReceivedCallback);  }
@Test public void givenBoolean$setInAppNotificationsEnabled_whenQuery_thenShouldCallNativeApi() { PowerMockito.mockStatic(Replies.class); rnModule.setInAppNotificationEnabled(true); PowerMockito.verifyStatic(VerificationModeFactory.times(1)); Replies.setInAppNotificationEnabled(true); }