public void testGetRequestNoIdRequested() throws Exception { params.put("VERSION", "2.0.2"); try { getRequest(params); fail("expected ServiceException if no ID is requested"); } catch (ServiceException e) { assertEquals(ServiceException.MISSING_PARAMETER_VALUE, e.getCode()); assertEquals("id", e.getLocator()); } }
public void testParseValidRequest() throws Exception { params.put("service", "csw"); params.put("VERSION", "2.0.2"); params.put("id", "foo"); GetRepositoryItemType request = getRequest(params); assertEquals("2.0.2", request.getVersion()); assertEquals("csw", request.getService()); assertEquals("foo", request.getId()); } }
private GetRepositoryItemType getRequest(Map<String, String> rawKvp) throws Exception { return getRequest(rawKvp, new HashMap<String, Object>(rawKvp)); }