request scoped beans in spring testing

后端 未结 8 912
自闭症患者
自闭症患者 2020-11-30 00:54

I would like to make use of request scoped beans in my app. I use JUnit4 for testing. If I try to create one in a test like this:

@RunWith(SpringJUnit4Clas         


        
8条回答
  •  天命终不由人
    2020-11-30 01:07

    This is still an open issue:

    https://jira.springsource.org/browse/SPR-4588

    I was able to get this to work (mostly) by defining a custom context loader as outlined in

    http://forum.springsource.org/showthread.php?p=286280

提交回复
热议问题