use of com.mockrunner.mock.web.MockServletContext in project cayenne by apache.
the class CayenneFilterTest method testInitWithFilterName.
@Test
public void testInitWithFilterName() throws Exception {
MockFilterConfig config = new MockFilterConfig();
config.setFilterName("abc");
MockServletContext context = new MockServletContext();
config.setupServletContext(context);
CayenneFilter filter = new CayenneFilter();
assertNull(WebUtil.getCayenneRuntime(context));
filter.init(config);
CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
assertNotNull(runtime);
List<String> locations = runtime.getInjector().getInstance(Key.getListOf(String.class, Constants.SERVER_PROJECT_LOCATIONS_LIST));
assertEquals(Arrays.asList("abc.xml"), locations);
}
Aggregations