AppCenter { @SafeVarargs public static void start(Class<? extends AppCenterService>... services) { getInstance().startServices(true, services); }  static synchronized AppCenter getInstance(); @SuppressWarnings("WeakerAccess") static void setWrapperSdk(WrapperSdk wrapperSdk); @IntRange(from = VERBOSE, to = NONE) static int getLogLevel(); static void setLogLevel(@IntRange(from = VERBOSE, to = NONE) int logLevel); static void setLogUrl(String logUrl); @SuppressWarnings({"WeakerAccess", "SameReturnValue"}) static String getSdkVersion(); static void setCustomProperties(CustomProperties customProperties); static boolean isConfigured(); static boolean isRunningInAppCenterTestCloud(); static void configure(Application application, String appSecret); static void configure(Application application); @SafeVarargs static void start(Class<? extends AppCenterService>... services); @SafeVarargs static void start(Application application, String appSecret, Class<? extends AppCenterService>... services); @SafeVarargs static void start(Application application, Class<? extends AppCenterService>... services); @SafeVarargs static void startFromLibrary(Context context, Class<? extends AppCenterService>... services); static AppCenterFuture<Boolean> isEnabled(); static AppCenterFuture<Void> setEnabled(boolean enabled); static AppCenterFuture<UUID> getInstallId(); static AppCenterFuture<Boolean> setMaxStorageSize(long storageSizeInBytes); static void setUserId(String userId); @VisibleForTesting void setChannel(Channel channel); static final String LOG_TAG; }
@Test public void invalidServiceTest() { AppCenter.start(mApplication, DUMMY_APP_SECRET, InvalidService.class); verifyStatic(); AppCenterLog.error(eq(LOG_TAG), anyString(), any(NoSuchMethodException.class)); }
@Test public void startWithNullAppSecretTest() { AppCenter.start(mApplication, (String) null, DummyService.class); checkNullOrEmptySecretStringForbidden(); }
@Test public void startWithEmptyAppSecretTest() { AppCenter.start(mApplication, "", DummyService.class); checkNullOrEmptySecretStringForbidden(); }
@Test public void startWithoutAppSecretTest() { AppCenter.start(mApplication, DummyService.class); checkStartedWithoutAppSecret(); }
@Test public void addOneCollectorListenerOnStart() { AppCenter.start(mApplication, DUMMY_TARGET_TOKEN_STRING, DummyService.class); verify(mChannel).addListener(argThat(new ArgumentMatcher<Channel.Listener>() { @Override public boolean matches(Object argument) { return argument instanceof OneCollectorChannelListener; } })); }