public class CategoryCalendarTest extends ActionControllerTest {
@Test
public void testWithValidCategory() throws Exception {
ActionProxy proxy = getActionProxy(GET, "/calendars/category/" + EventCategory.getCategories().get(0).getKey());
proxy.execute();
assertThat(Helpers.contentType(proxy.getResult()), is("text/calendar"));
assertThat(Helpers.charset(proxy.getResult()), is("utf-8"));
assertThat(Helpers.header("Content-Disposition", proxy.getResult()), is("inline"));
CalendarBuilder builder = new CalendarBuilder();
Calendar calendar = builder.build(new ByteArrayInputStream(Helpers.contentAsBytes(proxy.getResult())));
ComponentList list = calendar.getComponents(Component.VEVENT);
List<String> uids = new ArrayList<String>();
for (Object obj : list) {
VEvent vEvent = (VEvent) obj;