@Test
public void test_value_loaded_with_source_supporting_requested_format() throws Exception {

    String bundleName = "folder.bundle";
    String objectName = "folder/bundle.properties";
    ResourceKey key = key(bundleName, "value");
    Clock clock = Clock.systemUTC();
    ResourceResolutionContext ctx = in("ctx");
    ResourceObject bundleSlowCtx = given(aPropertiesBundle(objectName, "folder/bundle-ctx.properties").with("value","slow-ctx"));
    ResourceObject bundleSlowCommon = given(aPropertiesBundle(objectName, objectName).with("value","slow"));
    HeapResourceObjectRepository pSlow = new HeapResourceObjectRepository(clock);
    pSlow.put(objectName, ctx, bundleSlowCtx::asStream);
    pSlow.put(objectName, withoutContext(), bundleSlowCommon::asStream);
    ResourceObject bundleFastCommon = given(aPropertiesBundle().with("value","fast"));
    HeapResourceObjectRepository pFast = new HeapResourceObjectRepository(clock);
    pFast.put(objectName, ctx, bundleFastCommon::asStream);
    ExpensiveResourceObjectProvider mSlow = managed("slow", pSlow);
    mSlow.whenRequested(bundleName, ctx).sleep(1000);
    ExpensiveResourceObjectProvider mFast = managed("fast", pFast);
    RefreshableResources resources = new RefreshableResources(
            configure()
                    .sources(mSlow.objectsLike(name(".\\.xml$")),
                            mFast.objectsLike(name(".\\.properties$")))
                    .formats(format(propertyMap(), ".properties"))
                    .get());
    OptionalString value = resources.get(key, ctx);
    assertEquals("fast", value.asIs());
}