@Test public void getByteArray_activatedStillLoadingFromDisk_blocksAndReturnsActivatedValue() throws Exception { loadActivatedAsyncCacheWithIncompleteTask(); loadActivatedBlockingCacheWith( ImmutableMap.of(BYTE_ARRAY_KEY, ACTIVATED_BYTE_ARRAY_STRING_VALUE)); byte[] byteArrayValue = getHandler.getByteArray(BYTE_ARRAY_KEY); assertThat(byteArrayValue).isEqualTo(ACTIVATED_BYTE_ARRAY_VALUE); }
public byte[] getByteArray(String key) { String activatedString = getStringFromCache(activatedConfigsCache, key); if (activatedString != null) { return activatedString.getBytes(FRC_BYTE_ARRAY_ENCODING); } String defaultsString = getStringFromCache(defaultConfigsCache, key); if (defaultsString != null) { return defaultsString.getBytes(FRC_BYTE_ARRAY_ENCODING); } logParameterValueDoesNotExist(key, "ByteArray"); return DEFAULT_VALUE_FOR_BYTE_ARRAY; }
ConfigGetParameterHandler { public byte[] getByteArray(String key) { String activatedString = getStringFromCache(activatedConfigsCache, key); if (activatedString != null) { return activatedString.getBytes(FRC_BYTE_ARRAY_ENCODING); } String defaultsString = getStringFromCache(defaultConfigsCache, key); if (defaultsString != null) { return defaultsString.getBytes(FRC_BYTE_ARRAY_ENCODING); } logParameterValueDoesNotExist(key, "ByteArray"); return DEFAULT_VALUE_FOR_BYTE_ARRAY; } }
ConfigGetParameterHandler { public byte[] getByteArray(String key) { String activatedString = getStringFromCache(activatedConfigsCache, key); if (activatedString != null) { return activatedString.getBytes(FRC_BYTE_ARRAY_ENCODING); } String defaultsString = getStringFromCache(defaultConfigsCache, key); if (defaultsString != null) { return defaultsString.getBytes(FRC_BYTE_ARRAY_ENCODING); } logParameterValueDoesNotExist(key, "ByteArray"); return DEFAULT_VALUE_FOR_BYTE_ARRAY; } ConfigGetParameterHandler(
      ConfigCacheClient activatedConfigsCache, ConfigCacheClient defaultConfigsCache); }
ConfigGetParameterHandler { public byte[] getByteArray(String key) { String activatedString = getStringFromCache(activatedConfigsCache, key); if (activatedString != null) { return activatedString.getBytes(FRC_BYTE_ARRAY_ENCODING); } String defaultsString = getStringFromCache(defaultConfigsCache, key); if (defaultsString != null) { return defaultsString.getBytes(FRC_BYTE_ARRAY_ENCODING); } logParameterValueDoesNotExist(key, "ByteArray"); return DEFAULT_VALUE_FOR_BYTE_ARRAY; } 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 byte[] getByteArray(String key) { String activatedString = getStringFromCache(activatedConfigsCache, key); if (activatedString != null) { return activatedString.getBytes(FRC_BYTE_ARRAY_ENCODING); } String defaultsString = getStringFromCache(defaultConfigsCache, key); if (defaultsString != null) { return defaultsString.getBytes(FRC_BYTE_ARRAY_ENCODING); } logParameterValueDoesNotExist(key, "ByteArray"); return DEFAULT_VALUE_FOR_BYTE_ARRAY; } 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; }