Just remove the static initializer. Keep setter injection (I prefer it).
Use your first example, the second code is wrong - don't use it.
Make sure you tests are being run by spring (and therefore the bean is initialized correctly by spring).
The null pointer is caused by running the test method before spring has initialized the bean.
You need somethign like this
@RunWith (SpringJUnit4ClassRunner.class)
@ContextConfiguration (locations = "classpath:/config/applicationContext-test.xml")
public class SpringTest {...}