Analytics extends AbstractAppCenterService { public static AnalyticsTransmissionTarget getTransmissionTarget(String transmissionTargetToken) { return getInstance().getInstanceTransmissionTarget(transmissionTargetToken); } private  Analytics(); @SuppressWarnings({"WeakerAccess", "RedundantSuppression"}) static synchronized Analytics getInstance(); static AppCenterFuture<Boolean> isEnabled(); static AppCenterFuture<Void> setEnabled(boolean enabled); static boolean setTransmissionInterval(int seconds); static void pause(); static void resume(); static void trackEvent(String name); static void trackEvent(String name, Map<String, String> properties); static void trackEvent(String name, Map<String, String> properties, int flags); static void trackEvent(String name, EventProperties properties); static void trackEvent(String name, EventProperties properties, int flags); static AnalyticsTransmissionTarget getTransmissionTarget(String transmissionTargetToken); @Override boolean isAppSecretRequired(); @Override String getServiceName(); @Override Map<String, LogFactory> getLogFactories(); @Override synchronized void onActivityResumed(final Activity activity); @Override synchronized void onActivityPaused(Activity activity); @Override synchronized void onStarted(@NonNull Context context, @NonNull Channel channel, String appSecret, String transmissionTargetToken, boolean startedFromApp); @Override void onConfigurationUpdated(String appSecret, String transmissionTargetToken); static final String LOG_TAG; }
@Test public void createTransmissionTargetBeforeStart() { mockStatic(AppCenterLog.class); when(AppCenter.isConfigured()).thenReturn(false); assertNull(Analytics.getTransmissionTarget("t1")); verifyStatic(); AppCenterLog.error(anyString(), contains("AppCenter is not configured")); }