BasicEndpointCaller implements EndpointCaller { @Override public String doPutEntity(Map<String, String> requestProperties, URL urlToCall, String body, MediaType type) throws ODataClientException { return sendRequest(populateRequestProperties(requestProperties, body.length(), type, type), urlToCall, body, ODataRequest.Method.PUT.name()); } BasicEndpointCaller(Properties properties); @Override String callEndpoint(Map<String, String> requestProperties, URL urlToCall); @Override InputStream getInputStream(Map<String, String> requestProperties, URL url); @Override String doPostEntity(Map<String, String> requestProperties, URL urlToCall, String body,
                               MediaType contentType, MediaType acceptType); @Override String doPutEntity(Map<String, String> requestProperties, URL urlToCall, String body,
                              MediaType type); @Override void doDeleteEntity(Map<String, String> requestProperties, URL urlToCall);  }
@Test public void unauthorizedPutEntity() throws MalformedURLException, ODataClientException { thrown.expect(ODataClientNotAuthorized.class); caller.doPutEntity(new HashMap<>(), buildUrlToCall(HTTP_UNAUTHORIZED), "", JSON); }
@Test public void forbiddenPutEntity() throws MalformedURLException, ODataClientException { thrown.expect(ODataClientHttpError.class); caller.doPutEntity(new HashMap<>(), buildUrlToCall(HTTP_FORBIDDEN), "", JSON); }
@Test public void timeoutPutEntity() throws MalformedURLException, ODataClientException { thrown.expect(ODataClientTimeout.class); caller.doPutEntity(new HashMap<>(), buildUrlToCall(HTTP_CLIENT_TIMEOUT), "", JSON); }