@Test(expected = NoSuchContainerException.class) public void testSetCurrentContainerException() { Request request = createMock(Request.class); ApplicationContext context = createMock(ApplicationContext.class); Map<String, Object> attribs = new HashMap<String, Object>(); expect(request.getApplicationContext()).andReturn(context); expect(context.getApplicationScope()).andReturn(attribs).anyTimes(); replay(request, context); try { SetCurrentContainerModel model = new SetCurrentContainerModel(); model.execute("myKey", request); } finally { verify(request, context); } }
public void execute(String containerKey, Request request) { TilesAccess.setCurrentContainer(request, containerKey); }
SetCurrentContainerModel { public void execute(String containerKey, Request request) { TilesAccess.setCurrentContainer(request, containerKey); } }
SetCurrentContainerModel { public void execute(String containerKey, Request request) { TilesAccess.setCurrentContainer(request, containerKey); }  }
SetCurrentContainerModel { public void execute(String containerKey, Request request) { TilesAccess.setCurrentContainer(request, containerKey); }  void execute(String containerKey, Request request); }
SetCurrentContainerModel { public void execute(String containerKey, Request request) { TilesAccess.setCurrentContainer(request, containerKey); }  void execute(String containerKey, Request request);  }