import com.mapper.AccountMapper;
import com.service.impl.AccountServiceImpl;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test2 {
    @Test
    public void testDemo() {
        AnnotationConfigApplicationContext annotationConfigApplicationContext
                = new AnnotationConfigApplicationContext();
        annotationConfigApplicationContext.scan("com");
        annotationConfigApplicationContext.refresh();
        AccountServiceImpl bean = annotationConfigApplicationContext.getBean(AccountServiceImpl.class);
        Object getUserName = annotationConfigApplicationContext.getBean("getUserName");
        bean.sayHello();
    }
}
