First, it should not add annotations problems, the general test class is unable to get the bean, it will report a null pointer. Need to make this test class to run in the spring test environment, add the following comment:
@RunWith(SpringJUnit4ClassRunner.class)