### Question:
WeeklyExpiresHeaderFilter extends AbstractExpiresHeaderFilter { @Override protected void doActivate(ComponentContext context) throws Exception { super.doActivate(context); @SuppressWarnings("unchecked") Dictionary<String, Object> props = context.getProperties(); dayOfWeek = PropertiesUtil.toInteger(props.get(PROP_EXPIRES_DAY_OF_WEEK), -1); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) { throw new ConfigurationException(PROP_EXPIRES_DAY_OF_WEEK, "Day of week must be valid value from Calendar DAY_OF_WEEK attribute."); } }    }### Answer:
@Test(expected = ConfigurationException.class) public void testDoActivateCallsParent() throws Exception { properties.remove(WeeklyExpiresHeaderFilter.PROP_EXPIRES_TIME); filter.doActivate(componentContext); }
@Test(expected = ConfigurationException.class) public void testDoActivateNoDayOfWeek() throws Exception { filter.doActivate(componentContext); }
@Test(expected = ConfigurationException.class) public void testDoActivateInvalidLowDayOfWeek() throws Exception { properties.put(WeeklyExpiresHeaderFilter.PROP_EXPIRES_DAY_OF_WEEK, Calendar.SUNDAY - 1); filter.doActivate(componentContext); }
@Test(expected = ConfigurationException.class) public void testDoActivateInvalidHighDayOfWeek() throws Exception { properties.put(WeeklyExpiresHeaderFilter.PROP_EXPIRES_DAY_OF_WEEK, Calendar.SATURDAY + 1); filter.doActivate(componentContext); }