diff --git a/source/poodinis/autowire.d b/source/poodinis/autowire.d index b602471..f8b2ce7 100644 --- a/source/poodinis/autowire.d +++ b/source/poodinis/autowire.d @@ -72,13 +72,6 @@ public void autowire(Type)(DependencyContainer container, Type instance) { } } -deprecated("Please use qualifiers instead") -mixin template AutowireConstructor() { - public this() { - globalAutowire(this); - } -} - public void globalAutowire(Type)(Type instance) { DependencyContainer.getInstance().autowire(instance); } diff --git a/test/poodinis/autowiretest.d b/test/poodinis/autowiretest.d index 7501ed5..042a343 100644 --- a/test/poodinis/autowiretest.d +++ b/test/poodinis/autowiretest.d @@ -39,13 +39,6 @@ version(unittest) { public ComponentC componentC; } - class ComponentF { - @Autowired - public ComponentA componentA; - - mixin AutowireConstructor; - } - class ComponentDeclarationCocktail { alias noomer = int; @@ -119,21 +112,6 @@ version(unittest) { assert(componentE.componentC is null, "Autowiring should not occur for members with attributes other than @Autowire"); } - // Test autowire in constructor - unittest { - auto container = DependencyContainer.getInstance(); - container.register!ComponentA; - auto componentF = new ComponentF(); - auto autowiredComponentA = componentF.componentA; - container.register!(ComponentF).existingInstance(componentF); - assert(componentF.componentA !is null, "Constructor did not autowire component F"); - - auto resolvedComponentF = container.resolve!ComponentF; - assert(resolvedComponentF.componentA is autowiredComponentA, "Resolving instance of ComponentF rewired members"); - - container.clearAllRegistrations(); - } - // Test autowire class with alias declaration unittest { auto container = new DependencyContainer();