public void shouldDeclareExtensionWhenAdding() {
ComponentContainer container = new ComponentContainer();
PluginMetadata plugin = mock(PluginMetadata.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();
}