protected void setUp() throws Exception { super.setUp(); ReflectionFactory reflectionFactory = EasyMock.createNiceMock(ReflectionFactory.class); LifecycleInvoker invoker = EasyMock.createMock(LifecycleInvoker.class); EasyMock.expect(reflectionFactory.createLifecycleInvoker(EasyMock.isA(Method.class))) .andReturn(invoker); ClassLoaderRegistry classLoaderRegistry = EasyMock.createMock(ClassLoaderRegistry.class); EasyMock.expect(classLoaderRegistry.getClassLoader(EasyMock.anyObject())) .andReturn(getClass().getClassLoader()) .anyTimes(); EasyMock.replay(reflectionFactory, classLoaderRegistry); builder = new ImplementationManagerFactoryBuilderImpl(reflectionFactory, classLoaderRegistry); Constructor<Foo> constructor = Foo.class.getConstructor(String.class, Long.class); definition = new ImplementationManagerDefinition(); definition.setImplementationClass(Foo.class); definition.setConstructor(constructor); definition.setInitMethod(Foo.class.getMethod("init")); definition.setDestroyMethod(Foo.class.getMethod("destroy")); Map<InjectionSite, Injectable> construction = definition.getConstruction(); construction.put( new ConstructorInjectionSite(constructor, 0), new Injectable(InjectableType.PROPERTY, "a")); construction.put( new ConstructorInjectionSite(constructor, 1), new Injectable(InjectableType.REFERENCE, "b")); }