RNInstabugBugReportingModule extends ReactContextBaseJavaModule { @ReactMethod public void setEnabledAttachmentTypes(final boolean screenshot, final boolean extraScreenshot, final boolean galleryImage, final boolean screenRecording) { MainThreadHandler.runOnMainThread(new Runnable() { @Override public void run() { try { BugReporting.setAttachmentTypesEnabled(screenshot, extraScreenshot, galleryImage, screenRecording); } catch (Exception e) { e.printStackTrace(); } } }); } RNInstabugBugReportingModule(ReactApplicationContext reactContext); @Nonnull @Override String getName(); @ReactMethod void setEnabled(final boolean isEnabled); @TargetApi(21) @ReactMethod void setAutoScreenRecordingEnabled(final boolean autoScreenRecordingEnabled); @ReactMethod void setExtendedBugReportMode(final String extendedBugReportMode); @ReactMethod void setViewHierarchyEnabled(final boolean isEnabled); @ReactMethod void setVideoRecordingFloatingButtonPosition(final String corner); @ReactMethod void setEnabledAttachmentTypes(final boolean screenshot, final boolean extraScreenshot, final boolean
            galleryImage, final boolean screenRecording); @ReactMethod void setInvocationEvent(final String invocationEventValue); @ReactMethod void setInvocationEvents(ReadableArray invocationEventValues); @ReactMethod void setOptions(final ReadableArray optionValues); @ReactMethod void setOnInvokeHandler(final Callback onInvokeHandler); @ReactMethod void setFloatingButtonEdge(final String floatingButtonEdge, final int floatingButtonOffset); @ReactMethod void setOnSDKDismissedHandler(final Callback handler); @ReactMethod void setShakingThresholdForAndroid(final int androidThreshold); @SuppressLint("WrongConstant") @ReactMethod void setReportTypes(ReadableArray types); @ReactMethod void show(final String reportType, final ReadableArray options);  }
@Test public void givenBooleanArgs$setEnabledAttachmentTypes_whenQuery_shouldCallNativeApiWithBooleanArgs() { PowerMockito.mockStatic(BugReporting.class); bugReportingModule.setEnabledAttachmentTypes(true, true, false, true); PowerMockito.verifyStatic(VerificationModeFactory.times(1)); BugReporting.setAttachmentTypesEnabled(true, true, false, true); }