I'm used to test-driven development and Spring when coding and therefore I was thinking about creating a special class that injected dependencies to my classes in my
SCJD exam (Urlybird). I know that SUN runs several automated tests on the Data class that I am to create but I've found nothing in the documentation that says that dependencies for this class are not allowed to be set after instantiation. I.e. if SUN's tests would instantiate my Data class directly in the tests it would have no dependencies by default. This way, the RandomAccessFile (my database) and other dependencies would be null. So my question is, does SUN's tests require me to instantiate a new RandomAccessFile(..) (and other dependencies as well) when they instantiate my Data class? The reason that I'd like to have some sort of dependency injection is that I want to facilitate
unit testing that enables me to mock objects(and not only do integration unit testing). I could use some kind of dependency lookup instead and work my way around the problem, but this approach is not as nice.