Assert.assertThat(food.getPrice(), is(3.99));
}
@Test
public void testInterceptor() {
MockHttpServletRequest request = new MockHttpServletRequest();
request.setRequestURI("/firefly/app/food");
request.setServletPath("/app");
request.setContextPath("/firefly");
request.setMethod("GET");
MockHttpServletResponse response = new MockHttpServletResponse();
dispatcherController.dispatch(request, response);
Food food = (Food)request.getAttribute("fruit");
Assert.assertThat(food.getName(), is("orange"));
Assert.assertThat(food.getPrice(), is(3.5));
food = (Food)request.getAttribute("fruit0");
Assert.assertThat(food.getName(), is("apple"));
Assert.assertThat(food.getPrice(), is(8.0));
food = (Food)request.getAttribute("strawberry");
Assert.assertThat(food.getName(), is("strawberry"));
Assert.assertThat(food.getPrice(), is(10.0));
}