@Test
    void testNoCachingOfEmptyConfig() {
        ConfigTester tester = new ConfigTester();
        MemoryCache cache = proxy.memoryCache();

        assertEquals(0, cache.size());
        RawConfig res = proxy.resolveConfig(tester.createRequest(fooConfig)).orElseThrow();
        assertNotNull(res);
        assertEquals(ConfigTester.fooPayload.toString(), res.getPayload().toString());
        assertEquals(1, cache.size());

        // Simulate an empty response
        RawConfig emptyConfig = new RawConfig(fooConfig.getKey(), fooConfig.getDefMd5(), Payload.from("{}"),
                                 fooConfig.getPayloadChecksums(), 0, false,
                                 0, fooConfig.getDefContent(), Optional.empty());
        source.put(fooConfig.getKey(), emptyConfig);

        res = proxy.resolveConfig(tester.createRequest(fooConfig)).orElseThrow();
        assertEquals(emptyConfig.getPayload().toString(), res.getPayload().toString());
        assertEquals(0, cache.size());

        // Put a version of the same config into backend with new generation and see that it now works (i.e. we are
        // not getting a cached response (of the error in the previous request)
        source.put(fooConfig.getKey(), createConfigWithNextConfigGeneration(fooConfig, 0));

        // Verify that we get the config now and that it is cached
        res = proxy.resolveConfig(tester.createRequest(fooConfig)).orElseThrow();
        assertNotNull(res.getPayload().getData());
        assertEquals(ConfigTester.fooPayload.toString(), res.getPayload().toString());
        assertEquals(1, cache.size());
    }
Verifies that config with generation 0 (used for empty sentinel config) is not cached.
If it was cached, it would be served even when newer config is available
(as they ask for config, saying that it now has config with generation 0).
When the config has been successfully retrieved it must be updated in cache.
config-proxy/src/test/java/com/yahoo/vespa/config/proxy/ProxyServerTest.java