It is difficult to say whether you are doing dependency injection correctly without seeing any code, however it looks like you have a design that would definitely support dependency injection (as any class/object hierarchy should).
To implement this design, I would definitely look to inject the object creation factory into instances of class 1. This means that you are able to test the logic for class 1 in isolation from the factory logic by passing in a mock factory for your unit tests around class 1, and asserting that class 1 is calling the correct methods on your factory in these tests. Your design states that the factory is passed into class 1, and therefore it appears you are indeed doing things correctly. Of course, there should be a separate set of unit tests around the factory to test it is instantiating objects a1, a2 and a3 correctly.
Hope this helps.