@Test public void getCustomEventName_shouldBeMraidBanner() { customEventName = AdTypeTranslator.getCustomEventName(AdFormat.BANNER, AdType.MRAID, null, headers); assertThat(customEventName).isEqualTo("com.mopub.mraid.MraidBanner"); }
public static String getCustomEventName(@NonNull AdFormat adFormat, @NonNull String adType, @Nullable String fullAdType, @NonNull Map<String, String> headers) { if (AdType.CUSTOM.equalsIgnoreCase(adType)) { return extractHeader(headers, ResponseHeader.CUSTOM_EVENT_NAME); } else if (AdType.NATIVE.equalsIgnoreCase(adType)){ return CustomEventType.MOPUB_NATIVE.toString(); } else if (AdType.HTML.equalsIgnoreCase(adType) || AdType.MRAID.equalsIgnoreCase(adType)) { return (AdFormat.INTERSTITIAL.equals(adFormat) ? CustomEventType.fromString(adType + INTERSTITIAL_SUFFIX) : CustomEventType.fromString(adType + BANNER_SUFFIX)).toString(); } else if (AdType.INTERSTITIAL.equalsIgnoreCase(adType)) { return CustomEventType.fromString(fullAdType + INTERSTITIAL_SUFFIX).toString(); } else { return CustomEventType.fromString(adType + BANNER_SUFFIX).toString(); } }
AdTypeTranslator { public static String getCustomEventName(@NonNull AdFormat adFormat, @NonNull String adType, @Nullable String fullAdType, @NonNull Map<String, String> headers) { if (AdType.CUSTOM.equalsIgnoreCase(adType)) { return extractHeader(headers, ResponseHeader.CUSTOM_EVENT_NAME); } else if (AdType.NATIVE.equalsIgnoreCase(adType)){ return CustomEventType.MOPUB_NATIVE.toString(); } else if (AdType.HTML.equalsIgnoreCase(adType) || AdType.MRAID.equalsIgnoreCase(adType)) { return (AdFormat.INTERSTITIAL.equals(adFormat) ? CustomEventType.fromString(adType + INTERSTITIAL_SUFFIX) : CustomEventType.fromString(adType + BANNER_SUFFIX)).toString(); } else if (AdType.INTERSTITIAL.equalsIgnoreCase(adType)) { return CustomEventType.fromString(fullAdType + INTERSTITIAL_SUFFIX).toString(); } else { return CustomEventType.fromString(adType + BANNER_SUFFIX).toString(); } } }
AdTypeTranslator { public static String getCustomEventName(@NonNull AdFormat adFormat, @NonNull String adType, @Nullable String fullAdType, @NonNull Map<String, String> headers) { if (AdType.CUSTOM.equalsIgnoreCase(adType)) { return extractHeader(headers, ResponseHeader.CUSTOM_EVENT_NAME); } else if (AdType.NATIVE.equalsIgnoreCase(adType)){ return CustomEventType.MOPUB_NATIVE.toString(); } else if (AdType.HTML.equalsIgnoreCase(adType) || AdType.MRAID.equalsIgnoreCase(adType)) { return (AdFormat.INTERSTITIAL.equals(adFormat) ? CustomEventType.fromString(adType + INTERSTITIAL_SUFFIX) : CustomEventType.fromString(adType + BANNER_SUFFIX)).toString(); } else if (AdType.INTERSTITIAL.equalsIgnoreCase(adType)) { return CustomEventType.fromString(fullAdType + INTERSTITIAL_SUFFIX).toString(); } else { return CustomEventType.fromString(adType + BANNER_SUFFIX).toString(); } }  }
AdTypeTranslator { public static String getCustomEventName(@NonNull AdFormat adFormat, @NonNull String adType, @Nullable String fullAdType, @NonNull Map<String, String> headers) { if (AdType.CUSTOM.equalsIgnoreCase(adType)) { return extractHeader(headers, ResponseHeader.CUSTOM_EVENT_NAME); } else if (AdType.NATIVE.equalsIgnoreCase(adType)){ return CustomEventType.MOPUB_NATIVE.toString(); } else if (AdType.HTML.equalsIgnoreCase(adType) || AdType.MRAID.equalsIgnoreCase(adType)) { return (AdFormat.INTERSTITIAL.equals(adFormat) ? CustomEventType.fromString(adType + INTERSTITIAL_SUFFIX) : CustomEventType.fromString(adType + BANNER_SUFFIX)).toString(); } else if (AdType.INTERSTITIAL.equalsIgnoreCase(adType)) { return CustomEventType.fromString(fullAdType + INTERSTITIAL_SUFFIX).toString(); } else { return CustomEventType.fromString(adType + BANNER_SUFFIX).toString(); } }  static String getCustomEventName(@NonNull AdFormat adFormat,
            @NonNull String adType,
            @Nullable String fullAdType,
            @NonNull Map<String, String> headers); }
AdTypeTranslator { public static String getCustomEventName(@NonNull AdFormat adFormat, @NonNull String adType, @Nullable String fullAdType, @NonNull Map<String, String> headers) { if (AdType.CUSTOM.equalsIgnoreCase(adType)) { return extractHeader(headers, ResponseHeader.CUSTOM_EVENT_NAME); } else if (AdType.NATIVE.equalsIgnoreCase(adType)){ return CustomEventType.MOPUB_NATIVE.toString(); } else if (AdType.HTML.equalsIgnoreCase(adType) || AdType.MRAID.equalsIgnoreCase(adType)) { return (AdFormat.INTERSTITIAL.equals(adFormat) ? CustomEventType.fromString(adType + INTERSTITIAL_SUFFIX) : CustomEventType.fromString(adType + BANNER_SUFFIX)).toString(); } else if (AdType.INTERSTITIAL.equalsIgnoreCase(adType)) { return CustomEventType.fromString(fullAdType + INTERSTITIAL_SUFFIX).toString(); } else { return CustomEventType.fromString(adType + BANNER_SUFFIX).toString(); } }  static String getCustomEventName(@NonNull AdFormat adFormat,
            @NonNull String adType,
            @Nullable String fullAdType,
            @NonNull Map<String, String> headers); static final String BANNER_SUFFIX; static final String INTERSTITIAL_SUFFIX; }