@Test public void shouldDeclareExtensionWhenAdding() { ComponentContainer container = new ComponentContainer(); PluginInfo plugin = mock(PluginInfo.class); container.addExtension(plugin, ComponentWithProperty.class); PropertyDefinitions propertyDefinitions = container.getComponentByType(PropertyDefinitions.class); assertThat(propertyDefinitions.get("foo")).isNotNull(); assertThat(container.getComponentByType(ComponentWithProperty.class)).isNotNull(); assertThat(container.getComponentByKey(ComponentWithProperty.class)).isNotNull(); }