### Question:
DateSearchFilter implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { request.getProperties().put("startTime", System.currentTimeMillis()); List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null ){ validateNotVersionOneZero(request); validateDateSearchUri(request); validateNonTwoPartUri(request); } return request; }  @Override ContainerRequest filter(ContainerRequest request);  }### Answer:
@Test(expected = QueryParseException.class) public void shouldDisallowVersionOneZeroSearches() { ContainerRequest request = createRequest("v1.0/sections/1234/studentSectionAssociations", "schoolYears=2011-2012"); filter.filter(request); }
@Test public void shouldAllowVersionOneZeroNonSearchRequests() { ContainerRequest request = createRequest("v1.0/sections/1234/studentSectionAssociations", ""); filter.filter(request); }
@Test public void shonuldAllowVersionOneOneSearches() { ContainerRequest request = createRequest("v1.1/sections/1234/studentSectionAssociations", "schoolYears=2011-2012"); filter.filter(request); }
@Test(expected = QueryParseException.class) public void shouldDisallowExcludedUrisWithId() { String disallowedPath = "v1.1/sections/{id}/studentSectionAssociations"; String requestPath = "v1.1/sections/1234,23234/studentSectionAssociations"; disallowedEndpoints.add(disallowedPath); ContainerRequest request = createRequest(requestPath, "schoolYears=2011-2012"); filter.filter(request); }
@Test(expected = QueryParseException.class) public void shouldDisallowTwoPartUris() { String requestPath = "v1.1/sessions/1234567"; ContainerRequest request = createRequest(requestPath, "schoolYears=2011-2012"); filter.filter(request); }
@Test public void shouldAllowTwoPartUrisWithoutDates() { String requestPath = "v1.1/sessions/1234567"; ContainerRequest request = createRequest(requestPath, ""); filter.filter(request); }
@Test(expected = QueryParseException.class) public void shouldDisallowExcludedUrisWithoutId() { String disallowedPath = "v1.1/educationOrganizations"; String requestPath = "v1.1/educationOrganizations"; disallowedEndpoints.add(disallowedPath); ContainerRequest request = createRequest(requestPath, "schoolYears=2011-2012"); filter.filter(request); }