assertEquals(ODataHttpMethod.GET, retrieveRequest.getMethod());
if (!retrieveRequest.getAcceptableLanguages().isEmpty()) {
assertEquals(3, retrieveRequest.getAcceptableLanguages().size());
}
assertEquals(new URI(SERVICE_ROOT), retrieveRequest.getPathInfo().getServiceRoot());
ODataPathSegmentImpl pathSegment = new ODataPathSegmentImpl("Employees('2')", null);
assertEquals(pathSegment.getPath(), retrieveRequest.getPathInfo().getODataSegments().get(0).getPath());
if (retrieveRequest.getQueryParameters().get("$format") != null) {
assertEquals("json", retrieveRequest.getQueryParameters().get("$format"));
}
assertEquals(SERVICE_ROOT + "Employees('2')/EmployeeName?$format=json", retrieveRequest.getPathInfo()
.getRequestUri().toASCIIString());
} else {
List<ODataRequest> requests = object.getRequests();
for (ODataRequest request : requests) {
assertEquals(ODataHttpMethod.PUT, request.getMethod());
assertEquals("100000", request.getRequestHeaderValue(HttpHeaders.CONTENT_LENGTH.toLowerCase()));
assertEquals("application/json;odata=verbose", request.getContentType());
assertEquals(3, request.getAcceptHeaders().size());
assertNotNull(request.getAcceptableLanguages());
assertTrue(request.getAcceptableLanguages().isEmpty());
assertEquals("*/*", request.getAcceptHeaders().get(2));
assertEquals("application/atomsvc+xml", request.getAcceptHeaders().get(0));
assertEquals(new URI(SERVICE_ROOT + "Employees('2')/EmployeeName").toASCIIString(), request.getPathInfo()
.getRequestUri().toASCIIString());
ODataPathSegmentImpl pathSegment = new ODataPathSegmentImpl("Employees('2')", null);
assertEquals(pathSegment.getPath(), request.getPathInfo().getODataSegments().get(0).getPath());
ODataPathSegmentImpl pathSegment2 = new ODataPathSegmentImpl("EmployeeName", null);
assertEquals(pathSegment2.getPath(), request.getPathInfo().getODataSegments().get(1).getPath());
}
}
}
}