@Test
    void singleton_components_can_be_injected() {
        ComponentGraph componentGraph = new ComponentGraph();
        String configId = "raw:stringVal \"test-value\"";

        componentGraph.add(mockComponentNode(ComponentTakingComponent.class));
        componentGraph.add(mockComponentNode(ComponentTakingConfig.class, configId));
        componentGraph.add(mockComponentNode(SimpleComponent2.class));
        componentGraph.complete();
        componentGraph.setAvailableConfigs(ConfigMap.newMap(TestConfig.class, configId));

        ComponentTakingComponent instance = componentGraph.getInstance(ComponentTakingComponent.class);
        ComponentTakingConfig injected = (ComponentTakingConfig) instance.injectedComponent;
        assertEquals("test-value", injected.config.stringVal());
    }
@author gjoranv
@author Tony Vaagenes
@author ollivir
container-core/src/test/java/com/yahoo/container/di/componentgraph/core/ComponentGraphTest.java