@Test public void getBoolean_activatedStillLoadingFromDisk_blocksAndReturnsActivatedValue() throws Exception { loadActivatedAsyncCacheWithIncompleteTask(); loadActivatedBlockingCacheWith(ImmutableMap.of(BOOLEAN_KEY, ACTIVATED_BOOLEAN_STRING_VALUE)); boolean booleanValue = getHandler.getBoolean(BOOLEAN_KEY); assertThat(booleanValue).isEqualTo(ACTIVATED_BOOLEAN_VALUE); }
public boolean getBoolean(String key) { String activatedString = getStringFromCache(activatedConfigsCache, key); if (activatedString != null) { if (TRUE_REGEX.matcher(activatedString).matches()) { return true; } else if (FALSE_REGEX.matcher(activatedString).matches()) { return false; } } String defaultsString = getStringFromCache(defaultConfigsCache, key); if (defaultsString != null) { if (TRUE_REGEX.matcher(defaultsString).matches()) { return true; } else if (FALSE_REGEX.matcher(defaultsString).matches()) { return false; } } logParameterValueDoesNotExist(key, "Boolean"); return DEFAULT_VALUE_FOR_BOOLEAN; }
ConfigGetParameterHandler { public boolean getBoolean(String key) { String activatedString = getStringFromCache(activatedConfigsCache, key); if (activatedString != null) { if (TRUE_REGEX.matcher(activatedString).matches()) { return true; } else if (FALSE_REGEX.matcher(activatedString).matches()) { return false; } } String defaultsString = getStringFromCache(defaultConfigsCache, key); if (defaultsString != null) { if (TRUE_REGEX.matcher(defaultsString).matches()) { return true; } else if (FALSE_REGEX.matcher(defaultsString).matches()) { return false; } } logParameterValueDoesNotExist(key, "Boolean"); return DEFAULT_VALUE_FOR_BOOLEAN; } }
ConfigGetParameterHandler { public boolean getBoolean(String key) { String activatedString = getStringFromCache(activatedConfigsCache, key); if (activatedString != null) { if (TRUE_REGEX.matcher(activatedString).matches()) { return true; } else if (FALSE_REGEX.matcher(activatedString).matches()) { return false; } } String defaultsString = getStringFromCache(defaultConfigsCache, key); if (defaultsString != null) { if (TRUE_REGEX.matcher(defaultsString).matches()) { return true; } else if (FALSE_REGEX.matcher(defaultsString).matches()) { return false; } } logParameterValueDoesNotExist(key, "Boolean"); return DEFAULT_VALUE_FOR_BOOLEAN; } ConfigGetParameterHandler(
      ConfigCacheClient activatedConfigsCache, ConfigCacheClient defaultConfigsCache); }
ConfigGetParameterHandler { public boolean getBoolean(String key) { String activatedString = getStringFromCache(activatedConfigsCache, key); if (activatedString != null) { if (TRUE_REGEX.matcher(activatedString).matches()) { return true; } else if (FALSE_REGEX.matcher(activatedString).matches()) { return false; } } String defaultsString = getStringFromCache(defaultConfigsCache, key); if (defaultsString != null) { if (TRUE_REGEX.matcher(defaultsString).matches()) { return true; } else if (FALSE_REGEX.matcher(defaultsString).matches()) { return false; } } logParameterValueDoesNotExist(key, "Boolean"); return DEFAULT_VALUE_FOR_BOOLEAN; } ConfigGetParameterHandler(
      ConfigCacheClient activatedConfigsCache, ConfigCacheClient defaultConfigsCache); String getString(String key); boolean getBoolean(String key); byte[] getByteArray(String key); double getDouble(String key); long getLong(String key); FirebaseRemoteConfigValue getValue(String key); Set<String> getKeysByPrefix(String prefix); Map<String, FirebaseRemoteConfigValue> getAll(); }
ConfigGetParameterHandler { public boolean getBoolean(String key) { String activatedString = getStringFromCache(activatedConfigsCache, key); if (activatedString != null) { if (TRUE_REGEX.matcher(activatedString).matches()) { return true; } else if (FALSE_REGEX.matcher(activatedString).matches()) { return false; } } String defaultsString = getStringFromCache(defaultConfigsCache, key); if (defaultsString != null) { if (TRUE_REGEX.matcher(defaultsString).matches()) { return true; } else if (FALSE_REGEX.matcher(defaultsString).matches()) { return false; } } logParameterValueDoesNotExist(key, "Boolean"); return DEFAULT_VALUE_FOR_BOOLEAN; } ConfigGetParameterHandler(
      ConfigCacheClient activatedConfigsCache, ConfigCacheClient defaultConfigsCache); String getString(String key); boolean getBoolean(String key); byte[] getByteArray(String key); double getDouble(String key); long getLong(String key); FirebaseRemoteConfigValue getValue(String key); Set<String> getKeysByPrefix(String prefix); Map<String, FirebaseRemoteConfigValue> getAll(); @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
  static final Charset FRC_BYTE_ARRAY_ENCODING; }