RNInstabugSurveysModule extends ReactContextBaseJavaModule { @ReactMethod public void showSurvey(final String surveyToken) { MainThreadHandler.runOnMainThread(new Runnable() { @Override public void run() { try { Surveys.showSurvey(surveyToken); } catch (Exception e) { e.printStackTrace(); } } }); } RNInstabugSurveysModule(ReactApplicationContext reactContext); @Nonnull @Override String getName(); @ReactMethod void hasRespondedToSurvey(final String surveyToken, final Callback hasRespondedCallback); @ReactMethod void showSurvey(final String surveyToken); @ReactMethod void showSurveysIfAvailable(); @ReactMethod void setEnabled(final boolean isEnabled); @ReactMethod void setOnShowHandler(final Callback handler); @ReactMethod void setOnDismissHandler(final Callback handler); @ReactMethod void setThresholdForReshowingSurveyAfterDismiss(final int sessionsCount, final int daysCount); @ReactMethod void getAvailableSurveys(final Callback availableSurveysCallback); @ReactMethod void setAutoShowingEnabled(final boolean autoShowingSurveysEnabled); @ReactMethod void setShouldShowWelcomeScreen(final boolean shouldShow);  }
@Test public void givenString$showSurvey_whenQuery_thenShouldCallNativeApiWithString() { PowerMockito.mockStatic(Surveys.class); surveysModule.showSurvey("123"); PowerMockito.verifyStatic(VerificationModeFactory.times(1)); Surveys.showSurvey("123"); }